TauDEM
TauDEM copied to clipboard
Segmentation Fault in dropanalysis
I'm working on an open book style watershed, and I was trying to run the dropanalysis tool, and caused a segfault. Running on a linux machine with code compiled from a download of the master branch this morning.
Here is the stack trace:
#0 0x0000000000405163 in dropan (areafile=0x7fffffff5940 "open_book_201x200_ad8.tif", dirfile=0x7fffffff6940 "open_book_201x200_p.tif", elevfile=0x7fffffff7940 "open_book_201x200_fel.tif", ssafile=0x7fffffff8940 "open_book_201x200_ssa.tif", dropfile=0x7fffffff9940 "open_book_201x200_drp.txt", datasrc=0x7fffffffa940 "outlet.shp", lyrname=0x7fffffffb940 "\330\037¥4", uselyrname=0, lyrno=0, threshmin=5, threshmax=500, nthresh=10, steptype=0, threshopt=0x7fffffffc96c) at DropAnalysis.cpp:309
#1 0x00000000004121e1 in main (argc=18, argv=0x7fffffffcb38) at DropAnalysismn.cpp:184
I looked at the code in DropAnalysis.cpp, and on line 308 I noticed a comment about no data. I uncommented this print, compiled, and reran the drop analysis, and, sure enough, it appears that there is no-data being returned, and then used to index an array.
DropAnalysis version 5.3.8 Input file open_book_201x200_ssa.tif has projected coordinate system. This run may take on the order of 1 minutes to complete. This estimate is very approximate. Run time is highly uncertain as it depends on the complexity of the input data and speed and memory of the computer. This estimate is based on our testing on a dual quad core Dell Xeon E5405 2.0GHz PC with 16GB RAM. Input file open_book_201x200_p.tif has projected coordinate system. Input file open_book_201x200_ad8.tif has projected coordinate system. Outlet direction: -32768 Segmentation fault (core dumped)
Thanks for pointing this out. Is there a way you can get me the input files that trigger this. Zip them and put them in this issue if github will allow files as big as they are, or put them in www.hydroshare.org and send them to me. This will make it easier to reproduce and try to correct.
drop_analysis_bug_files.tar.gz
The files are pretty small, so I added the original DEM and the nessicary files to feed dropanalysis. I also included the shell script used to generate all of the files. On a linux system, you can use the shell script to recreate them using taudem_proccess.sh open_book_201x200
Also in the script, you can see the invocation I was using for drop analysis which caused the seg fault:
dropanalysis -ad8 open_book_201x200_ad8.tif -p open_book_201x200_p.tif -fel open_book_201x200_fel.tif -ssa open_book_201x200_ssa.tif -o outlet.shp -drp open_book_201x200_drp.txt -par 5 500 10 0
I'm having this issue too.
I wonder if it is related to having incomplete DEM coverage of the watershed? I've made sure all my outputs are in locations where there is DEM data and used the moveoutletstostrm
function successfully to generate outletsmoved.shp
.
$ dropanalysis -p nvp.tif -fel nvfel.tif -ad8 nvad8.tif -ssa nvss.tif -drp nvdrp.txt -o outletsmoved.shp -par 5 500 10 0
DropAnalysis version 5.3.8
Input file nvss.tif has projected coordinate system.
This run may take on the order of 6 minutes to complete.
This estimate is very approximate.
Run time is highly uncertain as it depends on the complexity of the input data
and speed and memory of the computer. This estimate is based on our testing on
a dual quad core Dell Xeon E5405 2.0GHz PC with 16GB RAM.
Input file nvp.tif has projected coordinate system.
Input file nvad8.tif has projected coordinate system.
Warning: Projection of Outlet feature and Raster data may be different.
Projection of Raster datasource NAD83 / UTM zone 10N.
Projection of Outlet feature NAD_1983_UTM_Zone_10N.
[Elkhorn:30747] *** Process received signal ***
[Elkhorn:30747] Signal: Segmentation fault: 11 (11)
[Elkhorn:30747] Signal code: Address not mapped (1)
[Elkhorn:30747] Failing at address: 0x1086b0580
[Elkhorn:30747] [ 0] 0 libsystem_platform.dylib 0x00007fff6a68df5a _sigtramp + 26
[Elkhorn:30747] [ 1] 0 dropanalysis 0x00000001086d3623 _ZTI10linearpartIfE + 3603
[Elkhorn:30747] [ 2] 0 dropanalysis 0x00000001086cd133 main + 1074
[Elkhorn:30747] [ 3] 0 libdyld.dylib 0x00007fff6a40c115 start + 1
[Elkhorn:30747] [ 4] 0 ??? 0x0000000000000012 0x0 + 18
[Elkhorn:30747] *** End of error message ***
Segmentation fault: 11