byronknoll / cmix

cmix is a lossless data compression program aimed at optimizing compression ratio at the cost of high CPU/memory usage.
http://www.byronknoll.com/cmix.html
GNU General Public License v3.0
613 stars 45 forks source link

'CC = clang++' fails to compile, seg fault with g++ #43

Closed 2ahunter closed 5 years ago

2ahunter commented 5 years ago

With the latest makefile, I changed CC = clang-3.8 and it fails to compile.
It compiles fine with CC=g++, as suggested in the README, however I get segmentation faults when I test cmix:

aaron@aaron-HP-EliteBook-840-G1:~/cmpe202/cmix$ ./cmix -n README readme_cmp Segmentation fault (core dumped)

Any ideas?

byronknoll commented 5 years ago

Hi, cmix should work with recent versions of both g++ and clang. What version of g++ are you using? Here are some ideas:

2ahunter commented 5 years ago

Thanks--I have g++ 5.4, I think it's the installed version with Ubuntu 16. clang-3.8. I'll try the '-O3' option first, then update the compilers.

2ahunter commented 5 years ago

upgraded to g++ -7 and compiled with both original makefile and with -O3. both show a segmentation fault. I'll try with clang next.

2ahunter commented 5 years ago

Nope, still get segmentation fault.

byronknoll commented 5 years ago

Hmm this might be difficult to debug. How much RAM does your computer have? Which OS are you using? If you run cmix without any arguments does it also segfault? When I see a segfault on my own computer I usually use gdb to debug, but that will be difficult if you don't already know how to use gdb.

tommythorn commented 5 years ago

Well, it would be fairly useful to simply prefix the invocation with gdb --args, typing run at the (gdb) prompt, and upon the segfault run bt which will give a backtrace.

byronknoll commented 5 years ago

I am closing this issue since it hasn't been updated. Feel free to re-open if there are new updates.