3

For: QNX Software Development Platform 6.5.0

I have run into a problem on a QNX 6.5.0 system where my program silently exists, and has been found to be due to a race condition similar to this post here: Thread stops randomly in the middle of a while loop

I have done some research and found that QNX has some built in tools to monitor memory and detect any leaks that are present in the program, however the instructions I have come across are for the QNX 6.5.0 IDE GUI, and I am running QNX on a server in command line.

example: http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.ide.userguide%2Ftopic%2Fmemory_DetecMemLeaks_.html

I'm kind of stuck with this as there isn't really a simple way to do this as the software designed is for logging purposes and is taking thousands of entries per second, and silently exists after a few hours. So I can't sit here waiting 2 hours each round.

Has anyone had experience with debugging mem leaks in QNX?

Edit: I am also using boost::lockfree::spsc_queue which may be causing the crash.

Usama Abdulrehman
  • 1,041
  • 3
  • 11
  • 21
  • Why do you think that your program has leaks? – cassandrad May 26 '20 at 08:54
  • @cassandrad just a theory at the moment which came from the "Thread stops randomly in the middle of a while loop" post. There's really no reason the program should be crashing as it runs for about 2-3 hours before silently exiting –  May 26 '20 at 09:37
  • Tools that monitor memory leaks will not help you to understand why does your program terminates unexpectedly. They work for short periods of time and just show temporal increase in memory consumption. You need to understand why you app has been terminated and look for system logs/events first. – cassandrad May 26 '20 at 09:45
  • @cassandrad understood. thank you. –  May 26 '20 at 10:06

1 Answers1

1

I was able to solve this by utilising Valgrind. I compiled my program and valgrind for linux and was able to debug my issue this way.