amforte / Topographic-Analysis-Kit

Set of matlab based tools for topographic analysis, built on top of TopoToolbox.
GNU General Public License v3.0
42 stars 35 forks source link

MakeStreams "Segmentation violation" error when calculating flow accumulation #46

Closed ginevmoore closed 3 years ago

ginevmoore commented 3 years ago

When running the first tutorial I ran into an issue with one of the first commands listed in the .ppt (see commands and output in matlab environment listed below. The MakeStreams command works up until the "Calculating Flow Accumulation" message is printed to the command line, and then MATLAB prints this error and needs to be restarted. Is this something you have seen before?

Thank you for providing this awesome set of tools!

-Ginevra

Matlab environment for debugging:

addpath(genpath('/Users/ginevramoore/Documents/MATLAB/Add-Ons/Toolboxes/Topographic-Analysis-Kit')) addpath(genpath('/Users/ginevramoore/Documents/MATLAB/Add-Ons/Toolboxes/topotoolbox')) CheckTAKDependencies ; [DEM,FD,A,S]=MakeStreams('../TutorialFiles/Tutorial_Data/DEM.tif',1e6,'file_name','SanGabes'); Loading and processing DEM Cleaning Up DEM Calculating Flow Direction 05-Jan-2021 15:52:20 -- Sink filling 05-Jan-2021 15:52:24 -- Flat sections identified 05-Jan-2021 15:52:25 -- Weights for graydist calculated 05-Jan-2021 15:52:26 -- Auxiliary topography in flats calculated 05-Jan-2021 15:52:26 -- Pixels sorted (1) 05-Jan-2021 15:52:27 -- Pixels sorted (2) 05-Jan-2021 15:52:29 -- Ordered topology established Calculating Flow Accumulation


   Segmentation violation detected at Tue Jan 05 15:52:32 2021 -0800

Configuration: Crash Decoding : Disabled - No sandbox or build area path Crash Mode : continue (default) Default Encoding : ISO-8859-1 Deployed : false Graphics Driver : Unknown hardware Java Version : Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode MATLAB Architecture : maci64 MATLAB Entitlement ID : 7788106 MATLAB Root : /Applications/MATLAB_R2019a.app MATLAB Version : 9.6.0.1472908 (R2019a) Update 9 OpenGL : hardware Operating System : Mac OS Version 10.13.5 (Build 17F77) Process ID : 1181 Processor ID : x86 Family 6 Model 142 Stepping 9, GenuineIntel Session Key : 98824e8e-4b04-43d0-a662-a4bf88000b59 Window System : Quartz

Fault Count: 1

Abnormal termination: Segmentation violation

Register State (from fault): RAX = 00000001a1107020 RBX = 004a24e9004a2c0b RCX = 0000000000000000 RDX = 0000000000000000 RSP = 0000700000f899c0 RBP = 0000700000f89a00 RSI = 0000000000000000 RDI = 004a2c0d004a332f

R8 = 0000000000000000 R9 = 0000000000000004 R10 = 0000000000000000 R11 = 0000000000000202 R12 = 00000001b4865020 R13 = 0000700000f8a088 R14 = 00000001b0b18020 R15 = 00000000006448fa

RIP = 000000016e7f8e38 RFL = 0000000000010246

CS = 000000000000002b FS = 0000000000000000 GS = 0000000000000000

Stack Trace (from fault): [ 0] 0x000000010bb77ed1 bin/maci64/libmwfl.dylib+00007889 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000049 [ 1] 0x000000010bb7dc55 bin/maci64/libmwfl.dylib+00031829 _ZN10foundation4core4test17terminate_handledERKNSt3112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00006421 [ 2] 0x000000010bb7c085 bin/maci64/libmwfl.dylib+00024709 _ZN10foundation4core4diag13terminate_logEPKcPK17darwin_ucontext+00000149 [ 3] 0x0000000110b14b37 bin/maci64/libmwmcr.dylib+00670519 _Z19mnPrintErrorMessageRKNSt3112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00013063 [ 4] 0x0000000110b126c7 bin/maci64/libmwmcr.dylib+00661191 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003735 [ 5] 0x0000000110b0fe54 bin/maci64/libmwmcr.dylib+00650836 mnFatalSignalHandler+00000148 [ 6] 0x00007fff5c344f5a /usr/lib/system/libsystem_platform.dylib+00008026 _sigtramp+00000026 [ 7] 0x000000010e487000 +00000000 [ 8] 0x0000000111c7b52c bin/maci64/libmex.dylib+00242988 _ZNK18C_DispatchStrategy8dispatchEiPP11mxArraytagiS2+00000140 [ 9] 0x0000000111c7b2e4 bin/maci64/libmex.dylib+00242404 _ZN7Mfh_mex30dispatch_file_with_protectionsEiPP11mxArraytagiS2+00000484 [ 10] 0x0000000111c62cdf bin/maci64/libmex.dylib+00142559 _ZN7Mfh_mex13dispatch_fileEiPP11mxArraytagiS2+00000159 [ 11] 0x0000000110c5f78e bin/maci64/libmwm_dispatcher.dylib+00493454 _ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2iS2+00000142 [ 12] 0x0000000110c5fdaa bin/maci64/libmwm_dispatcher.dylib+00495018 _ZN8Mfh_file8dispatchEiPNSt3110unique_ptrI11mxArray_tagN6matrix6detail17mxDestroydeleterEEEiPPS2+00000378 [ 13] 0x000000011269f0bd bin/maci64/libmwm_lxe.dylib+09715901 _ZN9MathWorks3lxe17LxeDispatcherImpl12apply_handleEPNS0_29DispatcherFunctionHandleTokenEmPNS0_6xvalueEmPKS4_NS0_9ApplyTypeE+00001357 [ 14] 0x00000001127a199c bin/maci64/libmwm_lxe.dylib+10774940 _ZN9MathWorks3lxe12apply_handleEPvNS_2ts4TypeEPKvS1S1+00000556 [ 15] 0x00000001127a1892 bin/maci64/libmwm_lxe.dylib+10774674 _ZN9MathWorks3lxe12apply_handleEPvNS_2ts4TypeEPKvS1S1+00000290 [ 16] 0x000000011270114e bin/maci64/libmwm_lxe.dylib+10117454 _ZN9MathWorks3lxe38cpp_primitive_template_fn_with_contextIXadL_ZNS0_12apply_handleEPvNS_2ts4TypeEPKvS2_S2_EEEEbS2_S4_S6_S2S2+00000014 [ 17] 0x0000000111ee70b0 bin/maci64/libmwm_lxe.dylib+01622192 _ZN9MathWorks3lxe13IrInterpreter17ApplyCppPrimitiveEPN2ir4termES4_RKNS2ts4TypeES8+00000448 [ 18] 0x0000000111ee63c7 bin/maci64/libmwm_lxe.dylib+01618887 _ZN9MathWorks3lxe13IrInterpreter31process_application_of_constantEPN2ir4termE+00001191 [ 19] 0x0000000111ee4bbd bin/maci64/libmwm_lxe.dylib+01612733 _ZN9MathWorks3lxe13IrInterpreter13applyConstantEPN2ir4termE+00000077 [ 20] 0x0000000111ed9403 bin/maci64/libmwm_lxe.dylib+01565699 _ZN9MathWorks3lxe12IRTreeWalker9applyTermEPN2ir4termE+00000099 [ 21] 0x0000000111ed96a9 bin/maci64/libmwm_lxe.dylib+01566377 _ZN9MathWorks3lxe12IRTreeWalker11getNextIRPCENS0_9irpc_typeE+00000217 [ 22] 0x0000000111ee4917 bin/maci64/libmwm_lxe.dylib+01612055 _ZN9MathWorks3lxe13IrInterpreter9tree_walkERKNS0_9irpctypeES4+00000215 [ 23] 0x0000000111ee47ec bin/maci64/libmwm_lxe.dylib+01611756 _ZN9MathWorks3lxe13IrInterpreter9InterpretEv+00000108 [ 24] 0x0000000111ff4fdf bin/maci64/libmwm_lxe.dylib+02727903 _ZN9MathWorks3lxe15ExecutionDriver9ThreadRunEv+00000911 [ 25] 0x0000000111ffa137 bin/maci64/libmwm_lxe.dylib+02748727 ZN9MathWorks3lxe12IrEngineImpl5ApplyERKN2ir4termEPvS6+00000295 [ 26] 0x000000011256cb19 bin/maci64/libmwm_lxe.dylib+08461081 ZN9MathWorks3lxe17IrEngineDecorator5ApplyERKN2ir4termEPvS6+00000153 [ 27] 0x000000011251bb49 bin/maci64/libmwm_lxe.dylib+08129353 _ZN9MathWorks3lxe9Evaluator15ApplyStatementsERKNSt3112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKN2ir4termERNS0_18IEvaluationContextE+00000425 [ 28] 0x000000011251fa47 bin/maci64/libmwm_lxe.dylib+08145479 _ZN9MathWorks3lxe9Evaluator17EvalStatementImplERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERNS0_18IEvaluationContextE+00000215 [ 29] 0x000000011251fb0a bin/maci64/libmwm_lxe.dylib+08145674 _ZN9MathWorks3lxe9Evaluator13EvalStatementERKNSt3112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEERNS0_18IEvaluationContextE+00000106 [ 30] 0x00000001125aeb77 bin/maci64/libmwm_lxe.dylib+08731511 _ZN9MathWorks3lxe9LxeBridge7EvalCmdERKNSt3112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb+00000327 [ 31] 0x00000001125aea67 bin/maci64/libmwm_lxe.dylib+08731239 _ZN9MathWorks3lxe9LxeBridge7EvalCmdERKNSt3112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb+00000055 [ 32] 0x0000000111ce6d4d bin/maci64/libmwbridge.dylib+00077133 _Z8mnParserv+00000653 [ 33] 0x0000000110adb4e6 bin/maci64/libmwmcr.dylib+00435430 _Z15runParserHelperv+00000326 [ 34] 0x0000000110a7c295 bin/maci64/libmwmcr.dylib+00045717 _ZN14cmddistributor15PackagedTaskIIP13getTypeStringIvEENSt3112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEv+00000917 [ 35] 0x0000000110a7c1d7 bin/maci64/libmwmcr.dylib+00045527 _ZN14cmddistributor15PackagedTaskIIP13getTypeStringIvEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEv+00000727 [ 36] 0x0000000110a7c182 bin/maci64/libmwmcr.dylib+00045442 _ZN14cmddistributor15PackagedTaskIIP13getTypeStringIvEENSt3112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEv+00000642 [ 37] 0x000000011098dc0e bin/maci64/libmwiqm.dylib+00359438 _ZN7mwboost6detail8function21function_obj_invoker0INSt318functionIFNS_3anyEvEEES5_E6invokeERNS1_15function_bufferE+00000030 [ 38] 0x000000011098d62b bin/maci64/libmwiqm.dylib+00357931 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tag+00000251 [ 39] 0x0000000110abb44d bin/maci64/libmwmcr.dylib+00304205 _Z14mcr_terminate0v+00006717 [ 40] 0x00000001109736ae bin/maci64/libmwiqm.dylib+00251566 _ZNK3iqm17DefaultPacketInfo7executeEP15inWorkSpace_tag+00001022 [ 41] 0x0000000110955f5f bin/maci64/libmwiqm.dylib+00130911 _ZN3iqm10DefaultIqm13dequeueHelperEN7mwboost8optionalImEERKNSt3__112basic_stringIDsNS4_11char_traitsIDsEENS4_9allocatorIDsEEEEN6mlutil14cmddistributor13WhenToDequeue13WhenToDequeueERKNS4_8functionIFbRKNS4_5tupleIJSG_NS1_10shared_ptrINS_22IntermediatePacketInfoEEESA_EEEEEE+00001119 [ 42] 0x0000000110949e7a bin/maci64/libmwiqm.dylib+00081530 _ZN3iqm10DefaultIqm7dequeueEN6mlutil14cmddistributor13WhenToDequeue13WhenToDequeueEN7mwboost8optionalImEE+00000362 [ 43] 0x0000000110aa755a bin/maci64/libmwmcr.dylib+00222554 _ZN3mcr7runtime22InterpreterThreadMulti14process_eventsEv+00000202 [ 44] 0x0000000110aa7cb7 bin/maci64/libmwmcr.dylib+00224439 _ZN3mcr7runtime22InterpreterThreadMulti10threadMainENSt3113packaged_taskIFvvEEE+00000183 [ 45] 0x0000000110aa8c60 bin/maci64/libmwmcr.dylib+00228448 _ZN3mcr7runtime22InterpreterThreadMulti10threadMainENSt3__113packaged_taskIFvvEEE+00004192 [ 46] 0x00000001099031ec /Applications/MATLAB_R2019a.app/bin/maci64/libmwboost_thread.dylib+00012780 _ZN7mwboost6thread21start_thread_noexceptEv+00000380 [ 47] 0x00007fff5c34e661 /usr/lib/system/libsystem_pthread.dylib+00013921 _pthread_body+00000340 [ 48] 0x00007fff5c34e50d /usr/lib/system/libsystem_pthread.dylib+00013581 _pthread_body+00000000 [ 49] 0x00007fff5c34dbf9 /usr/lib/system/libsystem_pthread.dylib+00011257 thread_start+00000013

This error was detected while a MEX-file was running. If the MEX-file is not an official MathWorks function, please examine its source code for errors. Please consult the External Interfaces Guide for information on debugging MEX-files. This crash report has been saved to disk as /Users/ginevramoore/matlab_crash_dump.1181-1

Caught MathWorks::System::FatalException [Please exit and restart MATLAB]>>

ginevmoore commented 3 years ago

It seemed to be an issue with how I installed TopoToolbox. The issue had something to do with how I was forking the topotoolbox repository from the up-to-date version of the code on github. After downloading the 2019 2.3 release of TopoToolbox from the blog and using the installer that Dr. Schwanghart provides everything works again, and the MakeStreams command also works with TAK.

Sorry for the trouble - and thanks for your help! Ginevra