Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4496 closed Bug (fixed)

Freeze when having a huge torrent

Reported by: MechMK1 Owned by: jordan
Priority: Normal Milestone:
Component: Transmission Version: 2.33+
Severity: Normal Keywords:
Cc:

Description

On Transmission 2.40b1 and nightly-build #4728 the program freezes when a huge torrent (~1 TB in 4.014 files) was already existing in a preverious version (in my case 2.32). The entire UI freezes on startup and does not write any log files. When removing the drive the torrent is downloaded to, Transmission behaves normal.

Attachments (3)

Transmission_build-#4730 .zip (31.7 KB) - added by MechMK1 10 years ago.
Transmission report build #4730
Transmission_build-#4731.zip (35.7 KB) - added by MechMK1 10 years ago.
Transmission report build #4731
Transmission_build-#4732.zip (42.4 KB) - added by MechMK1 10 years ago.
Transmission report build #4732

Download all attachments as: .zip

Change History (24)

comment:1 follow-up: Changed 10 years ago by livings124

If you revert to 2.33 what's the behavior?

comment:2 in reply to: ↑ 1 Changed 10 years ago by MechMK1

Replying to livings124:

If you revert to 2.33 what's the behavior?

On 2.32 everything works fluently. No crashes, no delays

comment:3 Changed 10 years ago by livings124

Can you post a crash log from 2.40b? How does 2.33 behave?

Last edited 10 years ago by livings124 (previous) (diff)

comment:4 Changed 10 years ago by livings124

  • Version set to 2.33+

comment:5 Changed 10 years ago by MechMK1

Sorry, neither in ~/Library/Logs/?, nor a subdirectory of it, nor in the log-database querry were any logs of relevance (only disk5 ejected 2 months ago, so irrelevant to this problem)

comment:6 Changed 10 years ago by jordan

Does 2.33 show the freeze behavior that you're seeing in 2.40b1?

comment:7 Changed 10 years ago by MechMK1

Not at all. Everything works fine

comment:8 Changed 10 years ago by jordan

I have a suggestion that has a couple of setup steps but is otherwise painless: Apple has a free tool named "Shark" that can monitor applications to where they're spending (wasting? :) their time. If this freeze is easy for you to trigger, would it be possible for you to generate a Shark report on it?

https://trac.transmissionbt.com/wiki/Shark has a step-by-step walkthrough of exactly how to do this, including downloading Shark from Apple, how to run it, and what to do with its output.

comment:9 Changed 10 years ago by MechMK1

Here is the report. It took some time to get Shark working since Apple removed it in XCode 4

http://pastebin.com/5UJkacUM

comment:10 Changed 10 years ago by jordan

  • Milestone None Set deleted
  • Owner set to jordan
  • Priority changed from High to Normal
  • Status changed from new to assigned

Thanks for the report, MechMK1 -- sometimes these reports are hit-and-miss, but the one you attached is a hit. :)

It looks like some of our debug assertions (which are disabled in final releases) are getting called so often that they're running away with the CPU. IMO this is excessive even for a debug build.

The main issue seems to be in the the tr_bitfieldIsValid() assertion. A few callers stand out from the rest of the pack:

+ 98.9%, countArray, Transmission
| + 87.8%, tr_bitfieldIsValid, Transmission
| | + 29.5%, tr_bitfieldAdd, Transmission
| | | + 21.1%, tr_cpCreatePieceBitfield, Transmission

and

| | + 29.1%, tr_bitfieldEnsureBitsAlloced, Transmission
| | | + 29.1%, tr_bitfieldAdd, Transmission
| | | | + 21.1%, tr_cpCreatePieceBitfield, Transmission
| | | | | + 21.1%, tr_peerMsgsNew, Transmission
| | | | | | + 21.1%, myHandshakeDoneCB, Transmission

...and a couple more call paths to each of those again, bringing their total up to over 60%.

I'm going to lower the priority of this ticket since these assertions will be disabled in the final release, but agree that this is a problem that should be fixed.

comment:11 Changed 10 years ago by jordan

I've checked in a "first draft" fix of this in r12902. It seems to work here in the situation you're describing. MechMK1, you might want to try a "nightly build" from <https://build.transmissionbt.com/job/trunk-mac/> of r12902 or higher to see if this resolves the problem for you.

comment:12 Changed 10 years ago by MechMK1

Better, but still not fixed. CPU-usage now varies from 20 % up to 100 %, which means it freezes for a second, works fluently for some seconds, freezes again for a second or two and so on.

comment:13 Changed 10 years ago by livings124

Can you generate another report for the new build?

Changed 10 years ago by MechMK1

Transmission report build #4730

comment:14 Changed 10 years ago by MechMK1

I added it as attachment within a .zip file since it was larger than 500 kilobytes (.zip should be about 33 kilobytes)

comment:15 Changed 10 years ago by jordan

Thanks for the update, MechMK1.

A "Second draft" is now available in r12904. Want to try again?

By the way, I'm testing with a pretty big torrent, but it's nowhere near 1 TB in size. If the torrent you're using is in the public domain, could you mail me a link (or the .torrent file) to jordan @ this domain name? I'd like to add it to the set of torrents that I torture Transmission with :)

comment:16 Changed 10 years ago by jordan

Also, even if this second draft runs well for you, could you attach a Shark report anyway so that I can see what the overall change was on OS X? Thanks!

Changed 10 years ago by MechMK1

Transmission report build #4731

comment:17 Changed 10 years ago by MechMK1

r12904 worked better than the preverious version, but still lags when scrolling and (re-)drawing the window. Also, the speed indicator in Dock.app disappears every 7th redraw, while the overall speed remains about 2 MB/s (which is clearly an application bug)

The Shark.app report is attached in another .zip file

comment:18 Changed 10 years ago by jordan

r12905 addresses the hotspot shown in your Transmission_build-#4731.zip log. How does it look now?

Changed 10 years ago by MechMK1

Transmission report build #4732

comment:19 Changed 10 years ago by MechMK1

r12905 worked perfectly now, but I still added a Shark-report just in case.

comment:20 Changed 10 years ago by jordan

  • Milestone set to 2.40
  • Resolution set to fixed
  • Status changed from assigned to closed

The Shark report looks good too. Thanks very much for the help MechMK1!

comment:21 Changed 10 years ago by livings124

  • Milestone 2.40 deleted
Note: See TracTickets for help on using tickets.