tst2005googlecode / umurmur

Automatically exported from code.google.com/p/umurmur
1 stars 0 forks source link

Segmentation violation using OpenSSL #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What I did:

1. Download and compile on CentOS4 (manually installing libconfig 1.4.5 into 
/usr/local)
2. Start the daemon and watch it segfault
3. Start the daemon in valgrind to see where it wanders off into the weeds

The output from valgrind:

$ LD_LIBRARY_PATH=/usr/local/lib valgrind ./umurmurd  -d -c umurmur.conf
==21120== Memcheck, a memory error detector.
==21120== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==21120== Using LibVEX rev 1575, a library for dynamic binary translation.
==21120== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==21120== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==21120== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==21120== For more details, rerun with: -v
==21120== 
==21120== Conditional jump or move depends on uninitialised value(s)
==21120==    at 0x804F91A: SSLi_init (in /home/jamesc/umurmur-0.2.4/umurmurd)
==21120==    by 0x804C91E: main (in /home/jamesc/umurmur-0.2.4/umurmurd)
==21120== 
==21120== Conditional jump or move depends on uninitialised value(s)
==21120==    at 0x804F96F: SSLi_init (in /home/jamesc/umurmur-0.2.4/umurmurd)
==21120==    by 0x804C91E: main (in /home/jamesc/umurmur-0.2.4/umurmurd)
INFO: OpenSSL library initialized
INFO: Setting default channel Lobby
INFO: Adding channel 'Lobby' parent 'Root'
INFO: Adding channel 'Red team' parent 'Lobby'
INFO: Adding channel 'Blue team' parent 'Lobby'
INFO: Adding channel link 'Lobby' -> 'Red team'
INFO: Adding channel link 'Lobby' -> 'Blue team'
FATAL: Server: Failed to set TOS for UDP Socket
==21120== 
==21120== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 23 from 1)
==21120== malloc/free: in use at exit: 35,445 bytes in 2,096 blocks.
==21120== malloc/free: 2,258 allocs, 162 frees, 77,733 bytes allocated.
==21120== For counts of detected errors, rerun with: -v
==21120== searching for pointers to 2,096 not-freed blocks.
==21120== checked 233,096 bytes.
==21120== 
==21120== LEAK SUMMARY:
==21120==    definitely lost: 0 bytes in 0 blocks.
==21120==      possibly lost: 152 bytes in 2 blocks.
==21120==    still reachable: 35,293 bytes in 2,094 blocks.
==21120==         suppressed: 0 bytes in 0 blocks.
==21120== Reachable blocks (those to which a pointer was found) are not shown.
==21120== To see them, rerun with: --show-reachable=yes

Original issue reported on code.google.com by bonkabonka on 19 Oct 2010 at 5:48

GoogleCodeExporter commented 9 years ago
This is not a segfault as far as I can see. This line in your output says it 
all:

FATAL: Server: Failed to set TOS for UDP Socket

Your kernel (or libc?) doesn't handle setting the Type of Service flag on the 
socket. I plan to make this fail silently in next release since there seem to 
be a couple of systems that don't handle this.

Original comment by fatbob.s...@gmail.com on 29 Oct 2010 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by fatbob.s...@gmail.com on 30 Oct 2010 at 7:58

GoogleCodeExporter commented 9 years ago
Well, without valgrind running, umurmur segfaults for me.  I thought that's 
what the two conditional jump depends on uninitialized value errors might be.  
Happily, I was able to work around the issue by using PolarSSL.

Original comment by bonkabonka on 31 Oct 2010 at 3:50

GoogleCodeExporter commented 9 years ago
OpenSSL does a lot of uninitialized reads when run in Valgrind. The developers 
says it's intentional for randomness purposes if I understand correctly. You 
can google it. 
The reason for your segfault could be OpenSSL version(?) I will close this 
issue for now since your problem is solved.

Original comment by fatbob.s...@gmail.com on 2 Nov 2010 at 9:10