-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Segmentation fault after some time with "Corrupted Double-Linked List" #7769
Comments
Same error occurs with qBittorrent after importing torrents from Deluge. Some torrent data is probably triggering this but I don't know how to find which one specifically is the cause or why. All torrents were completed and seeding for some time when the bug started to occur. Many torrents use a non-latin character script in their naming. Maye there is a corrupted file? But how to find which one, and is there a better way for libtorrent to deal with corrupted files without breaking the whole functioning of the program? |
If you could build with debug symbols and trigger the address sanitizer error, it would probably be very helpful. It's virtually impossible for me to reproduce your build to resolve those addresses. |
I think I will need a hint on how to proceed. I've compiled libtorrent with cflag -O0 -ggdb -fsanitize=address, and ldflags -fsanitize=address, also cmake flags -Ddebug-symbols=ON. The program still fails, but this time with exit code 1 and no segmentation fault. There is no coredump file, and I can't backtrace because the process ended cleanly. Also trying to put breakpoint on exit didn't prevented it from exiting. I've tried to generate a core file with gcore pid_of_proccess, but the file quickly reached several terabytes and I had to force quit. |
On gdb I've just tried a different break approach: catch syscall exit exit_group, it breaks at the error point but then trying to create a coredump with generate-core-file produces an absurd sized file, forcing me to quit before it fill the the whole disk. |
Package generator was stripping binaries, I fixed that now. Here is what I got from gdb's backtrace running deluged with libtorrent compiled with sanitized address and debug symbols. It appears to be related to the socks5 proxy mechanism:
Some frames:
|
Without sanitizer errors goes different and cause segfault, still appears related to socks5:
Some frames:
|
it's not so easy to figure out what's going on unfortunately. Maybe the whole socket object is destructed but then still had an async operation issued. That might explain the asio address sanitizer issue. The assert is likely an earlier symptom of the same problem. It's not obvious how that can happen either, unless the socket is closed (and |
perhaps, when the assert fires, |
libtorrent version (or branch):
Version 2.0.11 from this commit 24e658a
platform/architecture:
Linux x86_64
compiler and compiler version:
gcc 14.2.0
please describe what symptom you see, what you would expect to see instead and
how to reproduce it.
Running libtorrent from Deluged, it crashes after some time with "Corrupted Double-Linked List". Dmesg reports
deluged[9861]: segfault at 7f010000000f ip 00007fba1c6a7427 sp 00007ffc38d91810 error 4 in libc-2.40.so[a7427,7fba1c628000+17c000] likely on CPU 2 (core 2, socket 0)
. No torrent were added or removed during the process, but it is already managing around 300 torrents, some paused, some active.Starting program:
/usr/bin/python3 /usr/bin/deluged -d
This is a backtrace of crashing
Compiling with AddressSanitizer, I get this log:
I should mention that it used to work as expected but I noticed this error for the first time after changing several connections settings, I don't know if it is related or incidental. My system is a rolling-release type, between the last time it worked correctly and first time this error occurred there were several updates but I guess none seems related to dependencies of libtorrent. I also tried compiling different commits up until the official stable release, but no luck.
The text was updated successfully, but these errors were encountered: