OpenBVE
OpenBVE copied to clipboard
[Bug] Switching route in quick succession would crash in the main menu
Description
Sometimes, switching between 2 routes very quickly in the main menu. (Easier done in the "Recently Used" tab) would cause an error.
Reproduction
- Launch OpenBVE
- In the route tab, go to the "Recently Used" tab.
- Click 2 route in very quick succession
- Witness crash
Logs
OpenBVE Crash- 2023.7.30[21.25].log
Related information
- Operating system: Debian 12 (Bullseye)
- Method of control: Keyboard
- OpenBVE Version: Latest Nightly Build
Hmm...
I can't reproduce this at the minute. I'd suspect it's going to be timing related, and the fact that this is a pretty well specced machine doesn't help in that regard. The crash is being caused when it attempts to load the plugins, so I'm wondering if this is a thread timing issue. The commit may help.
Still the same crash on the latest Nightly build (I believe it is v1.7.1370.1061)
Another tweak for the build from today.
I'm not absolutely convinced (the original code re-loaded the entire plugin stack) that this will be problem free, but see if that helps.
Interesting, the problem still exist under mono, but doesn't occur on Windows, so I think this is a mono specific issue?
Probably but without reproducing it I don't know specifically. Unfortunately, the Mono forms implementation is (as I think you know) now essentially abandoned.
Not sure this is worth digging into too much further, especially as I can't reproduce :(
Probably not, or at least it seems to only happen on specific configuration and probably won't affect the masses.
I'll leave this issue opened just in case though.
Didn't reproduce on my Ubuntu 20.04 + this version of mono. How about trying Debian 12's to this mono version to match?
user@20230802$ mono --version Mono JIT compiler version 6.12.0.200 (tarball Tue Jul 11 21:33:00 UTC 2023) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: yes(610) Suspend: hybrid GC: sgen (concurrent by default)
Hmm I can reproduce this under Wine as well, now that's interesting, I don't think there's any specific configuration that could cause this.
Starting to think of if it's route related, I used a route with over 10K signal sections and it would take a good few second to load. But that doesn't explain why it won't crash on Windows as well
I'd agree with the route related, but only in the sense it'll be hanging up the timing somewhere. Larger routes will be by definition slower to load & more prone.
10k signal sections is somewhat excessive, and I'm not surprised it causes slowdowns.
Nope it seems to happen regardless of route. After tinkering around, the only conclusion I can come up with is that I cancelled the route loading (switch route) before the all the content plugin could be fully loaded.
The same crash should also happen on Windows if you add something like a Thread.Sleep(2000) on LoadPlugins(). Why can I never get it to crash under normal circumstances is beyond me, maybe it's timing related.
I think we should download and verify this TFO sample route to switch the exact same data to each other to reproduce the bug. Actually, there is no problem in my environment and leeser3's, only one person does not move, is it? https://bveworldwide.forumotion.com/t2301-animating-an-overtaking-train#21357 Conversely, it means that we can't reproduce it without sample data that causes the crash. At that point it ceases to be 'everything'.
Ok I've downloaded the TFO sample route and reproduced it under Wine 8.0.2
https://github.com/leezer3/OpenBVE/assets/28094366/c3504bd6-9c93-43e9-bf58-36d245de3e50
(Still the same crash log)
The video was very helpful! When I switched the TFO sample route at the same speed, I got the same error as you, so I was able to reproduce it. You have to press it pretty quickly. I pushed it slowly.
Reproducible under Windows, just have to be really quick about it.
(Both hand, Mouse Click + Arrow Down immediately should be easier to reproduce)
Still not at the minute :(
Will try a slower machine at some point, but that trigger is almost enough to ignore:/