Skip to content

Python3 dump core immediately on Pyfa-2.9.3's pyfa.py startup #1968

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

Closed
maxheise opened this issue May 6, 2019 · 16 comments
Closed

Python3 dump core immediately on Pyfa-2.9.3's pyfa.py startup #1968

maxheise opened this issue May 6, 2019 · 16 comments
Labels
bug Confirmed to be a bug fixed This issue has been fixed! Oh joy! linux Linux-specific issue. upstream Seems to be related to a dependency or third party that pyfa uses, not directly related to pyfa

Comments

@maxheise
Copy link

maxheise commented May 6, 2019

Bug Report

Python3 dumps core immediately on pyfa.py startup

Expected behavior:

A normal startup of pyfa

Actual behavior:

Dumps core immediately on startup

Detailed steps to reproduce:

python3 -m venv /home/user/bin/python3-venv-pyfa_2019_05_06/
cd /home/user/bin/python3-venv-pyfa_2019_05_06/
source bin/activate
pip3 install -r /home/user/bin/Pyfa-2.9.3/requirements.txt
python3 /home/user/bin/Pyfa-2.9.3/pyfa.py
Speicherzugriffsfehler (Speicherabzug geschrieben)
which is the German translation of of "Segmentation fault ( core dumped )"

Fits involved in EFT format (Edit > To Clipboard > EFT):

Release or development git branch? Please note the release version or commit hash:

pyfa release 2.9.3 downloaded from github

Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):

lsb_release -d
Description: Ubuntu 18.04.2 LTS
cat /etc/issue
Ubuntu 18.04.2 LTS \n \l

Other relevant information:

python3 --version
Python 3.6.7

@DarkFenX
Copy link
Member

DarkFenX commented May 6, 2019

Did it happen with earlier versions? Also, please post full output of pip3 install -r /home/user/bin/Pyfa-2.9.3/requirements.txt.

@DarkFenX
Copy link
Member

DarkFenX commented May 6, 2019

I can reproduce the crash on my debian box. It launches fine from venv built by pycharm but fails to launch from venv built manually using the steps above.

import wx.html2 in updateDialog.py is causing crash:
https://github.com/pyfa-org/Pyfa/blob/v2.9.3/gui/updateDialog.py#L25

To confirm it, launching python file with just:

import wx.html2

Also crashes.

Most likely related to wx build process. I do not know how to help with that though, it doesn't seem to be bug with pyfa application or packaging. I will investigate it further and make issue in wxPython's repo a bit later. Might be something caused by distributive as well.

@DarkFenX DarkFenX added bug Confirmed to be a bug upstream Seems to be related to a dependency or third party that pyfa uses, not directly related to pyfa linux Linux-specific issue. labels May 6, 2019
@maxheise
Copy link
Author

maxheise commented May 7, 2019

Did it happen with earlier versions? Also, please post full output of pip3 install -r /home/user/bin/Pyfa-2.9.3/requirements.txt.

The last version that I was running and that was working for me with setup instructions similar to the ones in my initial bug report was Pyfa-2.7.0. I never tried Pyfa-2.8.0 myself.

@maxheise
Copy link
Author

maxheise commented May 7, 2019

And this is the log of pip3 -v install -r /home/user/bin/Pyfa-2.9.3/requirements.txt inside a fresh python venv

pyfa_pip3_log.txt

@DarkFenX
Copy link
Member

DarkFenX commented May 7, 2019

I suspect that 78836ad broke it (by switching to wx version which is broken in pip). Could you check with wxPython == 4.0.0b2 and see if it works for you?

@DarkFenX
Copy link
Member

DarkFenX commented May 7, 2019

Filed upstream issue wxWidgets/Phoenix#1220

@AdamGalt
Copy link

AdamGalt commented May 9, 2019

I also experienced the issue.
I can confirm that using wxPython == 4.0.0b2 instead works as expected.

@DarkFenX
Copy link
Member

DarkFenX commented May 9, 2019

See comment in the upstream issue.

You need to install libwebkit2gtk-4.0-dev package before attempting to install wxPython. I don't know why it segfaulted, though. I would have expected a missing symbol error.

I cannot verify it atm, so please check it if you have time.

@AdamGalt
Copy link

AdamGalt commented May 9, 2019

still get the segfault after installing that package and reinstalling wxPython4.0.4

adam@virtualbox:~/Downloads/Pyfa-2.9.3$ python3 pyfa.py 
Segmentation fault (core dumped)
adam@virtualbox:~/Downloads/Pyfa-2.9.3$ pip3 show wxPython
Name: wxPython
Version: 4.0.4
Summary: Cross platform GUI toolkit for Python, "Phoenix" version
Home-page: http://wxPython.org/
Author: Robin Dunn
Author-email: [email protected]
License: wxWindows Library License (https://opensource.org/licenses/wxwindows.php)
Location: /home/adam/.local/lib/python3.6/site-packages
adam@virtualbox:~/Downloads/Pyfa-2.9.3$ dpkg -s libwebkit2gtk-4.0-dev | grep Status
Status: install ok installed

@DarkFenX
Copy link
Member

DarkFenX commented May 9, 2019

Was wx package rebuilt or taken from cache? Try again with pip3 install -v --no-cache-dir --log venv_wx.log wxPython==4.0.4 and post log file here.

@AdamGalt
Copy link

AdamGalt commented May 9, 2019

Works after ignoring cache.
venv_wx.log

Though, it may be because I still have the old version installed now.

adam@virtualbox:~/Downloads/Pyfa-2.9.3$ pip3 show wxPython
Name: wxPython
Version: 4.0.1

I can't seem to get rid of it:

pip3 uninstall wxPython==4.0.1
Uninstalling wxPython-4.0.1:
  Would remove:
    /usr/lib/python3/dist-packages/wx
    /usr/lib/python3/dist-packages/wxPython-4.0.1.egg-info
Proceed (y/n)? y
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.6/shutil.py", line 544, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/wx' -> '/tmp/pip-uninstall-_71bqj2_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/commands/uninstall.py", line 75, in run
    auto_confirm=options.yes, verbose=self.verbosity > 0,
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 823, in uninstall
    uninstalled_pathset.remove(auto_confirm, verbose)
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 388, in remove
    moved.stash(path)
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 277, in stash
    renames(path, new_path)
  File "/home/adam/.local/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 305, in renames
    shutil.move(old, new)
  File "/usr/lib/python3.6/shutil.py", line 556, in move
    rmtree(src)
  File "/usr/lib/python3.6/shutil.py", line 480, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.6/shutil.py", line 438, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib/python3.6/shutil.py", line 436, in _rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'aui.py'
```
Trying again with sudo gives me:

```
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
```

@DarkFenX
Copy link
Member

DarkFenX commented May 9, 2019

@AdamGalt seems like you have it installed not just for your venv, but system-wide.

$ pip3 show wxpython
Name: wxPython
Version: 4.0.4
Summary: Cross platform GUI toolkit for Python, "Phoenix" version
Home-page: http://wxPython.org/
Author: Robin Dunn
Author-email: [email protected]
License: wxWindows Library License (https://opensource.org/licenses/wxwindows.php)
Location: /usr/lib/python3/dist-packages
Requires: 
Required-by: 

Location shows you where it's installed. Original ticket is for venv installation (if you've executed source bin/activate, system-wide packages wouldn't be detectable). For your issue, you can read up this ticket: pypa/pip#4337

If you try to get pyfa working, just use 4.0.1 which you already have installed (temporarily remove wxpython from requirements.txt when you install dependencies - but then you might face extra bugs), or just uninstall system-wide packages and install via pip.

@AdamGalt
Copy link

AdamGalt commented May 9, 2019

@DarkFenX Thank you for clarifying. I've manually removed it now and Pyfa is still working for me as well.

@DarkFenX
Copy link
Member

@maxheise per comment from the upstream issue, you need to install libwebkit2gtk-4.0-dev (or similar) package before building the wxpython via pip. I just verified on my local machine where it segfaulted, and it works with dependency installed.

Closing this issue, reopen if it still doesn't work for you.

@DarkFenX DarkFenX added the fixed This issue has been fixed! Oh joy! label May 17, 2019
@maxheise
Copy link
Author

maxheise commented Aug 1, 2019

After your help mid May I wanted to post a late reply that the current pyfa 2.9.6 works for me with these installation instructions for Ubuntu 18.04, Linux Mint 19.1 Tessa:

$ lsb_release -d
Description: Linux Mint 19.1 Tessa
i.e it shares its base with Bionic Beaver, Ubuntu 18.04.02

The Pyfa 2.9.6 tarball is extracted to /home/user/bin/Pyfa-2.9.6/ already.

sudo apt-get install libwebkit2gtk-4.0-dev libwebkit2gtk-4.0 python3-wxgtk4.0 python3-logbook python3-matplotlib python3-dateutil python3-requests-cache python3-sqlalchemy python3-cryptography libmarkdown2 python3-roman pypy-bs4 python3-yaml python3-wxgtk-webview4.0 python3-packaging
python3 -m venv /home/user/bin/python3-venv-pyfa_2019_08_01/
cd /home/user/bin/python3-venv-pyfa_2019_08_01/
source bin/activate
pip3 install wheel
pip3 install pathlib2
pip3 install -r /home/user/bin/Pyfa-2.9.6/requirements.txt
cd
python3 ~/bin/Pyfa-2.9.6/pyfa.py

=> works

Ty

@DarkFenX
Copy link
Member

DarkFenX commented Aug 1, 2019

Glad it helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed to be a bug fixed This issue has been fixed! Oh joy! linux Linux-specific issue. upstream Seems to be related to a dependency or third party that pyfa uses, not directly related to pyfa
Projects
None yet
Development

No branches or pull requests

3 participants