PDA

View Full Version : QTcpServer and GDB



baray98
15th January 2009, 08:11
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

caduel
15th January 2009, 08:50
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.

baray98
21st January 2009, 08:02
I have fixed my problem by upgrading my GDB from 6.3 to 6.7