Ticket #70 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

libtorrent gives invalid argument under OSX

Reported by: cp_future@web.de Owned by: rakshasa
Priority: normal Milestone:
Component: libtorrent Version: HEAD
Severity: major Keywords:
Cc:

Description

Hi there :)

I successfully compiled libtorrent 0.3.5 and rtorrent 0.7.5 under OSX 10.3.9 Unfortunately I get following error after downloading some kilobytes:


kizna:~/Documents/Torrent Vartan$ rtorrent ubuntu-5.10-preview-live-i386.iso.torrent

Caught exception from libtorrent: "Connection read fd(21,2,7) "MemoryChunk::advise(...) Invalid argument""


Restarting rtorrent fails, I'm always getting:


Caught exception from libtorrent: "MemoryChunk::advise(...) Invalid argument"


Only solution: Removing torrent :(

Attachments

osx_103.diff (0.7 KB) - added by rakshasa 4 years ago.
Ignore the return value

Change History

Changed 4 years ago by anonymous

  • version set to HEAD
  • severity changed from normal to major
  • milestone set to 0.8 Sodden Squirrel

Changed 4 years ago by rakshasa

I've gotten other reports about this and i wasn't able to obtain the information needed. Debugging this will require using gdb or applying a patch that prints out the interesting parameters. I'll look into writing one asap.

Changed 4 years ago by rakshasa

Having looked at the debugging information provided by another user, I think it's likely that the compiler is producing bad code. Not entirely sure but a variable that should have been pointing at the memory location for the file data chunk was instead directed at some code. This had the correct value when accessed later to print it out.

Changed 4 years ago by rakshasa

Ops, mixed up the bug reporters, the debugging information was provided by the reporter of this ticket. ;)

Changed 4 years ago by rakshasa

What looked like a compiler bug was infact a gdb bug, and thus not related to this error.

The most likely cause seems to be MacOSX's madvise system call failing with what should be valid arguments.

Changed 4 years ago by rakshasa

Ignore the return value

Changed 4 years ago by rakshasa

  • status changed from new to closed
  • resolution set to fixed

Ok, problem solved.

MacOSX 10.3 has a bug in the handling of madvise, causing it to return an error when it shouldn't. Attached a patch to fix it. Also set "hash_max_tries = 1".

Add/Change #70 (libtorrent gives invalid argument under OSX)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.