Closed rslabbert closed 11 years ago
Shit, that's bad. -O2 are still safe optimalisations right? So we're probably relying on some bad code that somehow doesn't crash under -O1
Well screw that. I just don't know anymore. I run it, it fails. And then all I do is say echo $CFLAGS
and then I put what that says into export CFLAGS="..."
and it works. So yeah, that is horribly strange to say the least.
This is valgrind's opinion
==6804== Process terminating with default action of signal 11 (SIGSEGV) ==6804== Access not within mapped region at address 0xFFFFFFFF9B213F33 ==6804== at 0x4C2DB90: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6804== by 0x401F0A: redditGetSubreddit (reddit.c:85) ==6804== by 0x401207: showSubreddit (main.c:34) ==6804== by 0x40189F: main (main.c:137)
Ok I'm closing this since it just plain works now. I have no idea what was wrong. So that's weird to say the least.
The latest commit which adds
curl-config --cflags
to the build options breaks loading subreddits with less than 25 entries(/r/codetogether) for me, but it's fixed if I take it out.My CFLAGS are probably the cause:
CFLAGS='-march=native -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4'
I'll try again without them.
EDIT: It seems to be the -O2 option, when I use -O1 instead it works.