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

0.21.0 crashes macOS #1699

Closed
ylluminarious opened this issue Sep 17, 2019 · 8 comments
Closed

0.21.0 crashes macOS #1699

ylluminarious opened this issue Sep 17, 2019 · 8 comments

Comments

@ylluminarious
Copy link

What version of this package are you using?

0.21.0

What operating system, Node.js, and npm version?

macOS 10.14.6

What happened?

I ran Webtorrent 0.21.0 and my system got slower very quickly. Eventually it became totally unresponsive and soon the whole system shut down and restarted. This happened twice, both times after I ran Webtorrent. I even ran App Tamer the second time just to try and limit any excessive CPU usage, but it still crashed my system.

I have a kernel panic report on my screen which says, among other things:

      Kernel Extensions in backtrace:
         com.apple.driver.AppleIntelCPUPowerManagement(220.0)[6703E7B6-EE67-3019-A4D7-5D5B239486AB]@0xffffff7fa00cb000->0xffffff7fa00f3fff

So it apparently has something to do with excessive CPU usage.

What did you expect to happen?

I thought that since Electron was upgraded, this problem was fixed.

Are you willing to submit a pull request to fix this bug?

I do not have sufficient time nor knowledge of this project.

@feross
Copy link
Member

feross commented Sep 18, 2019

Hi @ylluminarious, thanks for the report.

Can you try to reproduce this error once more? But before the crash happens, when the app starts to get unresponsive, click View > Developer > Developer Tools, select the Console tab and copy-paste all the text into a new comment here.

If you don't see any errors, then please check in one more place! Click View > Developer > Show WebTorrent Process, select the Console tab and copy-paste all the text.

Being able to see that output would help us out very much. Thanks.

@ylluminarious
Copy link
Author

@feross Thanks for the feedback. However, I would like to avoid crashing my system again. Even though APFS is supposed to be crash-resistant, I do not completely trust it 100%. I have seen it fail and have problems in some instances, so I really want to avoid possibly corrupting my file system or causing similar issues.

I will therefore try it in a VM instead, and see if I can reproduce it there. If I cannot, then I might try it on my actual system again, but I really want to avoid that if at all possible.

@feross
Copy link
Member

feross commented Sep 18, 2019

@ylluminarious Totally understand. Thanks for any additional info you can provide.

@ylluminarious
Copy link
Author

@feross I tested this again on 0.24.0 and I was shocked to see my computer crash again. Now I believe it has to do with the amount of files I was seeding. There were 70+ files seeding and I think this contributed to the excessive CPU usage. I finally decided to longer seed these files in WebTorrent I just moved them into another folder, so WebTorrent couldn't find them anymore. After I did this, WebTorrent no longer crashed on startup. I then removed all these files from WebTorrent's main window. You should probably add a warning to the program that seeding too many files can cause your computer to crash.

@feross
Copy link
Member

feross commented Oct 28, 2020

@ylluminarious Thanks for the feedback. Yeah, it's a known issue that too many torrents can cause 100% CPU.

@ylluminarious
Copy link
Author

@feross Right, I know that too many torrents is a bad idea. I just never would have thought it could cause the entire system to panic and crash so abruptly. It occurred within about 5 seconds of starting the program, and the entire OS went down without a warning. My computer just shut off like a power outage had occurred (evidently a kernel panic).

A kernel panic should not result from a program like this... I'm not sure if it's Electron's fault or what. I could understand if just WebTorrent crashed, but something's very wrong for an application like this to cause such a severe, systemwide crash. I think you should look into whether Electron, or whatever other underlying frameworks, have any bugs that are known to cause KP's during high CPU usage or whatever the issue is. I think it's worth warning users that their entire system could crash, not just the program, as a result of this. AFAIK, no other BitTorrent clients have this same issue. I've seen Transmission open with hundreds of torrents and it never caused a KP.

@feross
Copy link
Member

feross commented Nov 4, 2020

We cap each torrent to 60 TCP connections (which is probably a bit too high). And there's no global limit. So if you add dozens or hundreds of torrents you can easily get to 1000s of TCP connections, which could grind some systems to a halt. We'd like to fix this at some point.

@github-actions
Copy link

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants