Fuehrt man den Code von http://www.spin.de/hp/btwotch/blog/id/11399380 via valgrind aus, so stoppt das Programm abrupt durch einen Segfault; ausserdem sind folgende valgrind Meldungen zu sehen:
valgrind ./a.out
==17903== Memcheck, a memory error detector
==17903== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==17903== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==17903== Command: ./a.out
17903
==17903== Jump to the invalid address stated on the next line
==17903== at 0xFFFFFFFFFF600400: ???
==17903== by 0x5108E5C: time (in /lib/libc-2.12.so)
==17903== by 0x4E5ED5A: Curl_srand (in /usr/lib/libcurl.so.4.2.0)
==17903== by 0x4E58C2F: curl_global_init (in /usr/lib/libcurl.so.4.2.0)
==17903== by 0x400A43: main (in /home/btwotch/tmp/tmp/multi/a.out)
==17903== Address 0xffffffffff600400 is not stack'd, malloc'd or (recently) free'd
17903
17903
==17903== Process terminating with default action of signal 11 (SIGSEGV)
==17903== Bad permissions for mapped region at address 0xFFFFFFFFFF600400
==17903== at 0xFFFFFFFFFF600400: ???
==17903== by 0x5108E5C: time (in /lib/libc-2.12.so)
==17903== by 0x4E5ED5A: Curl_srand (in /usr/lib/libcurl.so.4.2.0)
==17903== by 0x4E58C2F: curl_global_init (in /usr/lib/libcurl.so.4.2.0)
==17903== by 0x400A43: main (in /home/btwotch/tmp/tmp/multi/a.out)
17903
==17903== HEAP SUMMARY:
==17903== in use at exit: 89,448 bytes in 2,935 blocks
==17903== total heap usage: 2,993 allocs, 58 frees, 108,752 bytes allocated
17903
==17903== LEAK SUMMARY:
==17903== definitely lost: 0 bytes in 0 blocks
==17903== indirectly lost: 0 bytes in 0 blocks
==17903== possibly lost: 0 bytes in 0 blocks
==17903== still reachable: 89,448 bytes in 2,935 blocks
==17903== suppressed: 0 bytes in 0 blocks
==17903== Rerun with –leak-check=full to see details of leaked memory
17903
==17903== For counts of detected and suppressed errors, rerun with: -v
==17903== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 7 from 7)
Segmentation fault
Update 1
Scheint wohl ein Bug von valgrind zu sein, denn ein "curl –libcurl test.c http://www.google.de" stuerzt auch ab.
Update 2
Vielleicht liegt es am gcc 4.5.0 die x.y.0 Reihe soll wohl immer etwas buggy sein, habe ich mal gehoert.
Update 3
Heute lieferte mir Arch ein neues valgrind :)