Hi everybody,
I am working on a multitasking C++ project in QNX 4.25. One of the tasks was
developed under Windows NT and fully unit tested. Its integration with the
other tasks (these were developed with Watcom 10.6 under QNX 4.23 and have
been working in a different context for years) was also tested under Windows
NT, however, using simulation software that mimicked the behaviour of these
tasks through their interface descriptions. Everything was fine. Then came
the time when I needed to port the application to the target platform. I
recompiled and linked the Windows-developed code with Watcom 10.6 under QNX
4.25. Then, I tried to run the application. The Windows-developed task would
run up to a certain point at which the application starts to create 35
objects on the heap (in a function, pointers to these dynamic objects are
created using the keyword “new”, which causes the class constructor to be
called, in which “calloc” is used to allocate memory for the newly created
object), the largest of which is 1600 Bytes in size; about half of these
objects are only 1 Byte in size.
I played with the HEAPSIZE, STACK, and OFFSET parameters in the call to the
linker (in the original makefile for the legacy tasks created for QNX 4.23
the values used for these parameters were 48K, 32K, 40K, respectively),
suspecting that the problem lay in how the compiler/linker created the
addresses for the code. The funny thing is, in some cases the task would
terminate at around the point where the 3rd or 4th object was being created;
in other cases, it would simply halt around the same area, without
terminating.
I would appreciate any comments on this situation.
Thank you,
Orhan.