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

aria2c crash while downloading BitTorrent task #478

Closed
bigcat26 opened this issue Nov 12, 2015 · 9 comments
Closed

aria2c crash while downloading BitTorrent task #478

bigcat26 opened this issue Nov 12, 2015 · 9 comments

Comments

@bigcat26
Copy link

Program received signal SIGBUS, Bus error.
__memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:33
33      ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory.(gdb) 2
Undefined command: "2".  Try "help".
(gdb) bt
#0  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:33
#1  0x00000000005de95e in memcpy (__len=<optimized out>, __src=<optimized out>, __dest=0x7fffffffd0b0) at /usr/include/x86_64-linux-gnu/bits/string3.h:51
#2  aria2::AbstractDiskWriter::readDataInternal (this=this@entry=0xa13160, 
    data=0x7fffffffd0b0 "ٍٍ\nP\333\350\flt\216\327\364\061\017\206=\263\300Afkg\270\067q\227#'\332\026\257\215|Q\247\032\252\275q\275\327\334\361G\357\b\026\bWy\233S\024\364j\234\035ȁ\244\231\334\357\265{\342\357zF脡y\337Q\177\235\252P\304\065\272\066\t\017bH1F8\254\066ɇ", len=4096, offset=<optimized out>) at AbstractDiskWriter.cc:293
#3  0x00000000005de9d4 in aria2::AbstractDiskWriter::readData (this=0xa13160, data=<optimized out>, len=<optimized out>, offset=<optimized out>) at AbstractDiskWriter.cc:428
#4  0x000000000050f814 in aria2::(anonymous namespace)::updateHashWithRead (mdctx=0x10130d0, adaptor=..., offset=660664320, offset@entry=654311424, len=<optimized out>) at Piece.cc:252
#5  0x000000000050ffcf in aria2::Piece::getDigestWithWrCache (this=0xa54ab8, pieceLength=<optimized out>, adaptor=...) at Piece.cc:279#6  0x00000000005ede5f in aria2::BtPieceMessage::checkPieceHash (this=this@entry=0x5443d80, piece=...) at BtPieceMessage.cc:255
#7  0x00000000005ee56b in aria2::BtPieceMessage::doReceivedAction (this=0x5443d80) at BtPieceMessage.cc:143
#8  0x00000000005bfc3a in aria2::DefaultBtInteractive::receiveMessages (this=this@entry=0xac9e60) at DefaultBtInteractive.cc:312
#9  0x00000000005c18bd in aria2::DefaultBtInteractive::doInteractionProcessing (this=0xac9e60) at DefaultBtInteractive.cc:556
#10 0x0000000000562afa in aria2::PeerInteractionCommand::executeInternal (this=0x539f010) at PeerInteractionCommand.cc:346
#11 0x0000000000560033 in aria2::PeerAbstractCommand::execute (this=0x539f010) at PeerAbstractCommand.cc:105
#12 0x00000000004e7238 in aria2::(anonymous namespace)::executeCommand (commands=..., statusFilter=statusFilter@entry=aria2::Command::STATUS_ACTIVE) at DownloadEngine.cc:139#13 0x00000000004e73c5 in aria2::DownloadEngine::run (this=0x8c33f0, oneshot=oneshot@entry=false) at DownloadEngine.cc:177
#14 0x0000000000436043 in aria2::MultiUrlRequestInfo::execute (this=0x8c39c8) at MultiUrlRequestInfo.cc:354#15 0x000000000040c342 in aria2::main (argc=argc@entry=1, argv=argv@entry=0x7fffffffe688) at main.cc:78
#16 0x000000000040c3b8 in main (argc=1, argv=0x7fffffffe688) at main.cc:91
@tatsuhiro-t
Copy link
Collaborator

Could you tell us about configuration/options and public torrents when this crash happened?
Are you experiencing this issue every time when you are downloading torrent?

tatsuhiro-t added a commit that referenced this issue Nov 12, 2015
Without file allocation, we cannot map file because file length could
be zero.

This could fix bug reported at GH-478
@bigcat26
Copy link
Author

thank you for the quick reply.
This problem occurs more frequently when I download big files (with BT or magnet).
My computer is running ubuntu 14.04 x86_64, kernel version 3.16.0-52.
partition format of download dir: ext4

configuration as follows:

RPC Setting

enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true
rpc-listen-port=6800
#rpc-user=rpc_user
#rpc-passwd=rpc_passwd
rpc-save-upload-metadata=true

session

continue=true
input-file=/root/.aria2/aria2.session
save-session=/root/.aria2/aria2.session
save-session-interval=60

general settings

dir=/root/.aria2/downloads
log=/root/.aria2/aria2.log
log-level=warn
#event-poll=select
disk-cache=256M
enable-mmap=true
file-allocation=falloc
peer-id-prefix=-UT2210-
user-agent=uTorrent/2210(25130)
disable-ipv6=true

connection settings

max-connection-per-server=5
max-concurrent-downloads=5
min-split-size=1M
split=5
max-overall-download-limit=0
max-overall-upload-limit=30K
max-upload-limit=30K
lowest-speed-limit=0
auto-save-interval=60
check-certificate=false

BT settings

listen-port=53160
bt-enable-lpd=true
bt-require-crypto=true
bt-max-peers=200
bt-max-open-files=100
bt-request-peer-speed-limit=100K
enable-peer-exchange=true
enable-dht=true
dht-listen-port=53160
dht-file-path=/root/.aria2/aria2.dht
follow-torrent=true
follow-metalink=true
force-save=true
bt-seed-unverified=true
bt-save-metadata=true
bt-hash-check-seed=true
bt-remove-unselected-file=true
bt-stop-timeout=900
check-integrity=true

@tatsuhiro-t
Copy link
Collaborator

Thank you.
You mentioned this issue occurs when downloading big files. Could you tell us the file size which crashes aria2?

@bigcat26
Copy link
Author

I was running 4 BT tasks, 1GB, 4GB, 7GB and 24GB(multiple files), the largest file is a 7GB zip.
I don't know which task cause the crash exactly.
After I wrote down last comment I changed the configuration "enable-mmap" from "true" to "false" and run aria2 again, works fine so far.

@bigcat26
Copy link
Author

PS:
Before I open this issue, I compiled aria2 myself instead of install by apt-get, to get the crash backtrace. git commit: af98861

root@E8400:~/work/aria2/aria2# aria2c -v
aria2 version 1.19.2
Copyright (C) 2006, 2015 Tatsuhiro Tsujikawa

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

** Configuration **Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC, SFTP
Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5, adler32
Libraries: zlib/1.2.8 libxml2/2.9.1 sqlite3/3.8.2 GnuTLS/2.12.23 nettle GMP/5.1.3 c-ares/1.10.0 libssh2/1.4.3
Compiler: gcc 4.8.4
built by x86_64-unknown-linux-gnu on Nov 12 2015 16:01:43
System: Linux 3.16.0-52-generic #70~14.04.1-Ubuntu SMP Tue Oct 20 18:24:26 UTC 2015 x86_64

@tatsuhiro-t
Copy link
Collaborator

Thank you. Yes, this is definitely mmap related.
I could not reproduce this so far. If file size is changed by external program, it is a cause of the crash, but without that I could not still figure out why aria2 accessed region which is not memory mapped.

@tatsuhiro-t
Copy link
Collaborator

3974c12 may reduce the possibility of this issue happening, but I'm not sure about that.

@bigcat26
Copy link
Author

Is that possible if insufficient disk space or bad track may cause the crash?
Anyway, disable mmap does works. Shall I close the issue?
Thanks for your help.

@tatsuhiro-t
Copy link
Collaborator

Yes, insufficient disk space could cause this bus error.
I thought that --file-allocation=falloc fully allocates required disk space, but it seems it is not the case here.
We have no way to handle this error with mmap. For normal disk write, we can know it from error code, but with mmap, the process exits with bus error, which does not leave us any method to continue the operation. I think we can close this issue as wont-fix, and the workaround is not to use --enable-mmap if disk space is not fully allocated.

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

2 participants