Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: Interesting little Segfault w/r to signal/slot connection

  1. #1
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Interesting little Segfault w/r to signal/slot connection

    Good Afternoon

    I've got an interesting little segfault that I can't seem to figure out why it's happening.

    This is using Qt 4.1.0 I beleive.

    First of all, here's a dump of the backtrace:

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -150056832 (LWP 3712)]
    0x00f14c67 in QObject::connect (sender=0x8461ea0, signal=0x805c630 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x83f3688,
    method=0x805c5fc "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
    2134 kernel/qobject.cpp: No such file or directory.
    in kernel/qobject.cpp
    (gdb) bt
    #0 0x00f14c67 in QObject::connect (sender=0x8461ea0, signal=0x805c630 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x83f3688,
    method=0x805c5fc "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
    #1 0x080563a4 in DataGen::setUpConnections (this=0x83f3688) at datagen.cpp:553
    #2 0x0804d480 in DataGen (this=0x83f3688) at datagen.cpp:45
    #3 0x08057d73 in main (argc=1, argv=0xfef1b434) at main.cpp:12
    At first glance, it seems that the signal slot connection is having a hard time being made. The file not found error seems to point to something wrong with the Qt install, but here's the kicker, the exact same code runs perfectly fine in another project I have, on the same machine no less. So I'm not sure that the Qt install is the problem.

    The code that seems to be closest to causing this fault is in the setUpConnections function, relevent snippet is here:
    Qt Code:
    1. void DataGen::setUpConnections()
    2. {
    3. //Signals and Slot Connections.
    4. //This line is causing the problem, although it's syntactically and semantically correct...at least it seems to be.
    5. connect( m_munPhRanges, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ),
    6. this, SLOT( validate( QTableWidgetItem *, QTableWidgetItem * ) ) );
    7. connect( m_munPkRanges, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ),
    8. this, SLOT( validate( QTableWidgetItem *, QTableWidgetItem * ) ) );
    9. ...
    10. }
    To copy to clipboard, switch view to plain text mode 

    The validate function prototype is as follows:
    Qt Code:
    1. /**
    2.  * @brief Slot used to validate the entries in a table. Called when a cell is finished editing,
    3.  * will turn the cell background red in the event of an invalid input. Values inported from file are assumed to be correct.
    4.  * @param current Pointer to the TableWidgetItem in the current cell (not used, required by the signal).
    5.  * @param previous Pointer to the previously edited TableWidgetItem.
    6.  */
    7. void validate( QTableWidgetItem * current, QTableWidgetItem * previous );
    To copy to clipboard, switch view to plain text mode 

    If there's anything else you guys need, I'll try to see what I can do.

    Thanks.
    Last edited by jacek; 11th September 2006 at 21:30. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Are m_munPhRanges and m_munPkRanges initialized? Can you post the code that does this?

  3. #3
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    yeah they are

    Qt Code:
    1. //Set up tables
    2. m_munPhRanges = new QTableWidget();
    3. m_munPhRanges -> setRowCount( 3 );
    4. m_munPhRanges -> setColumnCount( m_numRangesPh );
    5. m_munPhRanges -> setHorizontalHeaderLabels( rgePhHeadH );
    6. m_munPhRanges -> setVerticalHeaderLabels( rgePhHeadV );
    7. m_munPhRanges -> setFixedSize( 635, 110 );
    8. m_munPhRanges -> setRowHeight( 0, 20 );
    9. m_munPhRanges -> setRowHeight( 1, 20 );
    10. m_munPhRanges -> setRowHeight( 2, 20 );
    11.  
    12. m_munPkRanges = new QTableWidget();
    13. m_munPkRanges -> setRowCount( 2 );
    14. m_munPkRanges -> setColumnCount( m_numRangesPk );
    15. m_munPkRanges -> setHorizontalHeaderLabels( rgePkHeadH );
    16. m_munPkRanges -> setVerticalHeaderLabels( rgePkHeadV );
    17. m_munPkRanges -> setFixedSize( 640, 90 );
    18. m_munPkRanges -> setRowHeight( 0, 20 );
    19. m_munPkRanges -> setRowHeight( 1, 20 );
    To copy to clipboard, switch view to plain text mode 

    Everything compiles correctly. The things are also in the class definition in the header.

    As mentioned earlier, I have the exact same setup in a different project (basically rewriting this one to do the same thing, only better) and that one works fine.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Where is this code placed? Are you sure that it's executed before setUpConnections()?

  5. #5
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    yeah, that code is in the setUpWidgets function, which due to it's length, I will not post here. I will post the constructor though...

    Qt Code:
    1. DataGen::DataGen()
    2. {
    3. //We'll set a default value for number of munition ranges to 5. doesn't matter really.
    4. m_numRangesPh = m_numRangesPk = 5;
    5.  
    6. //Set up the widgets.
    7. setUpWidgets();
    8.  
    9. m_dataFile = "";
    10. m_dataDir = QCoreApplication::applicationDirPath ();
    11.  
    12. //Set up the signal/slot connections.
    13. setUpConnections();
    14.  
    15. //Let the selector equal nothing;
    16. m_selector -> setCurrentIndex(-1);
    17.  
    18. //Let the Munition type be nothing by default
    19. m_munType -> setCurrentIndex(-1);
    20.  
    21. //Initialize tables.
    22. initTgtTables();
    23. initMunTables();
    24.  
    25. setWindowFlags ( Qt::WindowMinMaxButtonsHint );
    26. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Does setUpWidgets() happen to be a virtual method?

  7. #7
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Quote Originally Posted by jacek
    Does setUpWidgets() happen to be a virtual method?
    Nope, it's not virtual.

    To me, it doesn't quite look like a code problem, nor an install issue, since it works on another project...I really don't know what else it could be...

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Add:
    Qt Code:
    1. DataGen::DataGen() : m_munPhRanges( 0xdeadbeef ), m_munPkRanges( 0xcafebabe )
    2. {
    3. ...
    To copy to clipboard, switch view to plain text mode 
    and check the stack trace (just to make sure that these variables are initialized).

    Do you create QApplication instance at the beginning of main()? Also check with ldd which Qt library your program is linked with.

  9. #9
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    ldd is reporting that everything should be fine, here's the dump

    Qt Code:
    1. linux-gate.so.1 => (0x00c87000)
    2. libQtGui_debug.so.4 => /usr/local/Trolltech/Qt-4.1.0/lib/libQtGui_debug.so.4 (0x00111000)
    3. libpng12.so.0 => /usr/lib/libpng12.so.0 (0x07afc000)
    4. libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x00de0000)
    5. libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x00d48000)
    6. libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x0080e000)
    7. libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x00816000)
    8. libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x0081e000)
    9. libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x00821000)
    10. libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x07888000)
    11. libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0082a000)
    12. libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0088f000)
    13. libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x00d25000)
    14. libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x008b6000)
    15. libQtCore_debug.so.4 => /usr/local/Trolltech/Qt-4.1.0/lib/libQtCore_debug.so.4 (0x00de8000)
    16. libz.so.1 => /usr/lib/libz.so.1 (0x00d35000)
    17. libdl.so.2 => /lib/libdl.so.2 (0x00c55000)
    18. libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0097e000)
    19. libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x07728000)
    20. libm.so.6 => /lib/tls/libm.so.6 (0x00c30000)
    21. libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00a5a000)
    22. libc.so.6 => /lib/tls/libc.so.6 (0x00b13000)
    23. libexpat.so.0 => /usr/lib/libexpat.so.0 (0x00990000)
    24. /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00afa000)
    To copy to clipboard, switch view to plain text mode 

    I know that these locations all exist.

    As for the initialization thing it's throwing out compile errors about an invalid conversion

    Qt Code:
    1. datagen.cpp: In constructor `DataGen::DataGen()':
    2. datagen.cpp:34: error: invalid conversion from `unsigned int' to `QTableWidget*
    3. '
    4. datagen.cpp:34: error: invalid conversion from `unsigned int' to `QTableWidget*
    5. '
    To copy to clipboard, switch view to plain text mode 

    Trying to solve that problem right now.

    Edit: The QTableWidget pointer doesn't seem to want to let me initialize it's address to a random memory location...
    Last edited by Hydragyrum; 12th September 2006 at 14:46. Reason: update/typo fix

  10. #10
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Another interesting development, my constructor isn't even called...I set a breakpoint at the start of my constructor, and I get the same error, ie the segfault.

    although at least main is being called

    the segfault occurs when trying to initialize my primary class.

    GDB dump follows:

    12 DataGen * d = new DataGen();
    (gdb)
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.

    Program received signal SIGSEGV, Segmentation fault.
    0x00f14c67 in QObject::connect (sender=0x816cea0, signal=0x805c630 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x80fe688,
    method=0x805c5fc "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
    2134 kernel/qobject.cpp: No such file or directory.
    in kernel/qobject.cpp
    I should clarify, I have a couple breakpoints set to the start of my default constructor, and the start of the main function. using next, I went along until it segfaulted. Had the constructor been called, I'd have hit the breakpoint at the constructor.
    Last edited by jacek; 12th September 2006 at 15:12. Reason: changed [ code ] to [ quote ] to allow wrapping

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Quote Originally Posted by Hydragyrum
    /usr/local/Trolltech/Qt-4.1.0/lib/libQtGui_debug.so.4
    /usr/local/Trolltech/Qt-4.1.0/lib/libQtCore_debug.so.4
    Is that the only Qt4 version you have on your system?

    Quote Originally Posted by Hydragyrum
    datagen.cpp:34: error: invalid conversion from `unsigned int' to `QTableWidget*
    I forgot to add casts:
    Qt Code:
    1. DataGen::DataGen() : m_munPhRanges( (QTableWidget*)0xdeadbeef ), m_munPkRanges( (QTableWidget*)0xcafebabe )
    To copy to clipboard, switch view to plain text mode 
    When it crashes just check whether these adresses are different.

    Do you do anything else (except for initialization and connections) with m_munPhRanges and m_munPkRanges? Maybe you delete them by accident?

  12. #12
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    pretty sure I don't delete them, let Qt take care of that when the class gets nuked.

    As far as I know, that's the only Qt4 version that exists on this machine.

    the tables are not even declared yet at the point of the crash, since the constructor isn't even called...but it's somehow entering the setUpConnections function, which is only called from within the constructor...and I'm not sure why...

    all optimization flags are off, btw.
    Last edited by Hydragyrum; 12th September 2006 at 15:35.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Did you try to run "make clean && make"? Did you enable warnings during compilation?

    Does this crash?
    Qt Code:
    1. #include <QApplication>
    2.  
    3. int main( int argc, char **argv )
    4. {
    5. QApplication app( argc, argv );
    6. QObject::connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( aboutQt() ) );
    7. return 0;
    8. }
    To copy to clipboard, switch view to plain text mode 

  14. #14
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    I've done make clean && make many times

    all warnings are enabled, only one I get it the one about the slot not using one of the parameters, but that's usually a harmless warning.

    That code compiles and runs without incident.

    Attempting to print out the address of the m_munPhRanges table at the point of the crash yields the following, which I've never seen before...
    Qt Code:
    1. (gdb) print DataGen::m_munPhRanges
    2. $1 = (class QTableWidget (* DataGen::&)) DataGen::QMainWindow + 168 bytes
    To copy to clipboard, switch view to plain text mode 
    Last edited by Hydragyrum; 12th September 2006 at 15:47.

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Quote Originally Posted by Hydragyrum
    That code compiles and runs without incident.
    Then most likely there is something in your application that causes the crash, since QObject::connect() itself works.

    Maybe this will shed some light (you will have to add #include <QtDebug>):
    Qt Code:
    1. void DataGen::setUpConnections()
    2. {
    3. qDebug() << m_munPhRanges->rowCount() << m_munPkRanges->rowCount();
    4. qDebug() << this->metaObject()->className();
    5. ...
    6. }
    To copy to clipboard, switch view to plain text mode 
    Does it crash on qDebug()?

  16. #16
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    I have a feeling it's not initializing the tables at all...but it's wierd.

    The backtrace clearly shows it entering the setUpConnections function from line 45. but if I set a breakpoint at say line 39, which is still inside my constructor, the breakpoint is never reached...

    here's the steps I did in gdb and the output:

    (gdb) info break
    Num Type Disp Enb Address What
    1 breakpoint keep y 0x0804d1a1 in DataGen at datagen.cpp:39
    (gdb) run
    The program being debugged has been started already.
    Start it from the beginning? (y or n) y
    Starting program: /home/abertrand/test/datagen/datagen_debug
    Error while mapping shared library sections:
    : Success.
    Error while reading shared library symbols:
    : No such file or directory.
    [Thread debugging using libthread_db enabled]
    [New Thread -150503296 (LWP 9579)]
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Qt: gdb: -nograb added to command-line options.
    Use the -dograb option to enforce grabbing.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.
    Error while reading shared library symbols:
    : No such file or directory.

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -150503296 (LWP 9579)]
    0x00427c67 in QObject::connect (sender=0x885cea0, signal=0x805c670 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x87ee688,
    method=0x805c63c "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
    2134 kernel/qobject.cpp: No such file or directory.
    in kernel/qobject.cpp
    (gdb) bt
    #0 0x00427c67 in QObject::connect (sender=0x885cea0, signal=0x805c670 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x87ee688,
    method=0x805c63c "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
    #1 0x080563d8 in DataGen::setUpConnections (this=0x87ee688) at datagen.cpp:553
    #2 0x0804d4b4 in DataGen (this=0x87ee688) at datagen.cpp:45
    #3 0x08057da7 in main (argc=1, argv=0xfeef1054) at main.cpp:13
    A similar breakpoint set at line 45 in datagen.cpp is also not being hit, even though the backtrace claims to reach it.

    The question is now how is the function being called, if it's never being called?

    here's the output of our little experiment, along with a backtrace:

    Qt Code:
    1. Program received signal SIGSEGV, Segmentation fault.
    2. [Switching to Thread -150552448 (LWP 9661)]
    3. 0x0069de2c in QTableWidgetPrivate::q_func (this=0x0) at itemviews/qtablewidget.cpp:1239
    4. 1239 itemviews/qtablewidget.cpp: No such file or directory.
    5. in itemviews/qtablewidget.cpp
    6. (gdb) bt
    7. #0 0x0069de2c in QTableWidgetPrivate::q_func (this=0x0) at itemviews/qtablewidget.cpp:1239
    8. #1 0x0069d39c in QTableWidgetPrivate::model (this=0x0) at itemviews/qtablewidget.cpp:1242
    9. #2 0x00699034 in QTableWidget::rowCount (this=0x88db890) at itemviews/qtablewidget.cpp:1538
    10. #3 0x08056859 in DataGen::setUpConnections (this=0x8868688) at datagen.cpp:553
    11. #4 0x0804d940 in DataGen (this=0x8868688) at datagen.cpp:46
    12. #5 0x08058643 in main (argc=1, argv=0xfeefbb64) at main.cpp:13
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 12th September 2006 at 16:14. Reason: changed [ code ] to [ quote ] to allow wrapping

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Quote Originally Posted by Hydragyrum
    1 breakpoint keep y 0x0804d1a1 in DataGen at datagen.cpp:39
    #2 0x0804d4b4 in DataGen (this=0x87ee688) at datagen.cpp:45
    These two addresses are a bit too far away for me.

    Quote Originally Posted by Hydragyrum
    #0 0x0069de2c in QTableWidgetPrivate::q_func (this=0x0) at itemviews/qtablewidget.cpp:1239
    This clearly shows that QTableWidget wasn't initialized properly or something has happened to it. Maybe it was overwritten? In that case valgrind might help.

    Another test:
    Qt Code:
    1. #include <QApplication>
    2. #include <QTableWidget>
    3.  
    4. int main( int argc, char **argv )
    5. {
    6. QApplication app( argc, argv );
    7.  
    8. QTableWidget *m_munPhRanges = new QTableWidget();
    9. m_munPhRanges->setRowCount( 3 );
    10. m_munPhRanges->setColumnCount( 5 );
    11. m_munPhRanges->setFixedSize( 635, 110 );
    12. m_munPhRanges->setRowHeight( 0, 20 );
    13. m_munPhRanges->setRowHeight( 1, 20 );
    14. m_munPhRanges->setRowHeight( 2, 20 );
    15.  
    16. QObject::connect( m_munPhRanges, SIGNAL( cellClicked( int, int ) ),
    17. &app, SLOT( aboutQt() ) );
    18.  
    19. m_munPhRanges->show();
    20.  
    21. return app.exec();
    22. }
    To copy to clipboard, switch view to plain text mode 

  18. #18
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    the addresses just pointed out something interesting, possibly with GDB being broken on this machine...

    1 breakpoint keep y 0x0804d6a9 in DataGen at datagen.cpp:46
    #4 0x0804d940 in DataGen (this=0x90d4688) at datagen.cpp:46

    ...these should be the same, no?

    the above code works.

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    Quote Originally Posted by Hydragyrum
    ...these should be the same, no?
    IMO they should, but I don't use gdb a lot. Maybe this address changes when you restart your application? Or maybe grsecurity/PAX/whatever messes those addresses?

    Quote Originally Posted by Hydragyrum
    the above code works.
    What happens when you put those qDebug() statements at the end of setUpWidgets()? If it crashes, try to move them somewhere around the middle of that method. If it still crashes move it up, if not --- down. Maybe this way you will locate the source of the problem.

  20. The following user says thank you to jacek for this useful post:

    Hydragyrum (12th September 2006)

  21. #20
    Join Date
    Mar 2006
    Location
    kingston.on.ca
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Interesting little Segfault w/r to signal/slot connection

    just tried the build on the windows box to see if it was a machine dependent thing, GDB shows a similar offset between the actual breakpoint, and where it says the function is in the stack...

    It also crashes at exactly the same point in Windows as well...

Similar Threads

  1. Interesting tutorial on UI Designer
    By GreyGeek in forum Qt Tools
    Replies: 1
    Last Post: 6th August 2006, 08:43
  2. segfault
    By conexion2000 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2006, 12:34
  3. Why does setTextColor() cause a segfault?
    By johnny_sparx in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2006, 16:58
  4. Replies: 10
    Last Post: 10th February 2006, 00:15
  5. use interesting QWT Library with QT3.X
    By raphaelf in forum Qwt
    Replies: 2
    Last Post: 23rd January 2006, 11:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.