lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.94k stars 548 forks source link

Conditional jump or move depends on uninitialised value(s) #127

Closed matt-42 closed 8 years ago

matt-42 commented 8 years ago

Did you try to run lwan with valgrind? Here are some of the errors I get:

` ==23875== Thread 4: ==23875== Conditional jump or move depends on uninitialised value(s) ==23875== at 0x4C2B540: rindex (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==23875== by 0x5021B8: read_request_finalizer (lwan-request.c:806) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145) ==23875== ==23875== Conditional jump or move depends on uninitialised value(s) ==23875== at 0x5021C2: read_request_finalizer (lwan-request.c:807) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145) ==23875== ==23875== Conditional jump or move depends on uninitialised value(s) ==23875== at 0x5021DB: read_request_finalizer (lwan-request.c:808) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145) ==23875== ==23875== Conditional jump or move depends on uninitialised value(s) ==23875== at 0x4C2E97E: memcmp_sse4_1 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==23875== by 0x50222D: read_request_finalizer (lwan-request.c:808) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145) ==23875== ==23875== Use of uninitialised value of size 8 ==23875== at 0x4C2E9C5: __memcmp_sse4_1 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==23875== by 0x50222D: read_request_finalizer (lwan-request.c:808) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145) ==23875== ==23875== Use of uninitialised value of size 8 ==23875== at 0x4C2E9E0: memcmp_sse4_1 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==23875== by 0x50222D: read_request_finalizer (lwan-request.c:808) ==23875== by 0x5015F1: read_from_request_socket (lwan-request.c:763) ==23875== by 0x4FC0C3: read_request (lwan-request.c:819) ==23875== by 0x4FC0C3: lwan_process_request (lwan-request.c:1000) ==23875== by 0x540417: process_request_coro (lwan-thread.c:183) ==23875== by 0x4F49FC: coro_entry_point (lwan-coro.c:145)

`

lpereira commented 8 years ago

I do run it under Valgrind and run with address sanitizer, and I can't reproduce this bug here. What request are you performing? Is it a POST request? Could you please share more details?

lpereira commented 8 years ago

I've managed to reproduce this here. It was trivial to fix. Thanks for reporting!