Automatic vector re-size causes system crash.


I have a fairly large C++ programme running on QNX 6.3. There are 2 different point in the code, both in threads that act on socket activity. Data is received from the socket and then added to a vector. When the vector reaches capacity (low, either in the 60s or 100s) and the system has to re–size the vector (not the first time it has re-sized this particular vector) the system crashes. I have tried creating the thread with larger stack sizes, and with lazy and non lazy stacks. The exact same point in what should be an easily manageable data stream causs the crash every time. Does anyone know of any memory issues or have any ideas what I might be doing wrong?



Unless you have run out of physical memory (or you have exceeded the pre-allocated virtual stack), then there is a bug in the vector resize code.

I believe that the default is 132KB of virtual stack (per thread). Are you using anywhere near 132KB of stack in a single thread?


Thanks, I don’t think that I am using more than 132kb in a thread, and even if I was I would think some of the stack sizes I have specified would have countered this. I will check it out though.

Thanks again,