AequilibraE / qaequilibrae

Free QGIS add-on for transportation modeling
https://www.aequilibrae.com/qgis/latest/
Other
75 stars 24 forks source link

Bad Alloc when plugin enabled Fedora 40 Wayland #356

Open MTRNord opened 5 months ago

MTRNord commented 5 months ago

BEFORE REPORTING A BUG

  1. Have you searched online for a solution for your issue? Yes
  2. Have you consulted with the user and developer community? https://groups.google.com/g/aequilibrae No
  3. Have you collected COMPLETE information on the issue you are reporting?

Describe the bug On activating or opening qgis with the plugin enabled it throws:

❯ qgis
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
fish: Job 1, 'qgis' terminated by signal SIGABRT (Abbruch)

To Reproduce Steps to reproduce the behavior:

  1. Install qgis from fedora repos
  2. Install the plugin
  3. Manually install the dependencies if they fail (they seem to fail at random? Possibly due to the ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. error)
  4. Relaunch qgis

Expected behavior It works

Screenshots Not applicable

Desktop (please complete the following information):

Additional context The dependency installation already seemed spotty. This may be related to the issue. I havent found a way to get more debug logs out of qgis however I am happy to provide them if there are commands to run or places to look for

pedrocamargo commented 5 months ago

Hi Marcel. This is a difficult one, as your distribution is not the most common.

I do have one question:

  1. What is the Python version your QGIS is using? 3.12 may be a bit more difficult to figure out.

In any case, I would suggest the following:

  1. Remove the plugin completely (manually is usually easier, but I don't know where the plugins are stored on Linux systems)
  2. Install the plugin again and refuse the automatic installation of dependencies.
  3. Close QGIS
  4. Manually install dependencies by following the steps in this file: https://github.com/AequilibraE/qaequilibrae/blob/develop/qaequilibrae/download_extra_packages_class.py
  5. Re-open QGIS

@Jake-Moss , do you use Fedora by any chance? Anything you could add here?

MTRNord commented 5 months ago

Hi :) It is Python 3.12.3.

Qgis luckily has qgis --noplugins which gets me back into the qgis UI. I will give a reinstall a try and do a manual install. I am also meanwhile trying to run it in gdb (Downloading all the debug info is taking a moment right now) and see if maybe that gives a usable backtrace as well. :)

pedrocamargo commented 5 months ago

I would be curious to see what you find out! Installing the dependencies manually may indeed be your best bet for now indeed!

MTRNord commented 5 months ago

So it seems the crash originates actually from pyproj's Measure type :thinking: which triggers a INTERNAL_SYSCALL_ERROR_P/a pthread kill.

The backtrace is massive: https://gist.github.com/MTRNord/6b31540232fa9f8963121c655679e425 and this is even without all the debug info. I will try the manual package install next now instead and also will check if proj maybe has a known issue about this.

MTRNord commented 5 months ago

It seems like manually installing the dependencies doesn't fix the issue here. :/

Jake-Moss commented 5 months ago

@Jake-Moss , do you use Fedora by any chance? Anything you could add here?

Not on my main system but my laptop is running Fedora. I'll be able to give this a test next week

Jake-Moss commented 4 months ago

The dependency installation already seemed spotty.

We're unfortunately aware of just how spotty this is. Hopefully [1] will provide a fix for that, in the mean time @pedrocamargo qpip [2] might be a good alternative if we want to shift away from managing our own dependency installation.

I'm going through the motions of setting up my laptop for qgis now.

[1] https://github.com/qgis/QGIS-Enhancement-Proposals/issues/202 [2] https://github.com/opengisch/qpip

Jake-Moss commented 4 months ago

Laptop is finally done updating. I can reproduce this on both wayland and X so I don't believe it's display server related.

Running under GDB doesn't yield anything useful. What makes matters worse is that with a couple of symlink hacks and the git history I can reproduce this on all compatible versions of qaequilibrae (all the way back to 0.4). I'll aim to make this little test more robust when I dig into the plugin code tomorrow.

Jake-Moss commented 4 months ago

Apologies I was unable to get to this today. I'm not able to reproduce this particular crash when using QGIS from a flatpak, however that raises other issues like dependency installation which I've previously been able to get working.