There is a nasty segfault in my code that keeps pestering me. The error is probably buried deeply in my beastly sized code so I won't post it and ask you to deal with it, but I just want to know when this simple code...
...can result in a segmentation fault so I can track down the error better.
int* value_ptr = (int*) malloc (sizeof (int));
My idea would be never, but still it does.
(Oh, and yes apart from 'return 0' in main, this is the last line of my code.)
Any help would be appreciated.
Output of gdb:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b011e6 in _int_malloc () from /lib/libc.so.6