Bug 2 - link_state fini SEGV when link_state_init failed
Summary: link_state fini SEGV when link_state_init failed
Alias: None
Product: Ouroboros
Classification: Unclassified
Component: ipcpd-unicast (show other bugs)
Version: 0.16
Hardware: PC Linux
: --- normal
Assignee: Dimitri Staessens
Depends on:
Reported: 2020-02-16 12:33 CET by Dimitri Staessens
Modified: 2020-02-16 12:41 CET (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Staessens 2020-02-16 12:33:53 CET
Should be easy to fix

[dstaesse@heteropoda build]$ sudo irmd --stdout
==05794== irmd(II): Ouroboros IPC Resource Manager daemon started...
==05794== irmd(II): Created IPCP 5867.
==05867== ipcpd-local(II): Bootstrapped local IPCP with pid 5867.
==05867== ipcpd/ipcp(DB): Locked thread 140062535595776 to CPU 7/8.
==05794== irmd(II): Bootstrapped IPCP 5867 in layer e02.
==05794== irmd(II): Created IPCP 5888.
==05888== ipcpd-local(II): Bootstrapped local IPCP with pid 5888.
==05794== irmd(II): Bootstrapped IPCP 5888 in layer e01.
==05888== ipcpd/ipcp(DB): Locked thread 139748512249600 to CPU 7/8.
==05794== irmd(II): Created IPCP 5902.
==05794== irmd(II): Bound process 5902 to name n01.a.
==05794== irmd(II): Bound process 5902 to name n01.
==05902== unicast-ipcp(DB): IPCP got address 1296627616.
==05902== dt(EE): Failed to create a PFF.
==5902==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000002d0 (pc 0x7f7063c7a614 bp 0x7f705d5e4b90 sp 0x7f705d5e4b68 T4)
==5902==The signal is caused by a READ memory access.
==5902==Hint: address points to the zero page.
    #0 0x7f7063c7a613 in pthread_cancel (/usr/lib/libpthread.so.0+0x11613)
    #1 0x5564731ef666 in link_state_fini /home/dstaesse/git/ouroboros/src/ipcpd/unicast/pol/link_state.c:1014
    #2 0x5564731e72ec in routing_fini /home/dstaesse/git/ouroboros/src/ipcpd/unicast/routing.c:72
    #3 0x5564731db65a in dt_init /home/dstaesse/git/ouroboros/src/ipcpd/unicast/dt.c:729
    #4 0x5564731e4d3a in initialize_components /home/dstaesse/git/ouroboros/src/ipcpd/unicast/main.c:84
    #5 0x5564731e5db1 in unicast_ipcp_bootstrap /home/dstaesse/git/ouroboros/src/ipcpd/unicast/main.c:249
    #6 0x5564731f9000 in mainloop /home/dstaesse/git/ouroboros/src/ipcpd/ipcp.c:297
    #7 0x7f7063c7246e in start_thread (/usr/lib/libpthread.so.0+0x946e)
    #8 0x7f70636d73d2 in clone (/usr/lib/libc.so.6+0xff3d2)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/libpthread.so.0+0x11613) in pthread_cancel
Thread T4 created by T2 here:
    #0 0x7f7063e30377 in __interceptor_pthread_create /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:208
    #1 0x7f7063cbb405 in tpmgr /home/dstaesse/git/ouroboros/src/lib/tpm.c:140
    #2 0x7f7063c7246e in start_thread (/usr/lib/libpthread.so.0+0x946e)

Thread T2 created by T0 here:
    #0 0x7f7063e30377 in __interceptor_pthread_create /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:208
    #1 0x7f7063cbb995 in tpm_start /home/dstaesse/git/ouroboros/src/lib/tpm.c:215
    #2 0x5564731fd3c8 in ipcp_boot /home/dstaesse/git/ouroboros/src/ipcpd/ipcp.c:697
    #3 0x5564731e6684 in main /home/dstaesse/git/ouroboros/src/ipcpd/unicast/main.c:331
    #4 0x7f70635ff022 in __libc_start_main (/usr/lib/libc.so.6+0x27022)

==05794== irmd(EE): Could not bootstrap IPCP.
==05794== irmd(II): All names matching n01.a unbound for 5902.
==05794== irmd(II): All names matching n01 unbound for 5902.
==05794== irmd(II): IRMd shutting down...
==05867== ipcpd/ipcp(II): IPCP 5867 shutting down.
==05867== ipcpd/ipcp(II): IPCP 5867 out.
==05888== ipcpd/ipcp(II): IPCP 5888 shutting down.
==05888== ipcpd/ipcp(II): IPCP 5888 out.
==05794== irmd(DB): Failed to remove /tmp/ouroboros
==05794== irmd(II): Bye.