Results 1 to 2 of 2

Thread: QAbstractSocket::abort() with SIGSEGV

  1. #1
    Join Date
    May 2007
    Location
    Warsaw, Poland
    Posts
    52
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QAbstractSocket::abort() with SIGSEGV

    I met quite confusing situation:
    I place brand new QTcpSocket and QUdpSocket on heap in main widget constructor.

    I used UDP socket (it worked fine) and then I added TCP socket. It does nothing.
    And now when the method shown below is executed I receive SIGSEGV:

    udpSocket->abort();
    tcpSocket->abort();

    gdb says:
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -1225090688 (LWP 6134)]
    QAbstractSocket::abort (this=0x0) at qabstractsocket.h:184
    184 qabstractsocket.h: No such file or directory.
    in qabstractsocket.h
    Current language: auto; currently c++
    but when I change it to:
    udpSocket->abort();
    tcpSocket->disconnectFromHost();

    everything goes well.

    What's the matter?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QAbstractSocket::abort() with SIGSEGV

    Either tcpSocket or udpSocket is a null pointer (notice that "this" is null). You probably have a local variable of the same name as a member variable of the class.

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.