The code crashes early in the setup() processing. If I were to guess I would say somethings up with either the compiler or cleanup or running out of stack.
I'm learning how to use the SD library. To that end I wrote a test case for much of the library functions. When getting to near the end of learning the code broke. It worked up to adding the last file.write() testing.
If one comments out line 414 "binaryLongWrite();" all the code works, see above code. After trying all sorts of changes and assuming it was my code I tested line 414 function call it a different environment, see code below. This works as expected.
C:\Users\dana_\Desktop\Arduino MySketch Library\SDCardIntroduction\testErrorCase\testErrorCase.ino: In function 'void setup()':
C:\Users\dana_\Desktop\Arduino MySketch Library\SDCardIntroduction\testErrorCase\testErrorCase.ino:299:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i<fileRdTxt.size(); i++) {
~^~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\SD\src\SD.cpp: In function 'open.constprop':
C:\Program Files (x86)\Arduino\libraries\SD\src\SD.cpp:462:14: warning: 'pathidx' may be used uninitialized in this function [-Wmaybe-uninitialized]
filepath += pathidx;
^
C:\Program Files (x86)\Arduino\libraries\SD\src\SD.cpp:456:9: note: 'pathidx' was declared here
int pathidx;
^
It is always best to create the minimal test program that recreates the issue. With the SD libraries, a big chunk of RAM memory is already allocated to the SD card buffer, so memory issues become more likely.
Rather than add to a long, existing test program, write code to test just the features that you will be using. Or, eliminate the existing tests that are irrelevant.