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 while exiting rtorrent with an active download #1302

Open
xsmile opened this issue Oct 2, 2024 · 2 comments · May be fixed by #1335
Open

Segfault while exiting rtorrent with an active download #1302

xsmile opened this issue Oct 2, 2024 · 2 comments · May be fixed by #1335

Comments

@xsmile
Copy link

xsmile commented Oct 2, 2024

Description

rtorrent produces a segfault if the application is exited while a torrent is being downloaded.

Additional info

  • OS: Arch Linux
  • tested rtorrent versions: 0.10.0, 0.9.8, 0.9.6
  • curl version: 8.10.1

Steps to reproduce

  1. add and start downloading a torrent
  2. exit rtorrent

Details

(gdb) bt
#0  core::CurlSocket::close (this=0x5555559f1aa0) at core/curl_socket.cc:103
#1  core::CurlSocket::receive_socket (easy_handle=<optimized out>, fd=<optimized out>, what=<optimized out>, userp=<optimized out>, socketp=0x5555559f1aa0) at core/curl_socket.cc:62
#2  0x00007ffff7ea58f6 in Curl_multi_closed (data=0x5555556b0be0, s=14) at /usr/src/debug/curl/curl/lib/multi.c:3035
#3  0x00007ffff7ef05bd in socket_close.isra.0 (data=0x5555556b0be0, conn=0x555555a699b0, use_callback=<optimized out>, sock=14) at /usr/src/debug/curl/curl/lib/cf-socket.c:424
#4  0x00007ffff7e5fc47 in cf_socket_close (cf=0x555555a7b410, data=<optimized out>) at /usr/src/debug/curl/curl/lib/cf-socket.c:1005
#5  0x00007ffff7e69e56 in cf_he_close (cf=0x555555b92b30, data=0x5555556b0be0) at /usr/src/debug/curl/curl/lib/connect.c:1004
#6  0x00007ffff7eddef4 in ssl_cf_close (cf=0x555555b73760, data=0x5555556b0be0) at /usr/src/debug/curl/curl/lib/vtls/vtls.c:1666
#7  0x00007ffff7e69f0e in cf_setup_close (cf=0x555555c533a0, data=0x5555556b0be0) at /usr/src/debug/curl/curl/lib/connect.c:1359
#8  0x00007ffff7e5e6e2 in cf_hc_close (cf=0x555555a8e5d0, data=0x5555556b0be0) at /usr/src/debug/curl/curl/lib/cf-https-connect.c:496
#9  0x00007ffff7e69f7e in Curl_conn_close (data=data@entry=0x5555556b0be0, index=index@entry=0) at /usr/src/debug/curl/curl/lib/cfilters.c:180
#10 0x00007ffff7e6b00d in cpool_close_and_destroy (cpool=<optimized out>, conn=0x555555a699b0, data=0x5555556b0be0, do_shutdown=false) at /usr/src/debug/curl/curl/lib/conncache.c:1063
#11 0x00007ffff7e6c806 in cpool_shutdown_discard_all (cpool=<optimized out>) at /usr/src/debug/curl/curl/lib/conncache.c:641
#12 cpool_shutdown_all (timeout_ms=0, cpool=0x555555695cf8, data=<optimized out>) at /usr/src/debug/curl/curl/lib/conncache.c:1195
#13 cpool_close_and_destroy_all (cpool=0x555555695cf8) at /usr/src/debug/curl/curl/lib/conncache.c:679
#14 0x00007ffff7ea50ab in Curl_cpool_destroy (cpool=0x555555695cf8) at /usr/src/debug/curl/curl/lib/conncache.c:189
#15 curl_multi_cleanup (multi=0x555555695b70) at /usr/src/debug/curl/curl/lib/multi.c:2758
#16 0x00005555555bb024 in core::CurlStack::~CurlStack (this=<optimized out>, this=<optimized out>) at core/curl_stack.cc:72
#17 core::Manager::cleanup (this=0x555555695230) at core/manager.cc:170
#18 Control::cleanup (this=<optimized out>) at /usr/src/debug/rtorrent/rtorrent/src/control.cc:140
#19 0x0000555555587b13 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/rtorrent/rtorrent/src/main.cc:493
(gdb) f 0
#0  core::CurlSocket::close (this=0x5555559f1aa0) at core/curl_socket.cc:103
103	  torrent::main_thread()->poll()->closed(this);
(gdb) l
98	void
99	CurlSocket::close() {
100	  if (m_fileDesc == -1)
101	    throw torrent::internal_error("CurlSocket::close() m_fileDesc == -1.");
102	
103	  torrent::main_thread()->poll()->closed(this);
104	  m_fileDesc = -1;
105	}
106	
107	void
(gdb) f 1
#1  core::CurlSocket::receive_socket (easy_handle=<optimized out>, fd=<optimized out>, what=<optimized out>, userp=<optimized out>, socketp=0x5555559f1aa0) at core/curl_socket.cc:62
62	      socket->close();
(gdb) l
57	
58	  if (what == CURL_POLL_REMOVE) {
59	    // We also probably need the special code here as we're not
60	    // guaranteed that the fd will be closed, afaik.
61	    if (socket != NULL)
62	      socket->close();
63	
64	    // TODO: Consider the possibility that we'll need to set the
65	    // fd-associated pointer curl holds to NULL.
66	
(gdb) f 16
#16 0x00005555555bb024 in core::CurlStack::~CurlStack (this=<optimized out>, this=<optimized out>) at core/curl_stack.cc:72
72	  curl_multi_cleanup((CURLM*)m_handle);
(gdb) l
67	
68	CurlStack::~CurlStack() {
69	  while (!empty())
70	    front()->close();
71	
72	  curl_multi_cleanup((CURLM*)m_handle);
73	  priority_queue_erase(&taskScheduler, &m_taskTimeout);
74	}
75	
76	CurlGet*
@Auska
Copy link

Auska commented Oct 6, 2024

I have also encountered this problem.

@Amb0s
Copy link

Amb0s commented Dec 10, 2024

I get a similar stack trace in my log files everytime I close the client (without forcing its shutdown) while seeding torrents.

  • OS: Arch Linux
  • tested rtorrent version: 0.9.8
  • curl version: 8.11.0

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

Successfully merging a pull request may close this issue.

3 participants