Closed uponatime2019 closed 2 months ago
Unexpected main loop exception: System.NullReferenceException: Object reference not set to an instance of an object. at MonoTorrent.Client.PeerExchangeManager.Populate(Int32 stride, Int32 maxPeers, Queue
1 addedPeers, Queue
1 droppedPeers) in C:\Projects\monotorre> at MonoTorrent.Client.PeerExchangeManager.OnTick() in C:\Projects\monotorrent\src\MonoTorrent.Client\MonoTorrent.Client\Managers\PeerExchangeManage> at MonoTorrent.Client.Modes.Mode.PostLogicTick(Int32 counter) in C:\Projects\monotorrent\src\MonoTorrent.Client\MonoTorrent.Client.Modes\Mode.cs:li>
Hrm, that's interesting! Fortunately there's line numbers in the stacktrace - so could you just confirm which version of the package you're using and i'll see if i can find why that's happening!
Ah - whoops! The output is truncated on some lines so i'm missing the important line number(s)! If this happens again, can you increase the width of your terminal window (or wherever you got the stacktrace from) and get the full line for the top 2 stack frames. Specifcally, which line did this error occur on:
at MonoTorrent.Client.PeerExchangeManager.Populate(Int32 stride, Int32 maxPeers, Queue
1 addedPeers, Queue
1 droppedPeers) in C:\Projects\monotorre>
The output I included have line numbers already. It's happen at the latest version on Nuget (3.0.x)
@uponatime2019
Look at the stacktrace frames from 'PeerExchangeManager' - both of them are truncated and don't have the line number at the end.
The last few lines in the stacktrace (the shorter lines from MonoTorrent.Client.ClientEngine
or MonoTorrent.Client.MainLoop
) have the full line number information as they're not truncated.
There are no obvious/plausible null references in the PeerExchangeManager code so i'm a little confused as to what's happening, and the line number would be super useful
Sorry it always crash, with the Os is Ubuntu 20, not happen in Windows. And that's I got when look at journalctl
After that I downgrade library to version 2.0.x and it run OK in both Linux and Windows
I'm not sure if that particular patch will fix the issue, but the lack of obvious null refs combined with actual improper multi-threaded access seems like it could plausibly be the root cause!
If you can build from master i'd be curious to know if that fixes the issue. Otherwise i'll do another nuget release soon :)
@uponatime2019 Can you let me know if release 3.0.3-alpha.unstable.rev0049
fixes the issue you saw?
I'm downloading +50 torrents at a time, program crash everytime it run 2-3 mins (ubuntu 20). I put everything in try catch but this still happen