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

Session save blocking #233

Open
Rid opened this issue Sep 6, 2014 · 5 comments
Open

Session save blocking #233

Rid opened this issue Sep 6, 2014 · 5 comments

Comments

@Rid
Copy link

Rid commented Sep 6, 2014

Version: 0.9.4
Libtorrent: 0.13.4
OS: CentOS 6.5 x64

I could not find an open issue for this, so I'm opening a new one. Symptoms are unresponsive SCGI while the rtorrent ui remains responsive. Here is the output from gdb while the issue is occurring:

Thread 3 (Thread 0x7f67ae4b2700 (LWP 31854)):
#0 0x00000034564e9153 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007f67ae933555 in torrent::PollEPoll::poll (this=0x15c0d20, msec=) at poll_epoll.cc:146
#2 0x00007f67ae933d79 in torrent::PollEPoll::do_poll (this=0x15c0d20, timeout_usec=, flags=) at poll_epoll.cc:209
#3 0x00007f67ae96a241 in torrent::thread_base::event_loop (thread=0x15b6ed0) at thread_base.cc:174
#4 0x00000034568079d1 in start_thread (arg=0x7f67ae4b2700) at pthread_create.c:301
#5 0x00000034564e8b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7f6796ed8700 (LWP 32475)):
#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1 0x0000003456809508 in _L_lock_854 () from /lib64/libpthread.so.0
#2 0x00000034568093d7 in __pthread_mutex_lock (mutex=0x728608) at pthread_mutex_lock.c:61
#3 0x00000000004d2c3c in acquire_global_lock (this=0x1631988,

buffer=0x7f6791457db0 "\r\n\r\n\r\n\r\n\r\n1538BDBADF48F3F4DDC2BE2497EEF9F9892535BA\r\n"..., length=3930769) at /usr/local/include/torrent/utils/thread_base.h:183
#4 rpc::SCgiTask::receive_write (this=0x1631988,

buffer=0x7f6791457db0 "\r\n\r\n\r\n\r\n\r\n1538BDBADF48F3F4DDC2BE2497EEF9F9892535BA\r\n"..., length=3930769) at scgi_task.cc:255
#5 0x00000000004d33df in operator() (this=, inBuffer=, length=3178, slotWrite=...)

at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:2024
#6 rpc::XmlRpc::process (this=, inBuffer=, length=3178, slotWrite=...) at xmlrpc.cc:540
#7 0x00000000004d1b50 in rpc::SCgi::receive_call (this=, task=,

buffer=0x7f6790010a00 "d.multicall\r\nmain\r\nd.get_hash=<"..., length=3178) at scgi.cc:174
#8 0x00000000004d2929 in rpc::SCgiTask::event_read (this=0x1631988) at scgi_task.cc:191
#9 0x00007f67ae933860 in torrent::PollEPoll::perform (this=0x15c8b30) at poll_epoll.cc:185
#10 0x00007f67ae933d8e in torrent::PollEPoll::do_poll (this=0x15c8b30, timeout_usec=, flags=) at poll_epoll.cc:219
#11 0x00007f67ae96a241 in torrent::thread_base::event_loop (thread=0x15c7f70) at thread_base.cc:174
#12 0x00000034568079d1 in start_thread (arg=0x7f6796ed8700) at pthread_create.c:301
#13 0x00000034564e8b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f67ae4b47e0 (LWP 31842)):
#0 0x00000034564db055 in __xstat (vers=,

name=0x12cea7d8 "/path/to/some/file.mp3", buf=0x7fff11f5d6f0)
at ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c:38
#1 0x00007f67ae967966 in stat (download=..., object=) at /usr/include/sys/stat.h:457
#2 update (download=..., object=) at ../../../rak/file_stat.h:51
#3 update (download=..., object=) at ../../../rak/file_stat.h:52
#4 torrent::resume_save_progress (download=..., object=) at resume.cc:218
#5 0x00000000004993e8 in core::DownloadStore::save (this=0x15a9220, d=0x962fde0, flags=1) at download_store.cc:145
#6 0x0000000000492671 in operator() (this=0x15a9240) at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_function.h:605
#7 operator() (this=0x15a9240) at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/binders.h:118
#8 count_ifstd::_List_iterator<core::Download*, std::binder1st > > (this=0x15a9240)

at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algo.h:4437
#9 core::DownloadList::session_save (this=0x15a9240) at download_list.cc:90
#10 0x0000000000424b18 in operator() (__functor=, __args#0=, __args#1=)

at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:552
#11 __call&, std::vector > const&, 0> (__functor=,

__args#0=, __args#1=) at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:1137
#12 operator(), const std::vector > > (__functor=,

__args#0=, __args#1=) at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:1191
#13 operator(), const std::vector > > (__functor=,

__args#0=, __args#1=) at command_helpers.h:182
#14 std::tr1::_Function_handler, const torrent::Object::list_type&), object_convert_type(core::DownloadList*)>, void> >::_M_invoke(const std::tr1::_Any_data &, rpc::rt_triple, const torrent::Object::list_type &) (

__functor=, __args#0=, __args#1=)
at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:1654
#15 0x00000000004c2cec in operator() (rawCommand=0x15d8848, target=..., rawArgs=)

at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:2024
#16 _call, const torrent::Object::list_type&)>, rpc::rt_triple, std::vector > > (rawCommand=0x15d8848, target=..., rawArgs=) at command.h:249
#17 rpc::command_base_call_list > (rawCommand=0x15d8848, target=..., rawArgs=) at command.cc:122
#18 0x00000000004c336f in rpc::CommandMap::call_command (this=0x72b860, key=0x15f0948 "session.save", arg=..., target=...) at command_map.cc:171
#19 0x00000000004d01ef in rpc::call_object (command=, target=) at parse_commands.cc:275
#20 0x00000000004c5404 in rpc::CommandScheduler::call_item (this=0x15a83e0, item=0x15f0a00) at command_scheduler.cc:100
#21 0x000000000040f02b in operator() () at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:2024
#22 priority_queue_perform () at ../rak/priority_queue_default.h:98
#23 client_perform () at main.cc:176
#24 0x00007f67ae96a18a in torrent::thread_base::event_loop (thread=0x15b6850) at thread_base.cc:139
#25 0x0000000000412c0f in main (argc=1, argv=0x7fff11f5e828) at main.cc:857

@Rid
Copy link
Author

Rid commented Sep 6, 2014

The SCGI is still frozen, however the stack trace does not show the save function, could this be a continuation of #231?:

Thread 3 (Thread 0x7f67ae4b2700 (LWP 31854)):
#0 0x00000034564e9153 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007f67ae933555 in torrent::PollEPoll::poll (this=0x15c0d20, msec=) at poll_epoll.cc:146
#2 0x00007f67ae933d79 in torrent::PollEPoll::do_poll (this=0x15c0d20, timeout_usec=, flags=) at poll_epoll.cc:209
#3 0x00007f67ae96a241 in torrent::thread_base::event_loop (thread=0x15b6ed0) at thread_base.cc:174
#4 0x00000034568079d1 in start_thread (arg=0x7f67ae4b2700) at pthread_create.c:301
#5 0x00000034564e8b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7f6796ed8700 (LWP 32475)):
#0 0x000000345680ecdc in __libc_send (fd=, buf=, n=, flags=)
at ../sysdeps/unix/sysv/linux/x86_64/send.c:33
#1 0x00000000004d2785 in rpc::SCgiTask::event_write (this=0x1631db0) at scgi_task.cc:203
#2 0x00000000004d2c2a in rpc::SCgiTask::receive_write (this=0x1631db0,
buffer=0x7f6790419b40 "\r\n\r\n\r\n\r\n\r\nCCADE949A092E24587657DE0EB3AFDCD650688AB\r\n"..., length=830397) at scgi_task.cc:253
#3 0x00000000004d33df in operator() (this=, inBuffer=, length=542, slotWrite=...)
at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:2024
#4 rpc::XmlRpc::process (this=, inBuffer=, length=542, slotWrite=...) at xmlrpc.cc:540
#5 0x00000000004d1b50 in rpc::SCgi::receive_call (this=, task=,
buffer=0x7f6790029b1e "d.multicall\r\nseeding\r\nd.get_hash=</valu"..., length=542) at scgi.cc:174
#6 0x00000000004d2929 in rpc::SCgiTask::event_read (this=0x1631db0) at scgi_task.cc:191
#7 0x00007f67ae933860 in torrent::PollEPoll::perform (this=0x15c8b30) at poll_epoll.cc:185
#8 0x00007f67ae933d8e in torrent::PollEPoll::do_poll (this=0x15c8b30, timeout_usec=, flags=) at poll_epoll.cc:219
#9 0x00007f67ae96a241 in torrent::thread_base::event_loop (thread=0x15c7f70) at thread_base.cc:174
#10 0x00000034568079d1 in start_thread (arg=0x7f6796ed8700) at pthread_create.c:301
#11 0x00000034564e8b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f67ae4b47e0 (LWP 31842)):
#0 0x00000034564e9153 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007f67ae933555 in torrent::PollEPoll::poll (this=0x15b9c80, msec=) at poll_epoll.cc:146
#2 0x00007f67ae933dfe in torrent::PollEPoll::do_poll (this=0x15b9c80, timeout_usec=, flags=) at poll_epoll.cc:209
#3 0x00007f67ae96a241 in torrent::thread_base::event_loop (thread=0x15b6850) at thread_base.cc:174
#4 0x0000000000412c0f in main (argc=1, argv=0x7fff11f5e828) at main.cc:857

@Rid
Copy link
Author

Rid commented Sep 12, 2014

Another system (same spec) with SCGI freezing:

Thread 3 (Thread 0x7f273a0f0700 (LWP 32722)):
#0 0x0000003e8e2e9163 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007f273a554555 in torrent::PollEPoll::poll (this=0x102bd20, msec=) at poll_epoll.cc:146
#2 0x00007f273a554d79 in torrent::PollEPoll::do_poll (this=0x102bd20, timeout_usec=, flags=) at poll_epoll.cc:209
#3 0x00007f273a58b241 in torrent::thread_base::event_loop (thread=0x1015ed0) at thread_base.cc:174
#4 0x0000003e8e6079d1 in start_thread (arg=0x7f273a0f0700) at pthread_create.c:301
#5 0x0000003e8e2e8b6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7f27306c2700 (LWP 611)):
#0 0x0000003e8e60ecdc in __libc_send (fd=, buf=, n=, flags=)
at ../sysdeps/unix/sysv/linux/x86_64/send.c:33
#1 0x00000000004d2785 in rpc::SCgiTask::event_write (this=0x10b4970) at scgi_task.cc:203
#2 0x00000000004d2c2a in rpc::SCgiTask::receive_write (this=0x10b4970,
buffer=0x7f2728f0ff20 "\r\n\r\n\r\n\r\n\r\nCA702F870A45F0A1D5643AC88AE906C80C7052EE\r\n"..., length=3189294) at scgi_task.cc:253
#3 0x00000000004d33df in operator() (this=, inBuffer=, length=3178, slotWrite=...)
at /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/tr1_impl/functional:2024
#4 rpc::XmlRpc::process (this=, inBuffer=, length=3178, slotWrite=...) at xmlrpc.cc:540
#5 0x00000000004d1b50 in rpc::SCgi::receive_call (this=, task=,
buffer=0x7f272805c380 "d.multicall\r\nmain\r\nd.get_hash=<"..., length=3178) at scgi.cc:174
#6 0x00000000004d2929 in rpc::SCgiTask::event_read (this=0x10b4970) at scgi_task.cc:191
#7 0x00007f273a554860 in torrent::PollEPoll::perform (this=0x103fb30) at poll_epoll.cc:185
#8 0x00007f273a554d8e in torrent::PollEPoll::do_poll (this=0x103fb30, timeout_usec=, flags=) at poll_epoll.cc:219
#9 0x00007f273a58b241 in torrent::thread_base::event_loop (thread=0x103ef70) at thread_base.cc:174
#10 0x0000003e8e6079d1 in start_thread (arg=0x7f27306c2700) at pthread_create.c:301
#11 0x0000003e8e2e8b6d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f273a0f27e0 (LWP 32718)):
#0 0x0000003e8e2e9163 in epoll_wait () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007f273a554555 in torrent::PollEPoll::poll (this=0x1018c80, msec=) at poll_epoll.cc:146
#2 0x00007f273a554dfe in torrent::PollEPoll::do_poll (this=0x1018c80, timeout_usec=, flags=) at poll_epoll.cc:209
#3 0x00007f273a58b241 in torrent::thread_base::event_loop (thread=0x1015850) at thread_base.cc:174
#4 0x0000000000412c0f in main (argc=1, argv=0x7fffd8ff50d8) at main.cc:857

@rakshasa
Copy link
Owner

The client only supports a single concurrent SCGI connection atm, so you may have a connection that stalls until it times out.

@Rid
Copy link
Author

Rid commented Sep 19, 2014

Is there any timeout on rpc::SCgiTask::event_write? I think it would be useful as the RPC seems to wait indefinitely

@NHellFire
Copy link

For me, rtorrent freezes completely and I have to kill and restart it.

libtorrent v0.13.2
rtorrent v0.9.6
Ubuntu 15.04 64bit

gdb output:

Thread 3 (Thread 0x7f8bb1bab740 (LWP 31161)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f8baff7ccfd in __GI___pthread_mutex_lock (mutex=0x770308 <torrent::thread_base::m_global+8>) at ../nptl/pthread_mutex_lock.c:80
#2  0x00000000004f77e9 in ?? ()
#3  0x00000000004f7b82 in ?? ()
#4  0x00000000004288ad in ?? ()
#5  0x00000000004f0067 in ?? ()
#6  0x00000000004f45d0 in ?? ()
#7  0x0000000000500f99 in ?? ()
#8  0x00000000005023e3 in ?? ()
#9  0x00000000005026eb in ?? ()
#10 0x00000000004f5bca in ?? ()
#11 0x0000000000414668 in ?? ()
#12 0x00007f8bb1053616 in torrent::thread_base::event_loop(torrent::thread_base*) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#13 0x00000000004123a0 in ?? ()
#14 0x00007f8bafbc9a40 in __libc_start_main (main=0x40faf0, argc=1, argv=0x7ffc9a3c5e28, init=<optimised out>, fini=<optimised out>,
    rtld_fini=<optimised out>, stack_end=0x7ffc9a3c5e18) at libc-start.c:289
#15 0x0000000000412ad9 in ?? ()

Thread 2 (Thread 0x7f8ba1583700 (LWP 31186)):
#0  0x00007f8baff832ef in __libc_send (fd=15234, buf=0x7f8afd977b00, n=8901293, flags=0) at ../sysdeps/unix/sysv/linux/x86_64/send.c:31
#1  0x0000000000507155 in ?? ()
#2  0x0000000000507658 in ?? ()
#3  0x000000000050799c in ?? ()
#4  0x00000000005064be in ?? ()
#5  0x0000000000507302 in ?? ()
#6  0x00007f8bb101c3a0 in torrent::PollEPoll::perform() () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#7  0x00007f8bb101c471 in torrent::PollEPoll::do_poll(long, int) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#8  0x00007f8bb10535d4 in torrent::thread_base::event_loop(torrent::thread_base*) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#9  0x00007f8baff7a6aa in start_thread (arg=0x7f8ba1583700) at pthread_create.c:333
#10 0x00007f8bafcafeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f8ba9be4700 (LWP 31162)):
#0  0x00007f8bafcb04f3 in epoll_wait () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f8bb101c2b5 in torrent::PollEPoll::poll(int) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#2  0x00007f8bb101c45c in torrent::PollEPoll::do_poll(long, int) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#3  0x00007f8bb10535d4 in torrent::thread_base::event_loop(torrent::thread_base*) () from /usr/lib/x86_64-linux-gnu/libtorrent.so.19
#4  0x00007f8baff7a6aa in start_thread (arg=0x7f8ba9be4700) at pthread_create.c:333
#5  0x00007f8bafcafeed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

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

3 participants