Embroidermodder / Embroidermodder

Free machine embroidery software supporting a variety of formats.
https://www.libembroidery.org
Other
522 stars 142 forks source link

Segmentation fault on startup on Linux #87

Closed sbobovyc closed 8 years ago

sbobovyc commented 8 years ago

Ubuntu 15.10, x86_64

sbobovyc@aspire:~/Embroidermodder/embroidermodder2$ git rev-parse HEAD
b984180b70822ac418d1410c5bd1a513bfb8b791
sbobovyc@aspire:~$ gdb /usr/share/embroidermodder2/embroidermodder2 /tmp/core-embroidermodder-11-1000-1000-958-1453230621
GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
This GDB was configured as "x86_64-linux-gnu".
Reading symbols from /usr/share/embroidermodder2/embroidermodder2...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
[New LWP 958]
[New LWP 961]
[New LWP 960]
[New LWP 962]
[New LWP 964]
[New LWP 967]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./embroidermodder2'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
[Current thread is 1 (Thread 0x7f5ad15e5780 (LWP 958))]
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00007f5acce24a6d in XSetCommand ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#2  0x00007f5acce29070 in XSetWMProperties ()
   from /usr/lib/x86_64-linux-gnu/libX11.so.6
#3  0x00007f5ad01ef3a4 in QWidgetPrivate::create_sys(unsigned long, bool, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#4  0x00007f5ad019e8db in QWidget::create(unsigned long, bool, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#5  0x00007f5ad019fbab in QWidget::winId() const ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#6  0x00007f5aa79e8bea in MenuBarAdapter::registerWindow() ()
   from /usr/lib/x86_64-linux-gnu/qt4/plugins/menubar/libappmenu-qt.so
#7  0x00007f5aa79e9687 in AppMenuPlatformMenuBar::createMenuBar() ()
   from /usr/lib/x86_64-linux-gnu/qt4/plugins/menubar/libappmenu-qt.so
#8  0x00007f5ad05b9303 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9  0x00007f5ad05b93e3 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007f5ad05ba008 in QMenuBar::QMenuBar(QWidget*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007f5ad058aa98 in QMainWindow::menuBar() const ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00000000004eabeb in ?? ()
#13 0x0000000000420c61 in ?? ()
#14 0x000000000041d9b0 in ?? ()
#15 0x00007f5acee52a40 in __libc_start_main (main=0x41d637, argc=1, 
    argv=0x7ffe47d01508, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffe47d014f8) at libc-start.c:289
#16 0x000000000041d509 in ?? ()
heinrichheine commented 8 years ago

Also Segfault on Ubuntu 14.04 and 15.10.

redteam316 commented 8 years ago

I was looking into this issue, and it appears that it stems from commit 6abbf5a3a692a94bbafc386958967485fae06234 when @DavidPhillipOster was making some modifications for OSX. I think it is occuring because we use the qApp global pointer somewhat extensively in our code and the subclassing of QApplication caused issues with it.

redteam316 commented 8 years ago

It appears part of the issue may also have been with the menuBars. There is some documentation about OSX tweaks in the QMenuBar documentation.

I just pushed a simple fix upstream for this which shouldn't affect @DavidPhillipOster changes. I'm going to close this issue. If there are still problems, please reopen the issue.

heinrichheine commented 8 years ago

works! Thank you.