Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5417 closed Bug (fixed)

2.80 + (14116) crashes (assertion failure) when stop seeding ratio is set to 0,00

Reported by: attie Owned by: livings124
Priority: Normal Milestone: 2.81
Component: Mac Client Version: 2.80
Severity: Normal Keywords:
Cc:

Description

Under Mac OS X 10.6.8, since release 2.80, when "Stop seeding at ratio:" is selected and the ratio is set to 0.00, Transmission will crash upon completion of a torrent.

Trying nightly build 14116, the crash log says: Assertion failed: (tr_isTorrent (tor)), function tr_torrentStat, file /Users/transmission/jenkins/workspace/trunk-mac/libtransmission/torrent.c, line 1261.

Attachments (1)

Transmission_2013-07-12-190624_Wingfoot.crash (31.9 KB) - added by attie 8 years ago.
Crash log

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by attie

Crash log

comment:1 Changed 8 years ago by x190

attie, do you have Transmission set to auto-remove completed torrents?

comment:2 Changed 8 years ago by attie

Yes, indeed. Just tried without the auto-remove option and then it doesn't crash.

comment:3 Changed 8 years ago by jordan

livings124, this looks like a timing/threading issue in the Mac client. Instead of passing the tr_torrent* pointer back to the main thread in the torrent-completed callback, pass the torrent id from tr_torrentId() instead, and then lookup the tr_torrent* again in the mac thread.

comment:4 Changed 8 years ago by livings124

jordan: would it be possible to make sure the completion callback is called before the ratio limit/idle limit callback is called? It makes sense logically, and would avoid a lot of race conditions in the Mac code.

comment:5 Changed 8 years ago by jordan

livings124: we could do that and it might make this specific ticket go away, but IMO it wouldn't address the root problem: holding onto the completenessChangeCallback's torrent pointer after the callback function ends is inherently unsafe.

The Mac client's code will be safer, and its callback functions will be less coupled to each others' sequencing, if completenessChangeCallback retains the torrent's id and uses that as a lookup in tr_torrentFindFromId() in the main thread.

comment:6 follow-up: Changed 8 years ago by kalkul

I had the duplicate problem (#5416) with 10.8.4 and 10.9 DP3 and crashing stopped after disabling "Remove from the transfer list when seeding completes", so it´s definitely connected...

comment:7 Changed 8 years ago by livings124

jordan: The issue I'm concerned about is that when a torrent finishes downloading, etc., we still want to display a notification with the torrent's info even if it's removed at the same time because of ration settings, etc. The order's important for this scenario.

comment:8 Changed 8 years ago by jordan

livings124, then it's safer in the callback to extract the notification info you need, then to pass that to the main thread and display it.

Still, I said I'd do the rearrangement, so please test r14123 to see if it fixes this ticket for the Mac client...

comment:9 Changed 8 years ago by livings124

r14125 looks good. attle, can you test a build from https://build.transmissionbt.com/job/trunk-mac/ and report back?

comment:10 Changed 8 years ago by x190

Could be wrong, but I'm betting fireCompletenessChange() needs to go before tr_torrentCheckSeedLimit(), like about before the original tr_torrentIsSeed() i.e. Line 2147.

EDIT 1: Looks like you beat me to it with r14125.

EDIT 2: r14125 worksforme on 10.6.8 without crashing on auto-removal and notification order is correct.

Last edited 8 years ago by x190 (previous) (diff)

comment:11 in reply to: ↑ 6 ; follow-up: Changed 8 years ago by kalkul

Replying to kalkul:

I had the duplicate problem (#5416) with 10.8.4 and 10.9 DP3 and crashing stopped after disabling "Remove from the transfer list when seeding completes", so it´s definitely connected…

Version r14125 solved my problems.

comment:12 Changed 8 years ago by jordan

  • Resolution set to fixed
  • Status changed from new to closed

comment:13 Changed 8 years ago by livings124

  • Milestone changed from None Set to 2.81

comment:14 in reply to: ↑ 11 Changed 8 years ago by attie

Replying to kalkul:

Replying to kalkul:

I had the duplicate problem (#5416) with 10.8.4 and 10.9 DP3 and crashing stopped after disabling "Remove from the transfer list when seeding completes", so it´s definitely connected…

Version r14125 solved my problems.

r14125 works for me too. Thanks!

Note: See TracTickets for help on using tickets.