Discussion:
Bug#1012843: i2pd: Default install SEGV
(too old to reply)
Erik de Castro Lopo
2022-06-15 11:40:01 UTC
Permalink
Package: i2pd
Version: 2.41.0-1+b1
Severity: important

Dear Maintainer,

* Installed i2pd.
* `systemctl status i2pd` reports:
× i2pd.service - I2P Router written in C++
Loaded: loaded (/lib/systemd/system/i2pd.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2022-06-15 21:25:17 AEST; 1min 51s ago
Docs: man:i2pd(1)
https://i2pd.readthedocs.io/en/latest/
Process: 23181 ExecStart=/usr/sbin/i2pd $DAEMON_OPTS (code=killed, signal=SEGV)
CPU: 72ms

Jun 15 21:25:14 ada systemd[1]: Starting I2P Router written in C++...
Jun 15 21:25:14 ada systemd[1]: i2pd.service: Control process exited, code=killed, status=11/SEGV
Jun 15 21:25:17 ada systemd[1]: i2pd.service: Failed with result 'signal'.
Jun 15 21:25:17 ada systemd[1]: Failed to start I2P Router written in C++.

* `systemctl restart i2pd` has the same issue.

* I expect it to run out of the box (especially not SEGV).


-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (900, 'testing'), (800, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.17.0-1-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_AU.UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages i2pd depends on:
ii adduser 3.121
ii init-system-helpers 1.63
ii libboost-filesystem1.74.0 1.74.0-16
ii libboost-program-options1.74.0 1.74.0-16
ii libc6 2.33-7
ii libgcc-s1 12.1.0-2
ii libminiupnpc17 2.2.3-1+b1
ii libssl3 3.0.3-7
ii libstdc++6 12.1.0-2
ii lsb-base 11.2
ii zlib1g 1:1.2.11.dfsg-4

i2pd recommends no packages.
Bernhard Übelacker
2022-06-30 18:50:02 UTC
Permalink
Dear Maintainer,
this crash might be a result of the new ssl version.
Package i2pd version 2.41.0-1+b1 was build with libssl-dev 3.0.3-2.
While i2pd version 2.41.0-1 was build against libssl-dev 1.1.1n-1.

There seems to be a bug report in openssl for this issue [1],
and a discussion about a modification [2] , also in openssl.

Until this patch is merged into openssl upstream and is integrated in Debian,
it might be a workaround to downgrade i2pd to version 2.41.0-1
from snapshot.d.o [3].

Should this bug get reassigned to openssl/3.0.3-8 and
add an affects i2pd? (3.0.4-2 from unstable shows the same crash.)

Kind regards,
Bernhard

[1] https://github.com/openssl/openssl/issues/18669
[2] https://github.com/openssl/openssl/pull/18673
[3] https://snapshot.debian.org/package/i2pd/2.41.0-1/#i2pd_2.41.0-1


(gdb) bt
#0 __pthread_rwlock_wrlock_full64 (abstime=0x0, clockid=0, rwlock=0x0) at pthread_rwlock_common.c:603
#1 __GI___pthread_rwlock_wrlock (rwlock=0x0) at pthread_rwlock_wrlock.c:27
#2 0x00007f660b83b909 in CRYPTO_THREAD_write_lock (lock=<optimized out>) at ../crypto/threads_pthread.c:112
#3 0x00007f660b758b03 in conf_modules_finish_int () at ../crypto/conf/conf_mod.c:524
#4 0x00007f660b759232 in CONF_modules_unload (all=1) at ../crypto/conf/conf_mod.c:482
#5 0x0000556efe8c2094 in boost::asio::ssl::detail::openssl_init_base::do_init::~do_init (this=0x556effe22f30, __in_chrg=<optimized out>) at /usr/include/boost/asio/ssl/detail/impl/openssl_init.ipp:90
#6 std::_Sp_counted_ptr<boost::asio::ssl::detail::openssl_init_base::do_init*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:348
#7 0x0000556efe8c315a in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x556effe22f50) at /usr/include/c++/11/bits/shared_ptr_base.h:168
#8 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x556effe22f50) at /usr/include/c++/11/bits/shared_ptr_base.h:161
#9 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:705
#10 std::__shared_ptr<boost::asio::ssl::detail::openssl_init_base::do_init, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:1154
#11 std::shared_ptr<boost::asio::ssl::detail::openssl_init_base::do_init>::~shared_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr.h:122
#12 0x00007f660b461f77 in __run_exit_handlers (status=0, listp=0x7f660b5f5738 <__exit_funcs>, run_list_atexit=***@entry=true, run_dtors=***@entry=true) at exit.c:108
#13 0x00007f660b46211a in __GI_exit (status=<optimized out>) at exit.c:139
#14 0x0000556efe9284ef in i2p::util::DaemonLinux::start (this=0x556efec183e0 <i2p::util::DaemonLinux::Instance()::instance>) at ./daemon/UnixDaemon.cpp:71
#15 0x0000556efe8a31af in main (argc=8, argv=0x7ffe5312a448) at ./daemon/i2pd.cpp:30
piorunz
2022-12-25 18:50:01 UTC
Permalink
(I tried to send this report from Reportbug but that seem to have
failed, so resending as e-mail).

Similar behaviour has been identified in Debian Stable. i2pd is broken
and does not start anymore.

$ sudo systemctl status i2pd
● i2pd.service - I2P Router written in C++
Loaded: loaded (/lib/systemd/system/i2pd.service; enabled; vendor
preset: enabled)
Active: failed (Result: signal) since Sun 2022-12-25 17:29:27 GMT;
1h 6min ago
Docs: man:i2pd(1)
https://i2pd.readthedocs.io/en/latest/
Process: 106822 ExecStart=/usr/sbin/i2pd $DAEMON_OPTS (code=exited,
status=0/SUCCESS)
Main PID: 106823 (code=killed, signal=SEGV)
CPU: 426ms

Dec 25 17:29:13 x systemd[1]: Starting I2P Router written in C++...
Dec 25 17:29:13 x systemd[1]: Started I2P Router written in C++.
Dec 25 17:29:27 x systemd[1]: i2pd.service: Main process exited,
code=killed, status=11/SEGV
Dec 25 17:29:27 x systemd[1]: i2pd.service: Failed with result 'signal'.

Restarting the service does not help.

sudo coredumpctl list | grep i2pd
Sun 2022-11-06 23:15:37 GMT 1628 128 133 11 missing /usr/sbin/i2pd
Mon 2022-11-14 02:04:27 GMT 1611 128 133 11 missing /usr/sbin/i2pd
Sat 2022-12-24 03:37:30 GMT 1675 128 133 11 present /usr/sbin/i2pd
Sun 2022-12-25 17:29:27 GMT 106823 128 133 11 present /usr/sbin/i2pd

sudo coredumpctl gdb 106823
PID: 106823 (i2pd)
UID: 128 (i2pd)
GID: 133 (i2pd)
Signal: 11 (SEGV)
Timestamp: Sun 2022-12-25 17:29:26 GMT (1h 7min ago)
Command Line: /usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf
--tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d
--pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon
--service
Executable: /usr/sbin/i2pd
Control Group: /system.slice/i2pd.service
Unit: i2pd.service
Slice: system.slice
Boot ID: a4275715832840bb82f50a4d1216e028
Machine ID: 66f054f85acd4f7b9d2f07ff9b88ad15
Hostname: x
Storage:
/var/lib/systemd/coredump/core.i2pd.128.a4275715832840bb82f50a4d1216e028.106823.1671989366000000.zst
Message: Process 106823 (i2pd) of user 128 dumped core.

Stack trace of thread 106825:
#0 0x000055bbf92d4fd4
_ZN3i2p4data10RouterInfo14ReadFromStreamERSi (i2pd + 0x25ffd4)
#1 0x000055bbf92d62f7
_ZN3i2p4data10RouterInfo14ReadFromBufferEb (i2pd + 0x2612f7)
#2 0x000055bbf92d6888 _ZN3i2p4data10RouterInfoC2EPKhi
(i2pd + 0x261888)
#3 0x000055bbf929d059
_ZN3i2p4data5NetDb13AddRouterInfoERKNS0_3TagILm32EEEPKhiRb (i2pd + 0x228059)
#4 0x000055bbf929e035
_ZN3i2p4data5NetDb13AddRouterInfoERKNS0_3TagILm32EEEPKhi (i2pd + 0x229035)
#5 0x000055bbf929e4e2
_ZN3i2p4data5NetDb22HandleDatabaseStoreMsgESt10shared_ptrIKNS_11I2NPMessageEE
(i2pd + 0x2294e2)
#6 0x000055bbf929f8b9 _ZN3i2p4data5NetDb3RunEv (i2pd +
0x22a8b9)
#7 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#8 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#9 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106829:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf91d9b3b
_ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE (i2pd +
0x164b3b)
#3 0x000055bbf936defd
_ZN3i2p9transport9SSUServer12RunReceiversEv (i2pd + 0x2f8efd)
#4 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#5 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#6 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106826:
#0 0x00007efec8eed7b2 futex_wait_cancelable
(libpthread.so.0 + 0xe7b2)
#1 0x00007efec8fe490c
_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE
(libstdc++.so.6 + 0xc990c)
#2 0x000055bbf92ffb0f
_ZN3i2p9transport21EphemeralKeysSupplierINS_6crypto10X25519KeysEE3RunEv
(i2pd + 0x28ab0f)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106827:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf91d9b3b
_ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE (i2pd +
0x164b3b)
#3 0x000055bbf92f6d8d
_ZN3i2p9transport10Transports3RunEv (i2pd + 0x281d8d)
#4 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#5 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#6 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106833:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf93263cc
_ZN3i2p4util15RunnableService3RunEv (i2pd + 0x2b13cc)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106835:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf93263cc
_ZN3i2p4util15RunnableService3RunEv (i2pd + 0x2b13cc)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106823:
#0 0x00007efec8dcd561 __GI___clock_nanosleep
(libc.so.6 + 0xc3561)
#1 0x00007efec8dd2d43 __GI___nanosleep (libc.so.6 +
0xc8d43)
#2 0x000055bbf9215285 _ZN3i2p4util11DaemonLinux3runEv
(i2pd + 0x1a0285)
#3 0x000055bbf91ae02a main (i2pd + 0x13902a)
#4 0x00007efec8d2dd0a __libc_start_main (libc.so.6 +
0x23d0a)
#5 0x000055bbf91b2cda _start (i2pd + 0x13dcda)

Stack trace of thread 106828:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf93263cc
_ZN3i2p4util15RunnableService3RunEv (i2pd + 0x2b13cc)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106836:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf93263cc
_ZN3i2p4util15RunnableService3RunEv (i2pd + 0x2b13cc)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106834:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf93263cc
_ZN3i2p4util15RunnableService3RunEv (i2pd + 0x2b13cc)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106830:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf91d9b3b
_ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE (i2pd +
0x164b3b)
#3 0x000055bbf936923d
_ZN3i2p9transport9SSUServer3RunEv (i2pd + 0x2f423d)
#4 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#5 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#6 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106831:
#0 0x00007efec8e06d56 epoll_wait (libc.so.6 + 0xfcd56)
#1 0x000055bbf91d63d8
_ZN5boost4asio6detail13epoll_reactor3runElRNS1_8op_queueINS1_19scheduler_operationEEE
(i2pd + 0x1613d8)
#2 0x000055bbf91d9b3b
_ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE (i2pd +
0x164b3b)
#3 0x000055bbf91c713d _ZN3i2p4http10HTTPServer3RunEv
(i2pd + 0x15213d)
#4 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#5 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#6 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106824:
#0 0x00007efec8eed7b2 futex_wait_cancelable
(libpthread.so.0 + 0xe7b2)
#1 0x00007efec8fe490c
_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE
(libstdc++.so.6 + 0xc990c)
#2 0x000055bbf928e975 _ZN3i2p3log3Log3RunEv (i2pd +
0x219975)
#3 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#4 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#5 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

Stack trace of thread 106832:
#0 0x00007efec8eeddf8 futex_abstimed_wait_cancelable
(libpthread.so.0 + 0xedf8)
#1 0x000055bbf9308b62 _ZN3i2p6tunnel7Tunnels3RunEv
(i2pd + 0x293b62)
#2 0x00007efec8fe9ed0 n/a (libstdc++.so.6 + 0xceed0)
#3 0x00007efec8ee6ea7 start_thread (libpthread.so.0 +
0x7ea7)
#4 0x00007efec8e06a2f __clone (libc.so.6 + 0xfca2f)

GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/i2pd...
(No debugging symbols found in /usr/sbin/i2pd)
[New LWP 106825]
[New LWP 106829]
[New LWP 106826]
[New LWP 106827]
[New LWP 106833]
[New LWP 106835]
[New LWP 106823]
[New LWP 106828]
[New LWP 106836]
[New LWP 106834]
[New LWP 106830]
[New LWP 106831]
[New LWP 106824]
[New LWP 106832]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf
--tunconf=/etc/i2pd/tunnels.conf --tu'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055bbf92d4fd4 in
i2p::data::RouterInfo::ReadFromStream(std::istream&) ()
[Current thread is 1 (Thread 0x7efec3fff700 (LWP 106825))]
(gdb) bt
#0 0x000055bbf92d4fd4 in
i2p::data::RouterInfo::ReadFromStream(std::istream&) ()
#1 0x000055bbf92d62f7 in i2p::data::RouterInfo::ReadFromBuffer(bool) ()
#2 0x000055bbf92d6888 in i2p::data::RouterInfo::RouterInfo(unsigned
char const*, int) ()
#3 0x000055bbf929d059 in
i2p::data::NetDb::AddRouterInfo(i2p::data::Tag<32ul> const&, unsigned
char const*, int, bool&) ()
#4 0x000055bbf929e035 in
i2p::data::NetDb::AddRouterInfo(i2p::data::Tag<32ul> const&, unsigned
char const*, int) ()
#5 0x000055bbf929e4e2 in
i2p::data::NetDb::HandleDatabaseStoreMsg(std::shared_ptr<i2p::I2NPMessage
const>) ()
#6 0x000055bbf929f8b9 in i2p::data::NetDb::Run() ()
#7 0x00007efec8fe9ed0 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007efec8ee6ea7 in start_thread (arg=<optimized out>) at
pthread_create.c:477
#9 0x00007efec8e06a2f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)

-- System Information:
Debian Release: 11.6
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-20-amd64 (SMP w/16 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages i2pd depends on:
ii adduser 3.118
ii init-system-helpers 1.60
ii libboost-filesystem1.74.0 1.74.0-9
ii libboost-program-options1.74.0 1.74.0-9
ii libc6 2.31-13+deb11u5
ii libgcc-s1 10.2.1-6
ii libminiupnpc17 2.2.1-1
ii libssl1.1 1.1.1n-0+deb11u3
ii libstdc++6 10.2.1-6
ii lsb-base 11.1.0
ii zlib1g 1:1.2.11.dfsg-2+deb11u2

i2pd recommends no packages.

i2pd suggests no packages.

Loading...