Opened 12 years ago
Closed 4 years ago
#4011 closed defect (wontfix)
[PATCH]GDALFillNoData(): Assertion triggered by -si option
Reported by: | Even Rouault | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | closed_because_of_github_migration |
Component: | Algorithms | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | Kyle Shannon |
Description (last modified by )
python swig/python/scripts/gdal_fillnodata.py byte.asc out.tif -si 1
triggers :
ERROR 7: Assertion `pabyThisTMask[iX]' failed in file `rasterfill.cpp', line 61
Attachments (2)
Change History (12)
by , 12 years ago
comment:1 by , 11 years ago
Cc: | added |
---|
comment:3 by , 11 years ago
Just for completness, before the crash, Valgrind complains about use of uninitialized values.
0...10...20...30...40...50...60...70==11729== Conditional jump or move depends on uninitialised value(s) ==11729== at 0x72F0027: GDALFillNodata (rasterfill.cpp:708) ==11729== by 0x6667C9E: FillNodata(void*, void*, double, int, char**, int (*)(double, char const*, void*), void*) (gdal_wrap.cpp:4729) ==11729== by 0x666C691: _wrap_FillNodata (gdal_wrap.cpp:18560) ==11729== by 0x4A8783: PyEval_EvalFrameEx (in /usr/bin/python2.6) ==11729== by 0x4A9670: PyEval_EvalCodeEx (in /usr/bin/python2.6) ==11729== by 0x4A9741: PyEval_EvalCode (in /usr/bin/python2.6) ==11729== by 0x4C9A0D: PyRun_FileExFlags (in /usr/bin/python2.6) ==11729== by 0x4C9C23: PyRun_SimpleFileExFlags (in /usr/bin/python2.6) ==11729== by 0x41A7FE: Py_Main (in /usr/bin/python2.6) ==11729== by 0x5EEEC4C: (below main) (libc-start.c:226)
comment:4 by , 11 years ago
Fair enough, I new it was hacky. Possibly there should be better checking in gdal_fillnodata.py and set the maskband=None if necessary. I am looking a bit more, I will try to find the _real_ issue.
comment:6 by , 8 years ago
Replying to jratike80:
Did you find the _real_issue, kyle?
No, I haven't had time to look into it again.
comment:7 by , 8 years ago
Description: | modified (diff) |
---|
It appears that the smoothing needs to use an updated mask with the filled data. This happens easily when a dataset is update in place, using GDALFlushRasterCache() on the mask band for the data. If the mask is external, though, the values are reverted back to the original no data mask. I *think* the original intention was to use the updated mask, which worked if filling in place. The assert would make more sense then, as the filtered data would have to have a new value, not no data.
To resolve this, before starting the smoothing, I replace the supplied mask band with the filled target mask band, recomputed. This works with the test data on this ticket, the data on #4539, and I tested all three mask options, default, nomask, and a mask file. So #4539 can be closed if this works,
patch attached.
comment:8 by , 8 years ago
Summary: | GDALFillNoData(): Assertion triggered by -si option → [PATCH]GDALFillNoData(): Assertion triggered by -si option |
---|
#3988 may close too with the patch. Valgrind didn't show any warnings, although there is a lot of python noise, I may have missed something.
comment:10 by , 4 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.
Even, In ticket #4539 I think I fixed this. The way I found it was by using the c api and then just changing the mask band:
It worked. I just made sure that the no data value on the hDstBand and PamDataset returns a No Data mask by default(?). I think that explains why it works. If the mask handle is null, I believe it runs.
kss