Results 1 to 20 of 23

Thread: segmentation fault

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: segmentation fault

    Nothing has been assigned to "this->callApplication" by the time of connect(). In other words, it's an uninitialized pointer pointing to random memory garbage.
    J-P Nurmi

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 19 Times in 19 Posts

    Default Re: segmentation fault

    Quote Originally Posted by jpn View Post
    Nothing has been assigned to "this->callApplication" by the time of connect(). In other words, it's an uninitialized pointer pointing to random memory garbage.
    Again too slow!

  3. #3
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    39

    Default Re: segmentation fault

    i got it, but if i try to do in this way
    clientSocket.cpp
    Qt Code:
    1. ClientSocket::ClientSocket(QTextBrowser *textBrowser):callApplication(NULL)
    2. {
    3. //callApplication = new CallApplication(this->textBrowserPark);
    4. connect(this->callApplication, SIGNAL(error()), this, SLOT(generateError()));
    5. }
    To copy to clipboard, switch view to plain text mode 

    in this way i don't have the segmentation fault but this error:
    QObject::connect: Cannot connect (null)::error() to ClientSocket::generateError()
    anyway when i emit the error signal the callApplication class is already initialized cos i have called the readClient() method...

  4. #4
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 19 Times in 19 Posts

    Default Re: segmentation fault

    move the connect statement to your readClient()-method then.

  5. The following user says thank you to DeepDiver for this useful post:

    mattia (6th November 2007)

  6. #5
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    39

    Default Re: segmentation fault

    Done. Now it's ok. Thanks so much!

Similar Threads

  1. Segmentation Fault
    By Krish_ng in forum Qt Programming
    Replies: 8
    Last Post: 7th August 2007, 10:49
  2. Process aborted. Segmentation fault
    By Pragya in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2007, 08:12
  3. Segmentation fault running any QT4 executables
    By jellis in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2007, 16:35
  4. why does qt program meet segmentation fault?
    By wquanw in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 15th May 2006, 16:52
  5. Icons missing => segmentation fault
    By antonio.r.tome in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2006, 16:30

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
  •  
Qt is a trademark of The Qt Company.