Recent

Author Topic: Qt Native Dialogs cause External:SIGSEGV  (Read 8694 times)

sfeinst

  • Full Member
  • ***
  • Posts: 186
Qt Native Dialogs cause External:SIGSEGV
« on: November 16, 2010, 01:44:41 am »
I was attempting to use the native Qt dialogs.  I updated Lazarus through SVN to latest.  I ran the following to build Lazarus:

make OPT="-dQT_NATIVE_DIALOGS" LCL_PLATFORM=qt bigide

When I run Lazarus and try to use the File Open or File Save dialogs, I get an External:SIGSEGV error or soemtimes the IDE just crashes.

I was wondering if anyone else had this issue.

I am running the latest Lazarus SVN alonng with FreePascal 2.4.2 and QT 4.7.0

zeljko

  • Hero Member
  • *****
  • Posts: 1426
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #1 on: November 16, 2010, 05:37:55 am »
An gdb backtrace could help.

zeljko

  • Hero Member
  • *****
  • Posts: 1426
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #2 on: November 16, 2010, 07:55:54 am »
Just tested under Fedora 13 - KDE 4.5.2, qt-4.7.0 and there's no crashes - works fine.

sfeinst

  • Full Member
  • ***
  • Posts: 186
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #3 on: November 16, 2010, 12:03:02 pm »
I am including the backtrace to see if it helps.  But before that, here are the steps I perform, maybe something wrong there.

I make Lazarus using:
make OPT="-dQT_NATIVE_DIALOGS" LCL_PLATFORM=qt bigide

This does not fully work (ie Lazarus compiles with non-native dialogs) and have to recompile LCL.  To do this I go to Tools->Comfigure Build  add -dQT_NATIVE_DIALOGS to the options and Build.

But that does not fully work as Printer4Lazarus can't be built when I compile my code.  So then I go back to command prompt and perform the same make again.

Now Lazarus uses the native dialogs.  And then I get the fault.

Here is the back trace:

GNU gdb (GDB) 7.1-2pclos2010 (PCLinuxOS release 2010)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-mandriva-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/steve/data/code/pascal/jid/jid...done.
[?1034h(gdb) break fpc_raiseexception
Breakpoint 1 at 0x806d946
(gdb) run
Starting program: /home/steve/data/code/pascal/jid/jid
[Thread debugging using libthread_db enabled]
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.2600.0-gdb.py", line 9, in <module>
    from gobject import register
  File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
    import gdb.backtrace
ImportError: No module named backtrace
[New Thread 0xb1bb4b70 (LWP 6908)]
[New Thread 0xb0f6cb70 (LWP 6909)]

Program received signal SIGSEGV, Segmentation fault.
0xb5f4c188 in ?? () from /usr/lib/libQtGui.so.4
(gdb) backtrace
#0  0xb5f4c188 in ?? () from /usr/lib/libQtGui.so.4
#1  0xb618de2e in ?? () from /usr/lib/libQtGui.so.4
#2  0xb6173a70 in ?? () from /usr/lib/libQtGui.so.4
#3  0xb6157ca9 in ?? () from /usr/lib/libQtGui.so.4
#4  0xb61234e3 in ?? () from /usr/lib/libQtGui.so.4
#5  0xb615c9a4 in ?? () from /usr/lib/libQtGui.so.4
#6  0xb6169bbc in ?? () from /usr/lib/libQtGui.so.4
#7  0xb60c706f in QPaintEngineEx::draw(QVectorPath const&) () from /usr/lib/libQtGui.so.4
#8  0xb60c73cc in QPaintEngineEx::drawPath(QPainterPath const&) ()
   from /usr/lib/libQtGui.so.4
#9  0xb60dfa61 in QPainter::drawPath(QPainterPath const&) () from /usr/lib/libQtGui.so.4
#10 0xb60d9ae7 in ?? () from /usr/lib/libQtGui.so.4
#11 0xb60dc25e in QPainter::drawRects(QRect const*, int) () from /usr/lib/libQtGui.so.4
#12 0xb60dd122 in QPainter::drawPixmap(QPointF const&, QPixmap const&) ()
   from /usr/lib/libQtGui.so.4
#13 0xb05c2537 in ?? () from /usr/lib/libkfile.so.4
#14 0xb656413c in QListView::paintEvent(QPaintEvent*) () from /usr/lib/libQtGui.so.4
#15 0xb05bf7af in KFilePlacesView::paintEvent(QPaintEvent*) () from /usr/lib/libkfile.so.4
#16 0xb5fb5b77 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#17 0xb63e49f5 in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#18 0xb6483c71 in QAbstractScrollArea::viewportEvent(QEvent*) ()
   from /usr/lib/libQtGui.so.4
#19 0xb654286c in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#20 0xb6486716 in ?? () from /usr/lib/libQtGui.so.4
#21 0xb5bcbfbe in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
    () from /usr/lib/libQtCore.so.4
#22 0xb5f552fd in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#23 0xb5f5d2b8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#24 0xb5bcc86e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#25 0xb5fbf43c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#26 0xb5fc01d9 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#27 0xb5fbf188 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#28 0xb5fc01d9 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#29 0xb5fbf188 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#30 0xb5fc01d9 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#31 0xb5fc0017 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#32 0xb5fc0017 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#33 0xb5fbf188 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#34 0xb5fc01d9 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#35 0xb5fbf188 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#36 0xb5fc01d9 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) ()
   from /usr/lib/libQtGui.so.4
#37 0xb5fbf188 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*) () from /usr/lib/libQtGui.so.4
#38 0xb61ba1d2 in ?? () from /usr/lib/libQtGui.so.4
#39 0xb5faed4b in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#40 0xb5fb631c in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#41 0xb5f5532c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#42 0xb5f5d2b8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#43 0xb5bcc86e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#44 0xb61b72b9 in ?? () from /usr/lib/libQtGui.so.4
#45 0xb61baa87 in ?? () from /usr/lib/libQtGui.so.4
#46 0xb5fb1875 in QWidget::repaint(QRect const&) () from /usr/lib/libQtGui.so.4
#47 0xb5fb1991 in QWidget::repaint() () from /usr/lib/libQtGui.so.4
#48 0xb643fab0 in QProgressBar::setValue(int) () from /usr/lib/libQtGui.so.4
#49 0xb0582fad in KDirOperator::Private::_k_slotProgress(int) ()
   from /usr/lib/libkfile.so.4
#50 0xb05903dd in KDirOperator::qt_metacall(QMetaObject::Call, int, void**) ()
   from /usr/lib/libkfile.so.4
#51 0xb5bd26cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /usr/lib/libQtCore.so.4
#52 0xb5be5adc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/libQtCore.so.4
#53 0xb4b3e765 in KDirLister::percent(int) () from /usr/lib/libkio.so.5
#54 0xb4b43e94 in KDirLister::Private::_k_slotPercent(KJob*, unsigned long) ()
   from /usr/lib/libkio.so.5
#55 0xb4b471e3 in KDirLister::qt_metacall(QMetaObject::Call, int, void**) ()
   from /usr/lib/libkio.so.5
#56 0xb5bd26cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /usr/lib/libQtCore.so.4
#57 0xb5be5adc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/libQtCore.so.4
#58 0xb441280d in KJob::percent(KJob*, unsigned long) () from /usr/lib/libkdecore.so.5
#59 0xb44128df in KJob::emitPercent(unsigned long long, unsigned long long) ()
   from /usr/lib/libkdecore.so.5
#60 0xb4414583 in KJob::setProcessedAmount(KJob::Unit, unsigned long long) ()
   from /usr/lib/libkdecore.so.5
#61 0xb4b1ccd6 in ?? () from /usr/lib/libkio.so.5
#62 0xb4b2bdb9 in ?? () from /usr/lib/libkio.so.5
#63 0xb4b2cd1e in KIO::ListJob::qt_metacall(QMetaObject::Call, int, void**) ()
   from /usr/lib/libkio.so.5
#64 0xb5bd26cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /usr/lib/libQtCore.so.4
#65 0xb5be5adc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/libQtCore.so.4
#66 0xb4be50d5 in KIO::SlaveInterface::listEntries(QList<KIO::UDSEntry> const&) ()
   from /usr/lib/libkio.so.5
#67 0xb4be8a8a in KIO::SlaveInterface::dispatch(int, QByteArray const&) ()
   from /usr/lib/libkio.so.5
#68 0xb4be569a in KIO::SlaveInterface::dispatch() () from /usr/lib/libkio.so.5
#69 0xb4bd7808 in KIO::Slave::gotInput() () from /usr/lib/libkio.so.5
#70 0xb4bd7a44 in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) ()
   from /usr/lib/libkio.so.5
#71 0xb5bd26cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /usr/lib/libQtCore.so.4
#72 0xb5be5adc in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/libQtCore.so.4
#73 0xb4ae9635 in KIO::Connection::readyRead() () from /usr/lib/libkio.so.5
#74 0xb4aebaca in ?? () from /usr/lib/libkio.so.5
#75 0xb4aebc17 in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) ()
   from /usr/lib/libkio.so.5
#76 0xb5bd26cd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /usr/lib/libQtCore.so.4
#77 0xb5bdde05 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQtCore.so.4
#78 0xb5bdfde2 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#79 0xb5f5532c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#80 0xb5f5d228 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#81 0xb5bcc86e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#82 0xb5bd0b3c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/libQtCore.so.4
#83 0xb5bd0cfc in QCoreApplication::sendPostedEvents(QObject*, int) ()
   from /usr/lib/libQtCore.so.4
#84 0xb5bfc514 in ?? () from /usr/lib/libQtCore.so.4
#85 0xb574b5de in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#86 0xb574f458 in ?? () from /usr/lib/libglib-2.0.so.0
#87 0xb574f5fe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#88 0xb5bfbff1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#89 0xb60180fa in ?? () from /usr/lib/libQtGui.so.4
#90 0xb5bcb31d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#91 0xb5bcb7a9 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#92 0xb64d1ab1 in QDialog::exec() () from /usr/lib/libQtGui.so.4
#93 0xb4c3efba in ?? () from /usr/lib/libkio.so.5
#94 0xb64e847f in QFileDialog::getOpenFileName(QWidget*, QString const&, QString const&, QString const&, QString*, QFlags<QFileDialog::Option>) () from /usr/lib/libQtGui.so.4
#95 0xb7f41d47 in QFileDialog_getOpenFileName (retval=0xbfffe310, parent=0x87afd70,
    caption=0xbfffe2f0, dir=0xbfffe2f8, filter=0xbfffe2f4, selectedFilter=0xbfffe2fc,
    options=0) at src/qfiledialog_c.cpp:293
#96 0x08249a15 in TQTWSFILEDIALOG__SHOWMODAL (ACOMMONDIALOG=0xb3e611a0, pvmt=0xb3a86980)
    at qtwsdialogs.pp:487
#97 0x081daacf in TCOMMONDIALOG__DOEXECUTE (this=<error reading variable>)
    at ./include/commondialog.inc:105
#98 0x081dae71 in TFILEDIALOG__DOEXECUTE (this=<error reading variable>)
    at ./include/filedialog.inc:107
#99 0x081db5c3 in TOPENDIALOG__DOEXECUTE (this=<error reading variable>)
    at ./include/filedialog.inc:245
#100 0x081da83e in TCOMMONDIALOG__EXECUTE (this=<error reading variable>)
    at ./include/commondialog.inc:37
#101 0x081dad31 in TFILEDIALOG__EXECUTE (this=<error reading variable>)
    at ./include/filedialog.inc:59
#102 0x0808e214 in TJIDFORM__OPENFILE (SENDER=0xb39d5200, this=<error reading variable>)
    at jidunit.pas:323
#103 0x081a9a1e in TMENUITEM__CLICK (this=<error reading variable>)
    at ./include/menuitem.inc:75
#104 0x081aa058 in TMENUITEM__DOCLICKED (MSG=void, this=<error reading variable>)
    at ./include/menuitem.inc:269
#105 0x0806cc7a in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#106 0x081aa020 in TMENUITEM__GETPARENTCOMPONENT (this=<error reading variable>)
    at ./include/menuitem.inc:258
#107 0xb7f46868 in QObject_hook::eventFilter (this=0x0, sender=0x8515d00, event=0x84cd650)
    at tmp/../src/qobject_hook.h:63
#108 0xb5bcbfbe in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#109 0xb5f552fd in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#110 0xb5f5d2b8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#111 0xb5bcc86e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#112 0xb5bd0b3c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
    () from /usr/lib/libQtCore.so.4
#113 0xb5bd0cfc in QCoreApplication::sendPostedEvents(QObject*, int) ()
   from /usr/lib/libQtCore.so.4
#114 0xb5bfc514 in ?? () from /usr/lib/libQtCore.so.4
#115 0xb574b5de in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#116 0xb574f458 in ?? () from /usr/lib/libglib-2.0.so.0
#117 0xb574f5fe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#118 0xb5bfbff1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#119 0xb60180fa in ?? () from /usr/lib/libQtGui.so.4
#120 0xb5bd0f93 in QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () from /usr/lib/libQtCore.so.4
#121 0xb7ee7043 in QCoreApplication_processEvents (flags=0)
    at src/qcoreapplication_c.cpp:105
#122 0x081bff33 in TQTWIDGETSET__APPPROCESSMESSAGES (this=<error reading variable>)
    at qtobject.inc:264
#123 0x08089499 in TAPPLICATION__HANDLEMESSAGE (this=<error reading variable>)
    at ./include/application.inc:1229
#124 0x080898ff in TAPPLICATION__RUNLOOP (this=<error reading variable>)
    at ./include/application.inc:1362
#125 0x081bfef3 in TQTWIDGETSET__APPRUN (ALOOP=0x80898c0 <TAPPLICATION__RUNLOOP>, this=
    <error reading variable>) at qtobject.inc:233
#126 0x080898ba in TAPPLICATION__RUN (this=<error reading variable>)
    at ./include/application.inc:1350
#127 0x0805e85b in main () at jid.lpr:69

sfeinst

  • Full Member
  • ***
  • Posts: 186
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #4 on: November 19, 2010, 12:59:25 am »
One other note.  I traced the code in debugger.  I tried file open dialog and the code dies on Execute.  I traced the code further and it dies on TCommonDialog.DoExecute on the line TWSCommonDialogClass(WidgetSetClass).ShowModal(Self);  Tracing further:
       QFileDialog_getOpenFileName(@ReturnText,
          QWidget_parentWidget(QtFileDialog.Widget), @SaveTitle, @saveFileName,
          @saveFilter, @selectedFilter, Flags);
 
The error displayed is:
could not find src/qwidget_c.cpp

So I'm thinking the code qt45 code may not work fully with qt 4.7.0

Should this be logged in bug tracker?

zeljko

  • Hero Member
  • *****
  • Posts: 1426
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #5 on: December 01, 2010, 03:09:12 pm »
It's fixed by using bindings compiled with -mstackrealign.
Binaries of bindings for qt-4.7 can be downloaded from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

be sure that you downloaded one compat with qt-4.7 !

sfeinst

  • Full Member
  • ***
  • Posts: 186
Re: Qt Native Dialogs cause External:SIGSEGV
« Reply #6 on: December 01, 2010, 09:21:27 pm »
Thanks.  I tested it out and did not have any issues.

 

TinyPortal © 2005-2018