EasyScience / EasyDiffractionApp

Diffraction data analysis application
https://easydiffraction.org
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Intermittent program crash on multiple fits #35

Closed rozyczko closed 2 years ago

rozyczko commented 3 years ago

BUG

rozyczko commented 3 years ago

I have run multiple continuous fits with all engines, never getting a crash. Windows 10, develop branch

AndrewSazonov commented 3 years ago

This bug seems not reproducible or, let's say, half reproducible on MacOS 10.13.6 (easyAppGui: develop branch, easyDiffractionApp: fit_stop branch). I launch easyDiffraction via Poetry/PyCharm, load the PbSO4 project, go to the analysis page, select 1 parameter to refine (lattice constant a) and click the start fitting button. Approximately 50% of the time the fitting is finished properly, but in the other 50% of the time the application crashes with a message: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).

rozyczko commented 3 years ago

Windows 10, easyAppGui and easyDiffractionApp branches the same as yours, launching from both poetry run easyDiffraction and from within visual studio code, load PbSO4 and performed the same set of fits. None of them failed. Changed parameters, switched to another Windows machine with the same result.

Reminds me the previous issue of windows start failures which would not show up on my dev machines but only on a clean setup.

I'll try next on a clean Windows VM, installing the pre-release package

rozyczko commented 3 years ago

Same on a clean Windows VM - no crashes with the most recent row_scroll branch installer

Seems therefore to be a MacOS specific issue

rozyczko commented 3 years ago

Tested on bare metal mac mini (192.168.1.40) on installed version from the develop branch. As noticed by @AndrewSazonov , the app fails every other/third time fitting is run. This means it is a mac os specific issue. First thing to check if threading. I'll create a build based on the develop source but without threading and test it on the VM

rozyczko commented 3 years ago

The problem does seem to originate with threading after all. The non-threaded version of develop works just fine on the test mac.

As mentioned, everything works on Windows, but occasionally, when closing the app I see QThread: Destroyed while thread is still running which means some threads haven't been properly terminated. This seems to be benign on Windows but might cause issues (as it should!) on MacOS.

rozyczko commented 3 years ago

Most recent commit in fit_stop seems to have fixed the issue. Please test the installer from that branch. fit_stop also contains code/functionality for stopping the fitting thread - it would be extremely useful to have this in the release.