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

segfault at 0 ip 00005602580ea423 sp 00007ffbbd7f9910 error 4 in i2pd[560257fe3000+2eb000] #1738

Closed
slrslr opened this issue Mar 5, 2022 · 19 comments

Comments

@slrslr
Copy link

slrslr commented Mar 5, 2022

Linux Debian "systemctl status i2pd" shown:

Active: failed (Result: signal)
(code=killed, signal=SEGV)

https://www.quora.com/What-is-a-SEGV-in-Linux

checking "sudo journalctl -xg SEGV"
and then the lines around the time using "sudo journalctl -x --since today" i have found:

kernel: I2CP[1450]: segfault at 0 ip 00005602580ea423 sp 00007ffbbd7f9910 error 4 in i2pd[560257fe3000+2eb000]
kernel: Code: 48 8b 45 08 48 89 fb 48 8b 77 08 4c 8b 03 48 f7 f6 4d 8d 0c d0 48 89 d7 49 8b 11 48 89 d0 66 0f 1f 84 00 00 00 00 00 48 89 c1 <48> 8b 00 48 39 c5 75 f5 4c 8b 65 00 48 39 ca 74 4c 4d 85 e4 74 17
systemd[1]: i2pd.service: Main process exited, code=killed, status=11/SEGV
...
░░ The process' exit code is 'killed' and its exit status is 11.
...
░░ The unit i2pd.service has entered the 'failed' state with result 'signal'.
Mar 05 03:13:17 hn systemd[1]: i2pd.service: Consumed 52min 10.045s CPU time.

Last minute of the /var/log/i2pd/i2pd.log
is here

currently SWAP is 0 bytes free and normal memory is 9.4Gi free

Package: i2pd
Version: 2.41.0-1bullseye1
Depends: libboost-filesystem1.74.0 (>= 1.74.0), libboost-program-options1.74.0 (>= 1.74.0), libc6 (>= 2.30), libgcc-s1 (>= 3.0), libminiupnpc17 (>= 1.9.20140610), libssl1.1 (>= 1.1.1), libstdc++6 (>= 9), zlib1g (>= 1:1.1.4), lsb-base
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status

If i should try something, let me know please.

@r4sas
Copy link
Member

r4sas commented Mar 5, 2022

Please enable coredump saving and install i2pd-dbgsym package.

sudo apt-get install gdb i2pd-dbgsym
sudo mkdir /etc/systemd/system/i2pd.service.d
sudo echo -e "[Service]\nLimitCORE=infinity" > /etc/systemd/system/i2pd.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart i2pd

Wait for crash, then go to /var/lib/i2pd/ and call gdb /usr/sbin/i2pd core.
If coredump exists and everything loaded correctly, you will see something like Core was generated by /usr/sbin/i2pd ....
Call bt full in gdb prompt and share output with pastebin service.

@slrslr
Copy link
Author

slrslr commented Mar 5, 2022

-> E: Unable to locate package i2pd-dbgsym

$ sudo apt search i2pd*
not return anything relevant except "i2pd/now 2.41.0-1bullseye1"

My Linux experience is low and my /etc/apt/sources.list like this. i do not see any dbgsym deb package or such downloadable.
My expectations to catch this crash are low, but i would try if you suggest how to install that debugging on Debian.

@r4sas
Copy link
Member

r4sas commented Mar 5, 2022

Where you got package?

@r4sas
Copy link
Member

r4sas commented Mar 5, 2022

Please use our repository: https://repo.i2pd.xyz/.help/readme.html

@slrslr
Copy link
Author

slrslr commented Mar 5, 2022

Where you got package?

it was .deb from github.com/PurpleI2P/i2pd/.
Anyway Yours linked repository worked to install that i2pd-dbgsym and i did as you instructed.
Btw. your "sudo echo" command not worked (this combination does not gain permission to wite to file), you need to use following on Debian instead:
echo -e "[Service]\nLimitCORE=infinity"|sudo tee -a /etc/systemd/system/i2pd.service.d/override.conf

enable coredump saving

In repository is:

systemd-coredump/stable 247.3-6 amd64
  tools for storing and retrieving coredumps

so i have installed it: sudo apt install systemd-coredump

and coredumps are created using command: sleep 10 & kill -s 11 $! && coredumpctl

so i will inform if crash happen again..

@Ty3r0X
Copy link

Ty3r0X commented Mar 15, 2022

I got a similar segfault right out of the blues, after updating i2pd using your repo seemed to solve the issue.

@alphaonex86
Copy link

I don't know if same crash but:
Thread 3 "NetDB" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xfffff6ecf130 (LWP 18188)] 0x0000aaaaaac55740 in i2p::data::Base64ToByteStream (InBuffer=InBuffer@entry=0xfffff6ecd628 "O7EzKQpOIQffYq5jX4ZmeyYXncw2Zou3ad60Kgx1cD4=", InCount=<optimized out>, OutBuffer=0x0, len=len@entry=32) at ./libi2pd/Base.cpp:209 Download failed: Function not implemented. Continuing without source file ./obj-aarch64-linux-gnu/./libi2pd/Base.cpp. 209 ./libi2pd/Base.cpp: No such file or directory. (gdb) bt #0 0x0000aaaaaac55740 in i2p::data::Base64ToByteStream (InBuffer=InBuffer@entry=0xfffff6ecd628 "O7EzKQpOIQffYq5jX4ZmeyYXncw2Zou3ad60Kgx1cD4=", InCount=<optimized out>, OutBuffer=0x0, len=len@entry=32) at ./libi2pd/Base.cpp:209 #1 0x0000aaaaaad00b90 in i2p::data::RouterInfo::ReadFromStream (this=this@entry=0xffffcc0f4b20, s=...) at ./libi2pd/Tag.h:44 #2 0x0000aaaaaad020d0 in i2p::data::RouterInfo::ReadFromBuffer (this=this@entry=0xffffcc0f4b20, verifySignature=verifySignature@entry=true) at ./libi2pd/RouterInfo.cpp:180 #3 0x0000aaaaaad0242c in i2p::data::RouterInfo::RouterInfo (this=0xffffcc0f4b20, buf=0xfffff6ecdda8 "\310\251\227,D\257\373\377\260W\241\242\226(s\244\256\233<\t\026\351\234{\372\312#\356\252\321D(\353\356\364ir\221\244R\322v\212\226\036\352\325\215\033\374R\346\025\272\032Z\276\353\234\360x\242#\a\006Z\306\213\304:\f\260\357\207\221V\367\t\r\343\366\001-\002\214\202_9\366x8M\273\215?\220\301\030\274\215\232\246\354e\343\060\307\003%q\250<\334t\313\305\"K\301\062\022 \210\344\256# i\211\357\021\322\203\030\224\n\275\260!\325 \206@>\004ms\"\216\251\373\022l\035\021\344\212m\265(a\251Ax\274\240\340\n\257y\276\361b\321\t'\033\372\304T\323\332:\214;\365\232\016\307\257\266\262D\235u\340\217!\317\244"..., len=<optimized out>) at ./libi2pd/RouterInfo.cpp:56 #4 0x0000aaaaaacc6b60 in __gnu_cxx::new_allocator<i2p::data::RouterInfo>::construct<i2p::data::RouterInfo, unsigned char const*&, int&> (__p=0xffffcc0f4b20, this=<optimized out>) at /usr/include/c++/10/new:175 #5 std::allocator_traits<std::allocator<i2p::data::RouterInfo> >::construct<i2p::data::RouterInfo, unsigned char const*&, int&> (__p=0xffffcc0f4b20, __a=...) at /usr/include/c++/10/bits/alloc_traits.h:512 #6 std::_Sp_counted_ptr_inplace<i2p::data::RouterInfo, std::allocator<i2p::data::RouterInfo>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<unsigned char const*&, int&> (__a=..., this=0xffffcc0f4b10) at /usr/include/c++/10/bits/shared_ptr_base.h:551 #7 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<i2p::data::RouterInfo, std::allocator<i2p::data::RouterInfo>, unsigned char const*&, int&> (__a=..., __p=<optimized out>, this=<optimized out>) at /usr/include/c++/10/bits/shared_ptr_base.h:682 #8 std::__shared_ptr<i2p::data::RouterInfo, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<i2p::data::RouterInfo>, unsigned char const*&, int&> (__tag=..., this=<optimized out>) at /usr/include/c++/10/bits/shared_ptr_base.h:1376 #9 std::shared_ptr<i2p::data::RouterInfo>::shared_ptr<std::allocator<i2p::data::RouterInfo>, unsigned char const*&, int&> (__tag=..., this=<optimized out>) at /usr/include/c++/10/bits/shared_ptr.h:408 #10 std::allocate_shared<i2p::data::RouterInfo, std::allocator<i2p::data::RouterInfo>, unsigned char const*&, int&> (__a=...) at /usr/include/c++/10/bits/shared_ptr.h:862 #11 std::make_shared<i2p::data::RouterInfo, unsigned char const*&, int&> () at /usr/include/c++/10/bits/shared_ptr.h:878 #12 i2p::data::NetDb::AddRouterInfo (this=this@entry=0xaaaaaaf2abc0 <i2p::data::netdb>, ident=..., buf=buf@entry=0xfffff6ecdda8 "\310\251\227,D\257\373\377\260W\241\242\226(s\244\256\233<\t\026\351\234{\372\312#\356\252\321D(\353\356\364ir\221\244R\322v\212\226\036\352\325\215\033\374R\346\025\272\032Z\276\353\234\360x\242#\a\006Z\306\213\304:\f\260\357\207\221V\367\t\r\343\366\001-\002\214\202_9\366x8M\273\215?\220\301\030\274\215\232\246\354e\343\060\307\003%q\250<\334t\313\305\"K\301\062\022 \210\344\256# i\211\357\021\322\203\030\224\n\275\260!\325 \206@>\004ms\"\216\251\373\022l\035\021\344\212m\265(a\251Ax\274\240\340\n\257y\276\361b\321\t'\033\372\304T\323\332:\214;\365\232\016\307\257\266\262D\235u\340\217!\317\244"..., len=len@entry=1475, updated=@0xfffff6ecdb27: true) at ./libi2pd/NetDb.cpp:280 #13 0x0000aaaaaacc75b0 in i2p::data::NetDb::AddRouterInfo (this=this@entry=0xaaaaaaf2abc0 <i2p::data::netdb>, ident=..., buf=buf@entry=0xfffff6ecdda8 "\310\251\227,D\257\373\377\260W\241\242\226(s\244\256\233<\t\026\351\234{\372\312#\356\252\321D(\353\356\364ir\221\244R\322v\212\226\036\352\325\215\033\374R\346\025\272\032Z\276\353\234\360x\242#\a\006Z\306\213\304:\f\260\357\207\221V\367\t\r\343\366\001-\002\214\202_9\366x8M\273\215?\220\301\030\274\215\232\246\354e\343\060\307\003%q\250<\334t\313\305\"K\301\062\022 \210\344\256# i\211\357\021\322\203\030\224\n\275\260!\325 \206@>\004ms\"\216\251\373\022l\035\021\344\212m\265(a\251Ax\274\240\340\n\257y\276\361b\321\t'\033\372\304T\323\332:\214;\365\232\016\307\257\266\262D\235u\340\217!\317\244"..., len=len@entry=1475) at ./libi2pd/NetDb.cpp:247 #14 0x0000aaaaaacc7928 in i2p::data::NetDb::HandleDatabaseStoreMsg (this=this@entry=0xaaaaaaf2abc0 <i2p::data::netdb>, m= std::shared_ptr<const i2p::I2NPMessage> (use count 2, weak count 0) = {...}) at ./libi2pd/NetDb.cpp:792 #15 0x0000aaaaaacc8414 in i2p::data::NetDb::Run (this=0xaaaaaaf2abc0 <i2p::data::netdb>) at ./libi2pd/NetDb.cpp:123 #16 0x0000fffff7a41dec in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6 #17 0x0000fffff7925f3c in start_thread (arg=0x0) at pthread_create.c:481 #18 0x0000fffff7876cdc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

@r4sas
Copy link
Member

r4sas commented Mar 16, 2022

I don't know if same crash but:

Looks like old version. Update to 2.41.0.

@hb9eue
Copy link

hb9eue commented Apr 1, 2022

@hb9eue
Copy link

hb9eue commented Apr 1, 2022

2.41.0 from https://repo.i2pd.xyz/.help/readme.html fixed the issue for me

@Barracuda72
Copy link

Getting similar kind of segfault on Ubuntu 22.04 and I2PD 2.41 from the repo

i2pd version 2.41.0 (0.9.53)
Boost version 1.74.0
OpenSSL 3.0.1 14 Dec 2021

Backtrace here: https://pastebin.com/jTs1ZtT9

@Barracuda72
Copy link

Barracuda72 commented Apr 29, 2022

Getting similar kind of segfault on Ubuntu 22.04 and I2PD 2.41 from the repo

i2pd version 2.41.0 (0.9.53)
Boost version 1.74.0
OpenSSL 3.0.1 14 Dec 2021

Backtrace here: https://pastebin.com/jTs1ZtT9

Rolled back to version 2.29.0 and the problem seems to be gone (UPD: see my comment below). Must be some kind of regression.

@r4sas
Copy link
Member

r4sas commented Apr 30, 2022

Try package from i2pd-git PPA: https://launchpad.net/~purplei2p/+archive/ubuntu/i2pd-git

@Barracuda72
Copy link

What can I confirm so far:

  • Prebuilt version 2.41.0 crashes
  • Custom built 2.41.0 crashes
  • Custom built 2.38.0 crashes
  • Custom built 2.35.0 seems to be OK
  • Custom built 2.29.0 doesn't crash but also can't connect to anything (stuck at Network status: Testing and Tunnel creation success rate: 0%)

Haven't tried version from i2pd-git ppa yet. As far as 2.35.0 works, I'm more than OK with it.

@r4sas
Copy link
Member

r4sas commented May 4, 2022

In that case build i2pd yourself and run it using gdb to check what happens.

make DEBUG=yes -j<cores> and run it with gdb i2pd -> run.

Maybe also here can be problem with AES-NI on Ubuntu 22.04, can you try to disable it in config file in section cpuext?

Haven't tried version from i2pd-git ppa yet. As far as 2.35.0 works, I'm more than OK with it.

After a time it will crash when router meet some of SSU2-enabled peers.

@r4sas
Copy link
Member

r4sas commented May 4, 2022

Tested with release package and i2pd-git (https://launchpad.net/~purplei2p/+archive/ubuntu/i2pd-git/+sourcepub/13492589/+listing-archive-extra): release crashes with malloc - seems like launchpad builds shit like always, for trunk package - crashing too.

But local build using trunk works (not tested for long) with OpenSSL 3.0.2 and without any issues with OpenSSL 1.1.1.

@Barracuda72
Copy link

Barracuda72 commented May 20, 2022

So, it's been two weeks on i2pd 2.35.0. No problems or crashes whatsoever.

I guess I'm stuck with it until some incompatible changes in the protocol will be introduced.

Thanks @r4sas , but I don't have much freedom of experiment on this machine. It should work and be accessible 24/7/365, and with 2.35.0 it does.

@r4sas
Copy link
Member

r4sas commented May 20, 2022

In any case, we do not recommend using older versions. We are currently unable to update the code to use the new OpenSSL API due to breaking changes in some parts of its code (some things just broken...).

Thanks @r4sas , but I don't have much freedom of experiment on this machine. It should work and be accessible 24/7/365, and with 2.35.0 it does.

You can build the binary and run it in parallel with 2.35 to make checks.

@r4sas
Copy link
Member

r4sas commented May 23, 2022

I've made some changes in package building process, please test package 2.42.0-2<dist>1 from PPA. Now it mustn't crash (I hope).

@r4sas r4sas closed this as completed May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants