ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
122 stars 77 forks source link

ginga seg fault with missing ginga_config #65

Closed pllim closed 9 years ago

pllim commented 9 years ago

In the current master version (2.1.20141220052723) in RHEL 6.6 (Santiago) 64-bit, I get segmentation fault and the traceback complains of a missing ginga_config. I checked out the source from GitHub and installed it with python setup.py install --prefix=LOCAL_DIR command. Am I missing something?

2015-01-16 20:47:36,600 | W | main.py:298 (main) | failed to set WCS package preference: 
2015-01-16 20:47:36,600 | W | main.py:310 (main) | failed to set FITS package preference: 
2015-01-16 20:47:36,691 | E | main.py:339 (main) | Error importing Ginga config file: No module named ginga_config
2015-01-16 20:47:36,692 | E | main.py:340 (main) | Traceback:
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/main.py", line 327, in main
    import ginga_config
ejeschke commented 9 years ago

Can you try running it with --loglevel=10 --log=/tmp/ginga.log

and force the toolkit with -t qt (use qt) or -t gtk (use gtk) (but not both at the same time)

Please attach the last 20 lines of the log in this issue.

We're running it on several 64-bit RHEL machines no problem. I'll have to check the version--might be 6.5.

pllim commented 9 years ago
> ginga --loglevel=10 --log=ginga.log -t qt 
Traceback (most recent call last):
  File ".../bin/ginga", line 4, in <module>
    __import__('pkg_resources').run_script('ginga==2.1.20141220052723', 'ginga')
  File ".../lib/python2.7/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File ".../lib/python2.7/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/EGG-INFO/scripts/ginga", line 14, in <module>
    main.reference_viewer(sys.argv)
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/main.py", line 475, in reference_viewer
    viewer.main(options, args)
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/main.py", line 260, in main
    from ginga.qtw.GingaQt import GingaView
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/qtw/GingaQt.py", line 17, in <module>
    from ginga.qtw.QtHelp import QtGui, QtCore, QFont, \
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/qtw/QtHelp.py", line 95, in <module>
    raise ImportError("Failed to import qt4, qt5 or pyside. There may be an issue with the toolkit module or it is not installed")
ImportError: Failed to import qt4, qt5 or pyside. There may be an issue with the toolkit module or it is not installed

However, in a Python 2.7.5 session under the same environment:

>>> from ginga.qtw import QtHelp
>>> QtHelp.have_pyside
True
>>> QtHelp.configured
True
pllim commented 9 years ago

Update: I modified my copy of ginga script to force loading QtHelp first, and then again, I am getting missing ginga_config error as per my original post. I cannot find any ginga_config.py in your code repository.

ejeschke commented 9 years ago

@plim, don't worry about the ginga_config.py error--that is normal if you have not created one in your ~/.ginga directory. It is used to customize ginga. That error by itself should not keep ginga from starting.

If you are still having issues getting the ginga window to appear, can you try one of the much simpler example programs first? Try running

python examples/qt/example2_qt.py

or

python examples/gtk/example2_gtk.py

These can also be run with the logging options. Please let me know the outcome.

pllim commented 9 years ago

python .../example2_qt.py works. Hmmm!

pllim commented 9 years ago

So, #67 fixes my problem mostly. A GUI pops up now. Occasionally, when I call it again after I close the GUI, I still get seg fault but the GUI will work again after I try to call it yet again. When the GUI does pop up, I see this warning on the terminal:

No handlers could be found for logger "ImageViewBase"
ejeschke commented 9 years ago

@pllim, I just checked our machines. They are "Red Hat Enterprise Linux Server release 6.6 (Santiago) ". We are using both qt and gtk versions. No issues that I know of.

ejeschke commented 9 years ago

Linux HOST 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

pllim commented 9 years ago

What Qt versions do you check against? (I am not interested in the GTK interface at the moment.)

ejeschke commented 9 years ago

[eric@sumo ginga]$ python Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from PyQt4.QtCore import QT_VERSION_STR from PyQt4.pyqtconfig import Configuration print("Qt version:", QT_VERSION_STR) ('Qt version:', '4.8.6') cfg = Configuration() print("SIP version:", cfg.sip_version_str) ('SIP version:', '4.14.4') print("PyQt version:", cfg.pyqt_version_str) ('PyQt version:', '4.9.6')

Does this help? What version of astropy are you using?

pllim commented 9 years ago

I use the dev version of astropy. Here is my version info. I use PySide, not PtQt4.

Python 2.7.5 (default, Jan 21 2015, 21:00:26) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
>>> import PySide
>>> PySide.__version__
'1.2.1'
>>> PySide.QtCore.__version__
'4.8.5'
>>> PySide.QtCore.qVersion()
'4.8.5'
>>> import astropy
>>> astropy.__version__
'1.0.dev11598'
pllim commented 9 years ago

I think we have to re-open this. #67 does not work anymore and I don't think it's the real fix; which means it will have to be reverted. I managed to get a bit more info on the seg fault, as follows.

(Update: I added more traceback)

$ gdb python
(gdb) run .../bin/ginga -t pyside
Starting program: .../bin/python .../bin/ginga -t pyside
[Thread debugging using libthread_db enabled]
Missing separate debuginfo for .../lib/libgfortran.so.1
Detaching after fork from child process 10408.
Detaching after fork from child process 10409.
[New Thread 0x7fffe5e9a700 (LWP 10411)]
[New Thread 0x7fffe5499700 (LWP 10412)]
[New Thread 0x7fffe4a98700 (LWP 10413)]
[New Thread 0x7fffe4097700 (LWP 10414)]
[New Thread 0x7fffe3696700 (LWP 10415)]
[New Thread 0x7fffe2c95700 (LWP 10416)]
[New Thread 0x7fffe2294700 (LWP 10417)]
[New Thread 0x7fffe1893700 (LWP 10418)]
Detaching after fork from child process 10419.
Detaching after fork from child process 10420.
No handlers could be found for logger "ginga"
[New Thread 0x7fffd8ee1700 (LWP 10422)]
[New Thread 0x7fffd3fff700 (LWP 10423)]
[New Thread 0x7fffd35fe700 (LWP 10424)]
[New Thread 0x7fffd2bfd700 (LWP 10425)]
[New Thread 0x7fffd21fc700 (LWP 10426)]
[New Thread 0x7fffd17fb700 (LWP 10427)]
[New Thread 0x7fffd0dfa700 (LWP 10428)]
[New Thread 0x7fffbbfff700 (LWP 10429)]
[New Thread 0x7fffbb5fe700 (LWP 10430)]
[New Thread 0x7fffbabfd700 (LWP 10431)]
[New Thread 0x7fffba1fc700 (LWP 10432)]
[New Thread 0x7fffb97fb700 (LWP 10433)]
[New Thread 0x7fffb8dfa700 (LWP 10434)]
[New Thread 0x7fff9ffff700 (LWP 10435)]
[New Thread 0x7fff9f5fe700 (LWP 10436)]
[New Thread 0x7fff9ebfd700 (LWP 10437)]
[New Thread 0x7fff9e1fc700 (LWP 10438)]
[New Thread 0x7fff9d7fb700 (LWP 10439)]
[New Thread 0x7fff9cdfa700 (LWP 10440)]
[New Thread 0x7fff83fff700 (LWP 10441)]
[New Thread 0x7fff835fe700 (LWP 10442)]
[New Thread 0x7fff82bfd700 (LWP 10443)]
[New Thread 0x7fff821fc700 (LWP 10444)]
[New Thread 0x7fff817fb700 (LWP 10445)]
[New Thread 0x7fff80dfa700 (LWP 10446)]
[New Thread 0x7fff67fff700 (LWP 10447)]
[New Thread 0x7fff675fe700 (LWP 10448)]
[New Thread 0x7fff66bfd700 (LWP 10449)]
[New Thread 0x7fff661fc700 (LWP 10450)]
[New Thread 0x7fff657fb700 (LWP 10451)]
Detaching after fork from child process 10452.
[New Thread 0x7fff64dfa700 (LWP 10453)]

Program received signal SIGSEGV, Segmentation fault.
0x000000355d929210 in __strncmp_sse42 () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install GConf2-2.28.0-6.el6.x86_64 ORBit2-2.14.17-5.el6.x86_64 PackageKit-gtk-module-0.5.8-23.el6.x86_64 atk-1.30.0-1.el6.x86_64 avahi-glib-0.6.25-15.el6.x86_64 avahi-libs-0.6.25-15.el6.x86_64 cairo-1.8.8-3.1.el6.x86_64 dbus-glib-0.86-6.el6_4.x86_64 dbus-libs-1.2.24-7.el6_3.x86_64 gamin-0.1.10-9.el6.x86_64 gdk-pixbuf2-2.24.1-5.el6.x86_64 glib2-2.28.8-4.el6.x86_64 gnome-keyring-2.28.2-8.el6_3.x86_64 gnome-vfs2-2.24.2-6.el6.x86_64 gtk2-2.24.23-6.el6.x86_64 gtk2-engines-2.18.4-5.el6.x86_64 keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-33.el6.x86_64 libICE-1.0.6-1.el6.x86_64 libSM-1.2.1-2.el6.x86_64 libXcomposite-0.4.3-4.el6.x86_64 libXcursor-1.1.14-2.1.el6.x86_64 libXdamage-1.1.3-4.el6.x86_64 libXext-1.3.2-2.1.el6.x86_64 libXfixes-devel-5.0.1-2.1.el6.x86_64 libXi-devel-1.7.2-2.2.el6.x86_64 libXinerama-1.1.3-2.1.el6.x86_64 libXrandr-1.4.1-2.1.el6.x86_64 libacl-2.2.49-6.el6.x86_64 libart_lgpl-2.3.20-5.1.el6.x86_64 libattr-2.4.44-7.el6.x86_64 libbonobo-2.24.2-5.el6.x86_64 libbonoboui-2.24.2-3.el6.x86_64 libcanberra-0.22-1.el6.x86_64 libcanberra-gtk2-0.22-1.el6.x86_64 libcom_err-1.41.12-21.el6.x86_64 libgcc-4.4.7-11.el6.x86_64 libgnome-2.28.0-11.el6.x86_64 libgnomecanvas-2.26.0-4.el6.x86_64 libgnomeui-2.24.1-4.el6.x86_64 libogg-1.1.4-2.1.el6.x86_64 libpng-1.2.49-1.el6_2.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libstdc++-4.4.7-11.el6.x86_64 libtdb-1.2.10-1.el6.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 libuuid-2.17.2-12.18.el6.x86_64 libvorbis-1.2.3-4.el6_2.1.x86_64 libxml2-2.7.6-17.el6_6.1.x86_64 nss-softokn-freebl-3.14.3-18.el6_6.x86_64 openssl-1.0.1e-30.el6_6.4.x86_64 pango-1.28.1-10.el6.x86_64 pixman-0.32.4-4.el6.x86_64 popt-1.13-7.el6.x86_64

I think the culprit is __strncmp_sse42 () from /lib64/libc.so.6.

(gdb) where
#0  0x000000355d929210 in __strncmp_sse42 () from /lib64/libc.so.6
#1  0x000000356945e885 in __xmlParserInputBufferCreateFilename ()
   from /usr/lib64/libxml2.so.2
#2  0x00000035694e29a5 in xmlNewTextReaderFilename ()
   from /usr/lib64/libxml2.so.2
#3  0x0000003572629755 in ?? () from /usr/lib64/libgnomevfs-2.so.0
#4  0x0000003572629d0d in gnome_vfs_mime_get_value ()
   from /usr/lib64/libgnomevfs-2.so.0
#5  0x000000356d061c53 in gnome_icon_lookup ()
   from /usr/lib64/libgnomeui-2.so.0
#6  0x000000356d0621ed in gnome_icon_lookup_sync ()
   from /usr/lib64/libgnomeui-2.so.0
#7  0x00007fffdd1f2bf4 in ?? () from .../lib/libQtGui.so.4
#8  0x00007fffdd44c14b in ?? () from .../lib/libQtGui.so.4
#9  0x00007fffdd382b3f in ?? () from .../lib/libQtGui.so.4
#10 0x00007fffdd379161 in ?? () from .../lib/libQtGui.so.4
#11 0x00007fffdd37999c in ?? () from .../lib/libQtGui.so.4
#12 0x00007fffdd371fe9 in ?? () from .../lib/libQtGui.so.4
#13 0x00007fffdd372675 in ?? () from .../lib/libQtGui.so.4
#14 0x00007fffdd3727af in ?? () from .../lib/libQtGui.so.4
#15 0x00007fffdd350eac in ?? () from .../lib/libQtGui.so.4
#16 0x00007fffdd359369 in ?? () from .../lib/libQtGui.so.4
#17 0x00007fffdd35994c in ?? () from .../lib/libQtGui.so.4
#18 0x00007fffddd09c78 in Sbk_QFileDialog_Init ()
   from .../lib/python2.7/site-packages/PySide/QtGui.so
#19 0x00007ffff7aa54ac in ?? ()
   from .../lib/libpython2.7.so.1.0
#20 0x00007ffff7a347c7 in ?? ()
   from .../lib/libpython2.7.so.1.0
#21 0x00007ffff7b0b198 in ?? ()
   from .../lib/libpython2.7.so.1.0
#22 0x00007ffff7b0a8e8 in ?? ()
   from .../lib/libpython2.7.so.1.0
#23 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#24 0x00007ffff7b0aacb in ?? ()
   from .../lib/libpython2.7.so.1.0
#25 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#26 0x00007ffff7b06ab0 in ?? ()
   from ...lib/libpython2.7.so.1.0
#27 0x00007ffff7b0aacb in ?? ()
   from .../lib/libpython2.7.so.1.0
#28 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#29 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#30 0x00007ffff7b08975 in ?? ()
   from .../lib/libpython2.7.so.1.0
#31 0x00007ffff7b0abb7 in ?? ()
   from .../lib/libpython2.7.so.1.0
#32 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#33 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#34 0x00007ffff7b08975 in ?? ()
   from .../lib/libpython2.7.so.1.0
#35 0x00007ffff7b0abb7 in ?? ()
   from .../lib/libpython2.7.so.1.0
#36 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#37 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#38 0x00007ffff7b08975 in ?? ()
   from .../lib/libpython2.7.so.1.0
#39 0x00007ffff7afffef in ?? ()
   from .../lib/libpython2.7.so.1.0
#40 0x00007ffff7b0c822 in ?? ()
   from .../lib/libpython2.7.so.1.0
#41 0x00007ffff7b03d7b in ?? ()
   from .../lib/libpython2.7.so.1.0
#42 0x00007ffff7b08975 in ?? ()
   from .../lib/libpython2.7.so.1.0
#43 0x00007ffff7b0abb7 in ?? ()
   from .../lib/libpython2.7.so.1.0
#44 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#45 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#46 0x00007ffff7b0aacb in ?? ()
   from .../lib/libpython2.7.so.1.0
#47 0x00007ffff7b0a8cf in ?? ()
   from .../lib/libpython2.7.so.1.0
#48 0x00007ffff7b06ab0 in ?? ()
   from .../lib/libpython2.7.so.1.0
#49 0x00007ffff7b08975 in ?? ()
   from .../lib/libpython2.7.so.1.0
#50 0x00007ffff7afffef in ?? ()
   from .../lib/libpython2.7.so.1.0
#51 0x00007ffff7b355ef in ?? ()
   from .../lib/libpython2.7.so.1.0
#52 0x00007ffff7b35579 in ?? ()
   from .../lib/libpython2.7.so.1.0
#53 0x00007ffff7b342d4 in ?? ()
   from .../lib/libpython2.7.so.1.0
#54 0x00007ffff7b33ac6 in ?? ()
   from .../lib/libpython2.7.so.1.0
#55 0x00007ffff7b4ca3f in ?? ()
   from .../lib/libpython2.7.so.1.0
#56 0x0000000000400703 in ?? ()
#57 0x000000355d81ed5d in __libc_start_main () from /lib64/libc.so.6
#58 0x0000000000400639 in ?? ()
#59 0x00007fffffffd788 in ?? ()
#60 0x000000000000001c in ?? ()
#61 0x0000000000000004 in ?? ()
#62 0x00007fffffffdd4c in ?? ()
#63 0x00007fffffffdd76 in ?? ()
#64 0x00007fffffffdd94 in ?? ()
#65 0x00007fffffffdd97 in ?? ()
#66 0x0000000000000000 in ?? ()

I am starting to believe that this is something I have to fix on my end and has nothing to do with ginga itself... :o)

ejeschke commented 9 years ago

@pllim, any way you can test against PyQt4 instead of PySide? They've both worked well in my testing, but I have to say that I've only tested PySide with ginga under Ubuntu 14.04, although I have heard from others using it fine on other platforms.

pllim commented 9 years ago

I tested it with Anaconda instead of Ureka, and it worked. I'll update you if I find out more.

ejeschke commented 9 years ago

Excellent. That's our usual installation advice for mac and windows users--use anaconda or canopy. It would be very nice to get this working with Ureka, so let me know if you figure out anything. Tnx!

ejeschke commented 9 years ago

Going to close this, as it seems to not actually involve ginga.