PhonologicalCorpusTools / SLPAA

5 stars 0 forks source link

[BUG] SLPAA and Ubuntu Device Crashes on Toolbar Selection #250

Closed brdiep113 closed 7 months ago

brdiep113 commented 8 months ago

Describe the bug When selection any option on the top toolbar of SLPAA, the program (and device) crashes! It is likely related to OS issues as this does not seem to be an issue for others who develop on Windows or MacOS.

Sample corpus file Any corpus file

To Reproduce Steps to reproduce the behavior:

  1. Open SLPAA
  2. Open a new corpus/load a corpus
  3. Click on any option on the top panel (Setting, File, Edit, View Location, Analysis Functions]
  4. SLPAA crashes/causes device to restart!

Expected behavior I would expect the program to work and not crash.

Error messages No error message seen as the program and computer immediately freezes.

Screenshots image

Operating system and SLP-AA version

kvesik commented 8 months ago

@brdiep113 Any chance that redirecting stdout & stderr to file actually lets you look back after the fact and see any potential error messages that were in the process of being displayed at the moment when the crash occurs? Eg something like SomeCommand &> SomeFile.txt as seen here?

By the way... thank you very much for entering these Linux-related errors! It is super useful to have people developing on and reporting interactions with different platforms. :)

stannam commented 8 months ago

I cannot replicate this error, using the same environment (Ubuntu 22.04.3 LTS / 'main' branch)

However, SLPAA raises TypeError when selecting these two options from the toolbar:

1. Settings > Preferences...

I think this is a known issue. If I remember correctly, forcing int() for certain parameters in SLPAA settings would resolve this issue.

2. Location > Define locations...

The error arises from the following snippet responsible for removing the (x) button from the 'New Location' tab.

https://github.com/PhonologicalCorpusTools/SLPAA/blob/1d722606241749be92d34785ade7302bafab19c8/src/main/python/gui/location_definer.py#L474-L478

without the code with the code
image image

It turned out to be a simple GUI issue. Since the (x) button can appear on either side, the conditional above locates and kills it by specifying the OS.

Whoever wrote this conditional mistakenly assumed that Linux should always have the (x) button on the left like macOS, but that is not the case at least for Ubuntu 22. See above that Ⓧ is on the right-hand side of a tab Who wrote this code?! 😠 (87c9bd800bf60d79df3c0df78f432a0d15b81241) In my defence, Ubuntu used to have a Mac-like GUI, ... but like in the ancient time.

Since the users can customize the location of (x) button on Linux, this ad-hoc code may raise issue, potentially. So, rather than removing the button, a better solution would be to ignore the input when the user clicks (x) on the 'New Location' tab.