sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
216 stars 112 forks source link

Segmentation Fault when Choosing Southern Hemisphere #143

Closed mitchellkrogza closed 5 years ago

mitchellkrogza commented 5 years ago

On Ubuntu 18.04 LTS when I select Southern Hemisphere there is an immediate segmentation fault and full_gui.py exits

fault

mitchellkrogza commented 5 years ago

I've now also tried on a fresh install of Debian using the Conda method and same problem with the Segmentation Fault. Has this repo been abandoned? I hope not.

wblumberg commented 5 years ago

Hi @mitchellkrogza ...the repo hasn't been abandoned. A lot of our past developments have been experimental in that we need to transition this repo to include Python 3 and Pyside 2 so there haven't been many changes to the Andover branch. I'm in transition between jobs/moving right now and haven't been able to respond to anything posted. It sounds like you're working with the Andover branch, which is our development branch. I'm not sure how much support we can provide for this over the next few weeks, but if you post some detailed information about the individual steps you took to create this error (numpy, pyside, SHARPpy versions), I can probably take a swing at it once I get settled.

mitchellkrogza commented 5 years ago

Hi @wblumberg great glad to hear this repo will still move ahead. Good luck with the new job and move. I'll post my installation methods tomorrow but believe I am pulling off master branch, didn't look to see if you had other branches.

mitchellkrogza commented 5 years ago

Should I try the HWT branch? Or stay away?

tsupinie commented 5 years ago

Hi, @mitchellkrogza. I don't have access to a Debian or Ubuntu box right now, and I'm unable to reproduce this on RHEL 6 (or Mac OS or Windows). Maybe I'll try spinning up a virtual machine later. My instinct is to say that the problem lies in the PySide binaries for those OSes, as Python errors will usually print a stack trace before crashing and/or burning.

tsupinie commented 5 years ago

Okay, I was able to reproduce this in a Debian VM. I'm not entirely sure what's going on, but it's something to do with the background threads. I've implemented what I think is a fix/workaround in the master-debian branch. Could you try that?

mitchellkrogza commented 5 years ago

Thanks @tsupinie I pulled from master-debian switched to that branch and ran python ./setup.py install again. It still segfaults if selecting Southern Hemisphere before I choose anything else. If I first choose GFS > and select a profile then I can switch to Southern Hemisphere and select a point on the map. But then it's still giving me this.

sharppy

I did download the Windows 7 64 Bit binary which works as suggested by @georgephillips1 but ultimately I would like this working in Linux. Let me know if there is anything else I can provide to help diagnose this.

mitchellkrogza commented 5 years ago

Hi @tsupinie I tried this morning with a fresh CentOS 7 VM as it's the closest to RHEL. Here were my install steps and outcome which is much the same. Hope we can find what's causing these errors as the Windows 7 binary works ok.

I used the Conda method as follows:

conda install numpy                                                                                                         
Solving environment: done

## Package Plan ##

  environment location: /home/mitchellkrog/miniconda2

  added / updated specs: 
    - numpy

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.5.9                |           py27_0         1.0 MB
    mkl_random-1.0.1           |   py27h4414c95_1         361 KB
    mkl-2018.0.3               |                1       198.7 MB
    mkl_fft-1.0.4              |   py27h4414c95_1         147 KB
    intel-openmp-2018.0.3      |                0         705 KB
    numpy-base-1.15.0          |   py27h3dfced4_0         4.1 MB
    libgfortran-ng-7.2.0       |       hdf63c60_3         1.2 MB
    blas-1.0                   |              mkl           6 KB
    numpy-1.15.0               |   py27h1b885b7_0          36 KB
    ------------------------------------------------------------
                                           Total:       206.3 MB

Then

conda install -c conda-forge pyside=1.2.4
Solving environment: done

## Package Plan ##

  environment location: /home/mitchellkrog/miniconda2

  added / updated specs: 
    - pyside=1.2.4

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libxml2-2.9.8              |       h422b904_2         1.8 MB  conda-forge
    libiconv-1.15              |       h470a237_1         2.0 MB  conda-forge
    qt-4.8.7                   |                7        31.4 MB  conda-forge
    pyside-1.2.4               |           py27_8         6.7 MB  conda-forge
    harfbuzz-1.4.3             |                0         4.0 MB  conda-forge
    pixman-0.34.0              |                2         1.2 MB  conda-forge
    freetype-2.7               |                1         2.8 MB  conda-forge
    libxslt-1.1.32             |       h88dbc4e_1         513 KB  conda-forge
    openssl-1.0.2o             |       h470a237_1         3.5 MB  conda-forge
    ca-certificates-2018.4.16  |                0         139 KB  conda-forge
    icu-58.2                   |       hfc679d8_0        22.8 MB  conda-forge
    cairo-1.14.6               |                4         1.2 MB  conda-forge
    graphite2-1.3.11           |       hfc679d8_0         119 KB  conda-forge
    glib-2.51.4                |                0         6.0 MB  conda-forge
    pcre-8.41                  |       h470a237_2         244 KB  conda-forge
    certifi-2018.4.16          |           py27_0         142 KB  conda-forge
    fontconfig-2.12.1          |                4         938 KB  conda-forge
    pango-1.40.4               |                0         999 KB  conda-forge
    xz-5.2.4                   |       h470a237_0         329 KB  conda-forge
    libpng-1.6.35              |       ha92aebf_0         305 KB  conda-forge
    libtiff-4.0.9              |       he6b73bb_1         521 KB  conda-forge
    jpeg-9c                    |       h470a237_0         230 KB  conda-forge
    conda-4.5.9                |           py27_0         634 KB  conda-forge
    gettext-0.19.8.1           |                0         6.3 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        94.8 MB

Then cloned the repo and ran setup, output from setup.py (attached).

setup_py.txt

Then finally running ./full_gui.py and selecting my GFS ranges and generating profiles.

sharppy

tsupinie commented 5 years ago

Oh, yeah, you'll need to downgrade NumPy. NumPy v1.12 works for me. I need to get on and fix bugs when using the latest versions of NumPy because it can't resist breaking SHARPpy whenever they do an update.

mitchellkrogza commented 5 years ago

Oh awesome I will try revert to Numpy 1.12 tomorrow and will revert back. Thanks so much @tsupinie

mitchellkrogza commented 5 years ago

Many thanks @tsupinie it works 100% with Numpy 1.12, now for me to start learning how to script with SharpPy 😂

mitchellkrogza commented 5 years ago

@tsupinie Is there any simple and quick way via the command line to create the basic graph layout already created within the SharpPy gui for a certain station name? I currently have no need to change what is produced simply to try and automate it daily.

sharppy

mitchellkrogza commented 5 years ago

For others who may run into this issue, my steps are simply to conda uninstall numpy then

conda install numpy=1.12
cd SHARPpy/
python ./setup.py install
cd runsharp/
python ./full_gui.py

Tested on CentOS7 ✔️ Ubuntu 18.04 LTS ✔️ (see below) Debian 9 ✔️ (same install as below for Ubuntu)

mitchellkrogza commented 5 years ago

@tsupinie Happy to also report I have this working on Ubuntu 18.04 LTS My install steps.

bash Miniconda2-latest-Linux-x86_64.sh
conda install -c conda-forge pyside=1.2.4
conda install numpy=1.12
git clone https://github.com/sharppy/SHARPpy.git
cd SHARPpy/
git pull origin master-debian
git checkout master-debian
python ./setup.py install
cd runsharp/
python ./full_gui.py

Initial 3-5 attempts to start full_gui.py might give you NameError: global name 'socket' is not defined keep trying to start it, it eventually fires up and generates the graphs needed.

Save Image Dialog Box is horribly messed up though. (on both Ubuntu and Debian)

sharppy

Error message regarding socket

Traceback (most recent call last):
  File "./full_gui.py", line 54, in doCrasher
    ret = func(*args, **kwargs)
  File "./full_gui.py", line 661, in createWindow
    return Main()
  File "./full_gui.py", line 537, in __init__
    self.__initUI()
  File "./full_gui.py", line 543, in __initUI
    self.picker = Picker(self.config, parent=self)
  File "./full_gui.py", line 110, in __init__
    urls = data_source.pingURLs(self.data_sources)
  File "/home/user/miniconda2/lib/python2.7/site-packages/SHARPpy-1.3.0-py2.7.egg/datasources/data_source.py", line 70, in pingURLs
    urls[url] = _pingURL(url)
  File "/home/user/miniconda2/lib/python2.7/site-packages/SHARPpy-1.3.0-py2.7.egg/datasources/data_source.py", line 54, in _pingURL
    except socket.timeout as e:
NameError: global name 'socket' is not defined