-
Notifications
You must be signed in to change notification settings - Fork 65
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
Suspicion: QMS crashes if BRouter RD5 file is missing #624
Comments
I can not reproduce it. Without .rd5 files: With .rd5 files: error: I am testing on:
|
@mitxel-m: Thanks for testing. In this case, one more of these old and unidentified mouse-related crashes happening only on Windows and making the use of BRouter very difficult. |
Just one piece of information more: the crash happens only if |
Tried it myself on Linux. No crash. The error message gets displayed as expected. That's all |
I run an AutoIt script with the help of which I can reproduce the crash. Here are the steps (a sleep after each step is included but not shown here, routing data is available):
Using the mouse or the touchpad: same crash. |
Any chance to run it in MS's debugger to get a backtrace? |
Maybe, this helps to understand the stable crash: I took the parameters used when starting java from within QMS, called with them java from a commandline and got:
Java version:
@kiozen: Backtrace possible, but not helpful: crash most likely happens not in QMS but in BRouter environment. Compare backtrace in issue #388 and lenghty discussion there. |
If that is the same issue and the backtrace from #388 is correct I would say the exception is not caught as expected. It should be handled in the catch block. On the other hand side in the catch block another exception is thrown. I couldn't see where it is caught. To circle down the problem:
|
Some more debuging info from line 328: the
The
No idea where this exception is caught. |
More debugging info:
Wherefrom is this method called? |
Debugging with VisualStudio:
|
Can you test the fix in the PR. The fix is handling the exception properly |
A crash is still there but I don't understand yet what happens when trying to debug. |
Call stack for crash:
(On-the-fly routing, add new track, start and end points not on a road, crash when moving to endpoint, not yet clicked at endpoint) |
@kiozen, @ntruchsess: More info: Just before crashing the |
There is an additional mutex unlock that might cause problems. Please update
|
I don't think this 'additional' mutex unlock can cause issues as both calls to unlock are actually not 'additional' but mutually exclusive. Either the mutex is unlocked within the catch-block (then the method is left throwing the error-message) or the it is unlocked below the catch-block. But it is never unlocked twice. If there are any doubts regarding the unlock of mutex I suggest to use QMutexUnlocker: https://doc.qt.io/qt-6/qmutexlocker.html |
I just tried to go save and use qmutexlocker but it causes issues with responsitiveness as it blocks the UI-thread. |
@kiozen, @ntruchsess: Updated QMS-624. Crash after described actions in QMS GUI but different call stack:
|
This is getting more and more weird. Are you sure you have all libraries compiled/installed properly? It's always a problem to compile an app with version X of the library but at runtime it uses version Y. Maybe we are hunting ghosts here. |
it is compatible. clear() removes all elements. size() then returns 0. I just noticed that it would be better to not return 0 in this case (0 is interpreted as 'valid response but no routing-points determined) but -1 (which means 'no reponse'). While this is completely unrelated to the crash you are experiencing it would result in slightly (if not negligible) less cpu-usage processing the routing result. |
Is there a way to check this? |
Not sure if there is a better way in Windows. But you should make sure there is no Qt path in the $PATH environment variable. Or at least no QT path that you do not intend to use. |
@kiozen I identified a potential race on accessing the field 'synchronous'. As delivery of signals is asynchronous slotRequestFinished might run after the field 'synchronous' has been set to false within the synchronous request processing. If this happens the asynchronous logic would run unlocking the mutex a second time. let's see whether this makes a difference. |
ok, as it is still crashing I suppose the use of QMutex on Windows just doesn't work (or may 'just doesn't work on @wthaem 's machine'). |
QMutex should work as expected on any platform. This is Qt. |
I agree, it should work the same on Windows (and I' pretty sure it's not faulty as Canvas+IDrawContext does use it and wouldn't work at all if locking/unlocking were prone to crash). |
Describe the bug
Suspicion: QMS crashes when trying to add a new track with BRouter on-the-fly routing with endpoint not in a routing database file (rd5 file).
What have you done to circle down the problem?
See next point
To Reproduce
rd5
filesAdd track
from context menuExpected behavior
No crash
Screenshots
None
Attachments
N.A.
Tracebacks
None
Desktop
Additional context
This crash is different from the one caused by rapid mouse move while selecting a routing point located in an existing
rd5
file. The likelihood of that one can be decreased by reducing the mouse speed in the OS mouse settings.The text was updated successfully, but these errors were encountered: