Skip to content
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

DHT_bootstrap asserts due to no default logger #879

Closed
anthonybilinski opened this issue Apr 20, 2018 · 3 comments
Closed

DHT_bootstrap asserts due to no default logger #879

anthonybilinski opened this issue Apr 20, 2018 · 3 comments
Assignees
Labels
bug Bug fix for the user, not a fix to a build script P0 Critical priority
Milestone

Comments

@anthonybilinski
Copy link

(gdb) r
Starting program: /home/abilinski/build/toktok-toxcore/build/DHT_bootstrap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Initialization: Success
Keys loaded successfully.
Public key: 0E9D7FEE2AA4B42A4C18FE81C038E32FFD8D907AAA7896F05AA76C8D31A20065
Port: 33445
Connected to other bootstrap node successfully.
DHT_bootstrap: toktok-toxcore/toxcore/logger.c:106: logger_write: Assertion `!"NULL logger not permitted"' failed.
 
Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7399f5d in __GI_abort () at abort.c:90
#2  0x00007ffff738ff17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55555556c9de "!\"NULL logger not permitted\"",
    file=file@entry=0x55555556c9a8 "/home/abilinski/build/toktok-toxcore/toxcore/logger.c", line=line@entry=106,
    function=function@entry=0x55555556ca00 <__PRETTY_FUNCTION__.2229> "logger_write") at assert.c:92
#3  0x00007ffff738ffc2 in __GI___assert_fail (assertion=0x55555556c9de "!\"NULL logger not permitted\"",
    file=0x55555556c9a8 "/home/abilinski/build/toktok-toxcore/toxcore/logger.c", line=106,
    function=0x55555556ca00 <__PRETTY_FUNCTION__.2229> "logger_write") at assert.c:101
#4  0x000055555556c090 in logger_write ()
#5  0x0000555555559942 in networking_poll ()
#6  0x0000555555558d1c in main ()

Previous behaviour was to use stderr logged if no logger was set. No if no logger is set, assert is hit on debug builds and logger segfaults on release builds.

Introduced by 9706d9a

@anthonybilinski
Copy link
Author

Clients should not be effected by this because new_messenger and new_onions create loggers by default, even if no logger callbacks are set. The problem with DHT_bootstrap is that it explicitly passes in a null logger: new_networking(nullptr, ip, PORT)

@nurupo
Copy link
Member

nurupo commented Apr 20, 2018

Can confirm, clients are not affected, but DHT_bootstrap and tox-bootstrapd are. Sending any unknown packet kind to bootstrap nodes crashes them immediately.

@nurupo nurupo added bug Bug fix for the user, not a fix to a build script P0 Critical priority labels Apr 20, 2018
@nurupo
Copy link
Member

nurupo commented May 20, 2018

Fixed by #892.

@nurupo nurupo closed this as completed May 20, 2018
@robinlinden robinlinden modified the milestone: v0.2.11 Mar 20, 2020
@iphydf iphydf added P3 Low priority and removed P3 Low priority labels Feb 4, 2022
@iphydf iphydf added this to the v0.2.3 milestone Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix for the user, not a fix to a build script P0 Critical priority
Development

No branches or pull requests

4 participants