You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
gcc's -fsanitize=address finds memory safety bugs, normally caused by running older C code on modern compilers. The first bug it finds in charybdis is:
$ make -j 8 CC='gcc -Og -g -fsanitize=address'
...
$ ircd/charybdis -foreground
=================================================================
==19319==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f53f7ae05a0 at pc 0x7f53f781802a bp 0x7ffe71fbae60 sp 0x7ffe71fbae50
WRITE of size 4 at 0x7f53f7ae05a0 thread T0
#0 0x7f53f7818029 in parseargs /home/faux/code/charybdis/ircd/getopt.c:67
#1 0x7f53f781ec24 in charybdis_main /home/faux/code/charybdis/ircd/ircd.c:659
#2 0x55e8779bc982 in main /home/faux/code/charybdis/ircd/main.c:8
#3 0x7f53f73f01c0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x211c0)
#4 0x55e8779bc899 in _start (/home/faux/code/charybdis/ircd/.libs/charybdis+0x899)
0x7f53f7ae05a1 is located 0 bytes to the right of global variable 'server_state_foreground' defined in 'ircd.c:104:6' (0x7f53f7ae05a0) of size 1
..which is the getopt code type-punning a bool into an int:
gcc
's-fsanitize=address
finds memory safety bugs, normally caused by running older C code on modern compilers. The first bug it finds in charybdis is:..which is the getopt code type-punning a
bool
into anint
:charybdis/ircd/getopt.c
Line 67 in c20a431
Please fix it, and have a play with
charybdis
built in this mode, to try and improve the developer experience.You need a reasonably recent gcc, I'm testing 7.3, but I'm pretty sure 6 will catch it.
(I was looking at this as
charybdis
just segfaults on start for me, which I'm still investigating, and pretty angry about.)The text was updated successfully, but these errors were encountered: