FS#62905 - [curl] 7.65.1-2 update causes crashes in libtorrent

Attached to Project: Arch Linux
Opened by Vladimir (_v_l) - Saturday, 15 June 2019, 07:15 GMT
Last edited by Eli Schwartz (eschwartz) - Wednesday, 19 June 2019, 01:55 GMT
Task Type Support Request
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
after curl package update I faced with crash of rtorrent. I figured out that libtorrent has to be rebuild vs new curl.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Wednesday, 19 June 2019, 01:55 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#62892 
Comment by Vladimir (_v_l) - Saturday, 15 June 2019, 07:17 GMT
Sigh, sorry I forgot to set correct title and I don't see any way to edit it after submitting the support request.
Comment by Antonio Rojas (arojas) - Saturday, 15 June 2019, 07:25 GMT
Please post a backtrace of the crash
Comment by Vladimir (_v_l) - Saturday, 15 June 2019, 07:41 GMT
Unfortunately I updated packages manually on the host (recompiled) but systemd kept the dump:

first crash (when started rtorrent under tmux):

Stack trace of thread 1372:
#0 0x00007fef232f2755 raise (libc.so.6)
#1 0x00007fef232dd851 abort (libc.so.6)
#2 0x0000560c31e20026 n/a (rtorrent)
#3 0x00007fef23690cb0 __restore_rt (libpthread.so.0)
#4 0x00007fef23720b54 _ZN7torrent9PollEPoll11insert_readEPNS_5EventE (libtorrent.so.20)
#5 0x0000560c31f2c9ab n/a (rtorrent)
#6 0x00007fef23a35fbc n/a (libcurl.so.4)
#7 0x00007fef23a3915f n/a (libcurl.so.4)
#8 0x00007fef23a39315 curl_multi_socket_action (libcurl.so.4)
#9 0x0000560c31f2a4db n/a (rtorrent)
#10 0x0000560c31f2a7b2 n/a (rtorrent)
#11 0x0000560c31e3dae9 n/a (rtorrent)
#12 0x00007fef2375b458 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#13 0x0000560c31e3ba15 n/a (rtorrent)
#14 0x00007fef232deee3 __libc_start_main (libc.so.6)
#15 0x0000560c31e3c2fe n/a (rtorrent)

Stack trace of thread 1389:
#0 0x00007fef233b424e epoll_wait (libc.so.6)
#1 0x00007fef23720596 _ZN7torrent9PollEPoll4pollEi (libtorrent.so.20)
#2 0x00007fef23720763 _ZN7torrent9PollEPoll7do_pollEli (libtorrent.so.20)
#3 0x00007fef2375b3d8 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#4 0x00007fef2368657f start_thread (libpthread.so.0)
#5 0x00007fef233b3f13 __clone (libc.so.6)

Stack trace of thread 1374:
#0 0x00007fef2308a6de n/a (libcrypto.so.1.1)
#1 0x00007fef2308b507 SHA1_Update (libcrypto.so.1.1)
#2 0x00007fef23762043 n/a (libtorrent.so.20)
#3 0x00007fef237620ce n/a (libtorrent.so.20)
#4 0x00007fef237614be n/a (libtorrent.so.20)
#5 0x00007fef237044cd n/a (libtorrent.so.20)
#6 0x00007fef2375b424 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#7 0x00007fef2368657f start_thread (libpthread.so.0)
#8 0x00007fef233b3f13 __clone (libc.so.6)


second crash (when manually started rtorrent in tmux window, bash shell):

Stack trace of thread 5721:
#0 0x00007fbad51d4755 raise (libc.so.6)
#1 0x00007fbad51bf851 abort (libc.so.6)
#2 0x0000561dab350026 n/a (rtorrent)
#3 0x00007fbad5572cb0 __restore_rt (libpthread.so.0)
#4 0x00007fbad5602b54 _ZN7torrent9PollEPoll11insert_readEPNS_5EventE (libtorrent.so.20)
#5 0x0000561dab45c9ab n/a (rtorrent)
#6 0x00007fbad5917fbc n/a (libcurl.so.4)
#7 0x00007fbad591b15f n/a (libcurl.so.4)
#8 0x00007fbad591b315 curl_multi_socket_action (libcurl.so.4)
#9 0x0000561dab45a4db n/a (rtorrent)
#10 0x0000561dab45a7b2 n/a (rtorrent)
#11 0x0000561dab36dae9 n/a (rtorrent)
#12 0x00007fbad563d458 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#13 0x0000561dab36ba15 n/a (rtorrent)
#14 0x00007fbad51c0ee3 __libc_start_main (libc.so.6)
#15 0x0000561dab36c2fe n/a (rtorrent)

Stack trace of thread 5725:
#0 0x00007fbad529624e epoll_wait (libc.so.6)
#1 0x00007fbad5602596 _ZN7torrent9PollEPoll4pollEi (libtorrent.so.20)
#2 0x00007fbad5602763 _ZN7torrent9PollEPoll7do_pollEli (libtorrent.so.20)
#3 0x00007fbad563d3d8 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#4 0x00007fbad556857f start_thread (libpthread.so.0)
#5 0x00007fbad5295f13 __clone (libc.so.6)

Stack trace of thread 5722:
#0 0x00007fbad529624e epoll_wait (libc.so.6)
#1 0x00007fbad5602596 _ZN7torrent9PollEPoll4pollEi (libtorrent.so.20)
#2 0x00007fbad5602763 _ZN7torrent9PollEPoll7do_pollEli (libtorrent.so.20)
#3 0x00007fbad563d3d8 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#4 0x00007fbad556857f start_thread (libpthread.so.0)
#5 0x00007fbad5295f13 __clone (libc.so.6)

Comment by Vladimir (_v_l) - Sunday, 16 June 2019, 14:23 GMT
Unfortunately, even after I locally rebuild libtorrent/rtorrent vs new curl rtorrent still crashes with the same error:

Stack trace of thread 6090:
#0 0x00007f1c7e1fc755 raise (libc.so.6)
#1 0x00007f1c7e1e7851 abort (libc.so.6)
#2 0x000055bd42bed086 n/a (rtorrent)
#3 0x00007f1c7e59acb0 __restore_rt (libpthread.so.0)
#4 0x00007f1c7e636814 _ZN7torrent9PollEPoll11insert_readEPNS_5EventE (libtorrent.so.20)
#5 0x000055bd42d04aeb n/a (rtorrent)
#6 0x00007f1c7e742fbc n/a (libcurl.so.4)
#7 0x00007f1c7e74615f n/a (libcurl.so.4)
#8 0x00007f1c7e746315 curl_multi_socket_action (libcurl.so.4)
#9 0x000055bd42d02b62 n/a (rtorrent)
#10 0x000055bd42d02c34 n/a (rtorrent)
#11 0x000055bd42c10b2d n/a (rtorrent)
#12 0x00007f1c7e66c60a _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#13 0x000055bd42c0e9b5 n/a (rtorrent)
#14 0x00007f1c7e1e8ee3 __libc_start_main (libc.so.6)
#15 0x000055bd42c0f27e n/a (rtorrent)

Stack trace of thread 6091:
#0 0x00007f1c7e2be24e epoll_wait (libc.so.6)
#1 0x00007f1c7e636c36 _ZN7torrent9PollEPoll4pollEi (libtorrent.so.20)
#2 0x00007f1c7e636e07 _ZN7torrent9PollEPoll7do_pollEli (libtorrent.so.20)
#3 0x00007f1c7e66c593 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#4 0x00007f1c7e59057f start_thread (libpthread.so.0)
#5 0x00007f1c7e2bdf13 __clone (libc.so.6)

Stack trace of thread 6095:
#0 0x00007f1c7e2be24e epoll_wait (libc.so.6)
#1 0x00007f1c7e636c36 _ZN7torrent9PollEPoll4pollEi (libtorrent.so.20)
#2 0x00007f1c7e636e07 _ZN7torrent9PollEPoll7do_pollEli (libtorrent.so.20)
#3 0x00007f1c7e66c593 _ZN7torrent11thread_base10event_loopEPS0_ (libtorrent.so.20)
#4 0x00007f1c7e59057f start_thread (libpthread.so.0)
#5 0x00007f1c7e2bdf13 __clone (libc.so.6)

Comment by Gaetan Bisson (vesath) - Sunday, 16 June 2019, 16:36 GMT
I think you should report this to both curl upstream and rtorrent upstream. I'm currently stretched for time and could not reproduce this segfault on my machine with my limited tests. Cheers.
Comment by Eli Schwartz (eschwartz) - Sunday, 16 June 2019, 16:57 GMT
@Vladimir, I'm curious how you "figured out that libtorrent has to be rebuild vs new curl", since this is not usually how software works. libcurl defines a stable ABI, and applications should not need rebuilding unless the soname changes or libcurl violates the ABI contract (and this is software that is usually pretty reliable about not violating the ABI contract).

This smells very, very strongly of a curl bug -- you update curl, and some other application *crashes*?

> after curl package update

So, would you please be polite enough to tell us which version of curl you updated to? It's not at all clear, because:

curl 7.65.1-1 released on the 5th
- migrates to [core] on the 8th
curl 7.65.1-2 released on the 10th
- migrates to [core] on the same day
you reported this bug on the 15th

We have no idea which of the last three curl releases you are using. None of them align with the date you reported this bug, and my crystal ball is at the repair shop and is thus incapable of reading your mind to figure it out for you!

I am going to take a wild guess and say that you updated to 7.65.1-2 specifically, and your issue is probably  FS#62892  -- please confirm if curl 7.65.1-3 fixes your issue.

It seems plausible -- the backtrace invokes curl_multi_socket_action, which was broken.
Comment by Vladimir (_v_l) - Monday, 17 June 2019, 00:09 GMT
@eschwartz, yes it seems the curl bug.

I noticed the rtorrent crash only after the reboot (I reboot a host only after kernel update). At first, I thought it is the problem with libtorrent and new curl (ie libtorrent needs to be recompiled vs new curl, I was in rush, so didn't thought thoroughly about the reason of the crash) because the rtorrent crashed almost immediately I started it in terminal. Unfortunately, recompiled libtorrent/rtorrent crashed but not so quickly so I didn't notice that. With new curl (7.65.1-3) all is working fine (24+ hours of run).

Loading...