Results 1 to 3 of 3

Thread: QTcpServer and GDB

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QTcpServer and GDB

    I have a little server that uses QTcpServer and when i run it through my debugger (GDB) , it will give me a segmentation fault

    It will fault @QTcpServer::listen() method.

    but without the debugger meaning run and compiled it with debug mode it runs fine and happy?

    this really confused the heck out of me? anybody knows why?

    baray98

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTcpServer and GDB

    You have "undefined behaviour" somewhere in your code. As debug and release builds have different memory layouts, and different timings - esp. when run in gdb - you are 'lucky' to get the crash and thus notice an error in your code.

    If you crash in that method, I would guess that the QTcpServer is not a valid object.
    For real answers, we need to see your code. Try to strip it down to the relevant parts and provide a compilable example please.

  3. #3
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTcpServer and GDB

    I have fixed my problem by upgrading my GDB from 6.3 to 6.7

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.