fletcher / MultiMarkdown-5

Reference implementation of MultiMarkdown; replaces MultiMarkdown v4 (deprecated -- see MMD-6 instead)
https://github.com/fletcher/MultiMarkdown-6
Other
293 stars 46 forks source link

Building with debug symbols #32

Closed mmcco closed 8 years ago

mmcco commented 8 years ago

Is there an easy way to build with debug symbols? CFLAGS='-g' does in fact add -g to the cc commands, but the resulting binary doesn't have debug symbols. Maybe I'm missing something obvious, but I couldn't find anything in the docs.

I'm asking because I found a couple crashing inputs using afl and want to investigate.

Thanks, Mike

fletcher commented 8 years ago

I honestly don't know. Whenever I'm doing debugging, I run in Xcode so that takes care of it for me. Are you using make debug? When I've used that on *.nix with valgrind, it seems to include symbol information in the output.

fletcher commented 8 years ago

Either way, please send me what you find. I've never used afl, but if it's finding input that crashes or hangs MMD, that sounds fantastic! Would love to see the test cases it discovers so I can fix them! (Unless you beat me to it, which is even better!)

mmcco commented 8 years ago

Here are the current unique crashing inputs:

https://www.sccs.swarthmore.edu/users/16/mmcconv1/dump/id:000000,sig:06,src:000003,op:flip2,pos:2849

https://www.sccs.swarthmore.edu/users/16/mmcconv1/dump/id:000001,sig:06,src:000003,op:int8,pos:2844,val:+64

Let me know if they don't crash for you. I'm on OpenBSD, which has a bunch of memory sanitization features enabled by default. Because of this, undefined behavior related to memory access sometimes crashes on OpenBSD but not Linux, OS X, et al.

fletcher commented 8 years ago

I don't have time to test these in other OS's right now, but they did not crash in 5.4.0 on Mac OS.

mmcco commented 8 years ago

I just realized that I was fuzzing MultiMarkdown 5.2.0. I think these bugs may have been fixed in 5.4.0, because I can't get them to crash on OpenBSD either. I'll try fuzzing the latest version.

Thanks for your time, Mike

fletcher commented 8 years ago

Well, if you find others, definitely let me know. I love fixing bugs (when I can find a fix!)

BTW -- did you get the symbolicated build working?

mmcco commented 8 years ago

I haven't had time to work on it recently. I may soon, though.

fletcher commented 8 years ago

I am not an expert, but everything I can test on Ubuntu linux suggests that the MMD binary is not stripped in either the release or debug form. You have to run the strip command after the fact, or modify the CMakeLists.txt file to perform stripping.

If you can verify this is incorrect, then I can readdress. For now will close this.