Cotix / cReddit

CLI Reddit client written in C. Oh, crossplatform too!
Other
96 stars 14 forks source link

Commit 1e0fa96778 plus CFLAGS breaks smaller subreddits #11

Closed rslabbert closed 11 years ago

rslabbert commented 11 years ago

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.

Cotix commented 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

rslabbert commented 11 years ago

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.

rslabbert commented 11 years ago

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)

rslabbert commented 11 years ago

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.