-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write architecture document #3
Labels
docs
Improvements or additions to documentation
Comments
rjarry
added a commit
to rjarry/grout
that referenced
this issue
Dec 6, 2024
The docstring of event_base_foreach_event() states explicitly that modifying events in the callback function is unsafe and will cause crashes. event_free_finalize tries to acquire a lock that is already held when the callback is called. Leading to a deadlock: (gdb) bt ... DPDK#3 ___pthread_mutex_lock (mutex=0x504000001550) at pthread_mutex_lock.c:93 DPDK#4 0x00007f3f211b8485 in event_finalize_impl_ (flags=65536, ev=0x50c000005200, cb=0x4031ba <finalize_fd>) DPDK#5 0x00000000004042ed in close_connections (ev=0x50c000005200) at main/api.c:174 ... DPDK#10 0x00007f3f211b263a in event_base_foreach_event (base=0x517000006d00, fn=0x40429f <close_connections>, arg=0x0) DPDK#11 0x0000000000404a3a in api_socket_stop () at main/api.c:253 DPDK#12 0x00000000004072aa in main (argc=4, argv=0x7ffcc575d898) at main/main.c:210 Only use event_base_foreach_event() for iterating over the events that we actually want to free (namely, ones that have read_cb and write_cb as callbacks). Only *after* returning from event_base_foreach_event(), call event_free_finalize on all these events. Fixes: 8653320 ("main: close active connections on shutdown") Signed-off-by: Robin Jarry <[email protected]>
rjarry
added a commit
to rjarry/grout
that referenced
this issue
Dec 6, 2024
The docstring of event_base_foreach_event() states explicitly that modifying events in the callback function is unsafe and will cause crashes. event_free_finalize tries to acquire a lock that is already held when the callback is called. Leading to a deadlock: (gdb) bt ... DPDK#3 ___pthread_mutex_lock (mutex=0x504000001550) at pthread_mutex_lock.c:93 DPDK#4 0x00007f3f211b8485 in event_finalize_impl_ (flags=65536, ev=0x50c000005200, cb=0x4031ba <finalize_fd>) DPDK#5 0x00000000004042ed in close_connections (ev=0x50c000005200) at main/api.c:174 ... DPDK#10 0x00007f3f211b263a in event_base_foreach_event (base=0x517000006d00, fn=0x40429f <close_connections>, arg=0x0) DPDK#11 0x0000000000404a3a in api_socket_stop () at main/api.c:253 DPDK#12 0x00000000004072aa in main (argc=4, argv=0x7ffcc575d898) at main/main.c:210 Only use event_base_foreach_event() for iterating over the events that we actually want to free (namely, ones that have read_cb and write_cb as callbacks). Only *after* returning from event_base_foreach_event(), call event_free_finalize on all these events. Fixes: 8653320 ("main: close active connections on shutdown") Signed-off-by: Robin Jarry <[email protected]>
rjarry
added a commit
that referenced
this issue
Dec 6, 2024
The docstring of event_base_foreach_event() states explicitly that modifying events in the callback function is unsafe and will cause crashes. event_free_finalize tries to acquire a lock that is already held when the callback is called. Leading to a deadlock: (gdb) bt ... #3 ___pthread_mutex_lock (mutex=0x504000001550) at pthread_mutex_lock.c:93 #4 0x00007f3f211b8485 in event_finalize_impl_ (flags=65536, ev=0x50c000005200, cb=0x4031ba <finalize_fd>) #5 0x00000000004042ed in close_connections (ev=0x50c000005200) at main/api.c:174 ... #10 0x00007f3f211b263a in event_base_foreach_event (base=0x517000006d00, fn=0x40429f <close_connections>, arg=0x0) #11 0x0000000000404a3a in api_socket_stop () at main/api.c:253 #12 0x00000000004072aa in main (argc=4, argv=0x7ffcc575d898) at main/main.c:210 Only use event_base_foreach_event() for iterating over the events that we actually want to free (namely, ones that have read_cb and write_cb as callbacks). Only *after* returning from event_base_foreach_event(), call event_free_finalize on all these events. Fixes: 8653320 ("main: close active connections on shutdown") Signed-off-by: Robin Jarry <[email protected]>
rjarry
added a commit
to rjarry/grout
that referenced
this issue
Feb 20, 2025
grout# show ip6 router-advert error: command failed: Bad message grout# ^D ==174902==ERROR: LeakSanitizer: detected memory leaks Direct leak of 328 byte(s) in 1 object(s) allocated from: #0 0x7fe0ca6c2250 in calloc (/lib64/libasan.so.8+0xc2250) DPDK#1 0x7fe0cadef910 in scols_new_table (/lib64/libsmartcols.so.1+0x6910) DPDK#2 0x417d0f in ra_show ../modules/ip6/cli/router_advert.c:19 DPDK#3 0x41e836 in exec_strvec ../cli/exec.c:72 DPDK#4 0x41e982 in exec_line ../cli/exec.c:106 DPDK#5 0x41f412 in interact ../cli/interact.c:119 DPDK#6 0x4216db in main ../cli/main.c:167 ... DPDK#9 0x4017f4 in _start (/root/grout/build/grcli+0x4017f4) Only allocate the table if the GR_IP6_IFACE_RA_SHOW api call is successful. Fixes: 8ed8b9d ("ip6: router advertisement configuration") Signed-off-by: Robin Jarry <[email protected]>
rjarry
added a commit
that referenced
this issue
Feb 24, 2025
grout# show ip6 router-advert error: command failed: Bad message grout# ^D ==174902==ERROR: LeakSanitizer: detected memory leaks Direct leak of 328 byte(s) in 1 object(s) allocated from: #0 0x7fe0ca6c2250 in calloc (/lib64/libasan.so.8+0xc2250) #1 0x7fe0cadef910 in scols_new_table (/lib64/libsmartcols.so.1+0x6910) #2 0x417d0f in ra_show ../modules/ip6/cli/router_advert.c:19 #3 0x41e836 in exec_strvec ../cli/exec.c:72 #4 0x41e982 in exec_line ../cli/exec.c:106 #5 0x41f412 in interact ../cli/interact.c:119 #6 0x4216db in main ../cli/main.c:167 ... #9 0x4017f4 in _start (/root/grout/build/grcli+0x4017f4) Only allocate the table if the GR_IP6_IFACE_RA_SHOW api call is successful. Fixes: 8ed8b9d ("ip6: router advertisement configuration") Signed-off-by: Robin Jarry <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: