EarthScope / dataselect

Selection and sorting for data in miniSEED format
GNU General Public License v3.0
14 stars 7 forks source link

Error running dataselect on MacOS Monterey and greater #11

Closed MaevaP closed 1 year ago

MaevaP commented 1 year ago

Hi Chad,

A few of us at PASSCAL have been trying to run dataselect on our local machine.

We run into the following error:

(test_dataselect) maevapourpoint@Maevas-MBP Downloads % dataselect -A days/%s.%n.%l.%c.%Y.%j 6445_ELHT.sdr/DT0001__.VCO
dataselect(5115,0x10f0b7600) malloc: *** error for object 0x600000fc14a0: pointer being freed was not allocated
dataselect(5115,0x10f0b7600) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      dataselect -A days/%s.%n.%l.%c.%Y.%j 6445_ELHT.sdr/DT0001__.VCO

This error only arises when running dataselect on a MacOS (version 12+) machine.

From looking a bit more into the error, it looks like Monterey came with an updated version of gcc and g++ which is not compatible with the version of some of dataselect third-party libraries.

Would you be able to address this issue?

Thank you for your help and time.

Best, Maeva Pourpoint

chad-earthscope commented 1 year ago

Hi @MaevaP,

I was not able to duplicate the failure with the latest version of the program (3.23) on macOS 13.2. If you do not have the latest version, please download the source code from: https://github.com/EarthScope/dataselect/releases and compile it.

If you you still get the problem with the latest version please email me the input data.

chad-earthscope commented 1 year ago

Thanks @MaevaP for reporting this error and providing test data. The fix is in the latest release: https://github.com/EarthScope/dataselect/releases/tag/v3.24

chad-earthscope commented 1 year ago

This error was particularly subtle and resulted in heap corruption, which is known to cause C coders agita given how difficult is can be to find the source of the corruption. Luckily modern compilers have useful tooling to help get clues of where to look, in this case these build options were enormously helpful:

CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
MaevaP commented 1 year ago

Thank you @chad-earthscope for addressing the issue quickly and for walking me through the error. I appreciate it.