nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.82k stars 307 forks source link

SEGV on server start #103

Closed NerdGGuy closed 10 years ago

NerdGGuy commented 10 years ago

I tried an older version but still get errors. Any ideas? I'm on ubuntu 13.10.

➜ webdis git:(master) gdb ./webdis (master⚡) GNU gdb (GDB) 7.6.1-ubuntu Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/gguy/Source/webdis/webdis...done. (gdb) run Starting program: /home/gguy/Source/webdis/./webdis [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff75b0700 (LWP 15598)] [New Thread 0x7ffff6daf700 (LWP 15599)] [New Thread 0x7ffff65ae700 (LWP 15600)] [New Thread 0x7ffff5dad700 (LWP 15601)] [New Thread 0x7ffff55ac700 (LWP 15602)]

Program received signal SIGBUS, Bus error. __GI___libc_realloc (oldmem=0x2e302e302e373231, bytes=784) at malloc.c:2934 2934 malloc.c: No such file or directory. (gdb) bt

0 __GI___libc_realloc (oldmem=0x2e302e302e373231, bytes=784) at malloc.c:2934

1 0x00007ffff7bb2541 in ?? () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5

2 0x00007ffff7bb2784 in evmap_io_add () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5

3 0x00007ffff7ba364f in event_add () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5

4 0x0000000000404123 in server_start (s=0x626010) at server.c:233

5 0x0000000000402055 in main (argc=1, argv=0x7fffffffe578) at webdis.c:16

(gdb) quit A debugging session is active.

Inferior 1 [process 15594] will be killed.

Quit anyway? (y or n) y ➜ webdis git:(master) valgrind ./webdis (master⚡) ==15611== Memcheck, a memory error detector ==15611== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==15611== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==15611== Command: ./webdis ==15611== ==15611== Invalid read of size 8 ==15611== at 0x4E411B1: event_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x404122: server_start (server.c:233) ==15611== by 0x402054: main (webdis.c:16) ==15611== Address 0x565d200 is 22 bytes after a block of size 10 free'd ==15611== at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==15611== by 0x409D63: conf_read (conf.c:54) ==15611== by 0x403C51: server_new (server.c:87) ==15611== by 0x402044: main (webdis.c:13) ==15611== ==15611== Invalid read of size 8 ==15611== at 0x4E41293: event_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x404122: server_start (server.c:233) ==15611== by 0x402054: main (webdis.c:16) ==15611== Address 0x565d208 is not stack'd, malloc'd or (recently) free'd ==15611== ==15611== Invalid read of size 8 ==15611== at 0x4E50668: evmap_io_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x4E4164E: event_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x404122: server_start (server.c:233) ==15611== by 0x402054: main (webdis.c:16) ==15611== Address 0x3e800000490 is not stack'd, malloc'd or (recently) free'd ==15611== ==15611== ==15611== Process terminating with default action of signal 11 (SIGSEGV) ==15611== Access not within mapped region at address 0x3E800000490 ==15611== at 0x4E50668: evmap_io_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x4E4164E: event_add (in /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9) ==15611== by 0x404122: server_start (server.c:233) ==15611== by 0x402054: main (webdis.c:16) ==15611== If you believe this happened as a result of a stack ==15611== overflow in your program's main thread (unlikely but ==15611== possible), you can try to increase the size of the ==15611== main thread stack using the --main-stacksize= flag. ==15611== The main thread stack size used in this run was 8388608. ==15611== ==15611== HEAP SUMMARY: ==15611== in use at exit: 6,255 bytes in 48 blocks ==15611== total heap usage: 140 allocs, 92 frees, 9,571 bytes allocated ==15611== ==15611== LEAK SUMMARY: ==15611== definitely lost: 640 bytes in 1 blocks ==15611== indirectly lost: 416 bytes in 3 blocks ==15611== possibly lost: 1,378 bytes in 7 blocks ==15611== still reachable: 3,821 bytes in 37 blocks ==15611== suppressed: 0 bytes in 0 blocks ==15611== Rerun with --leak-check=full to see details of leaked memory ==15611== ==15611== For counts of detected and suppressed errors, rerun with: -v ==15611== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 2 from 2) [1] 15611 killed valgrind ./webdis

NerdGGuy commented 10 years ago

My bad, was using wrong libevent headers. Fixed now.