io-net stack size

When I check the memory usage of io-net I get the following:
$ pidin m | grep io-net
57356 1 sbin/io-net 10o SIGWAITINFO 52K 560K
8192(516K)*
57356 2 sbin/io-net 10o RECEIVE 52K 560K 8192(12K)
57356 3 sbin/io-net 10o RECEIVE 52K 560K 4096(12K)
57356 4 sbin/io-net 18o RECEIVE 52K 560K 8192(12K)
57356 5 sbin/io-net 10o RECEIVE 52K 560K 4096(12K)
57356 6 sbin/io-net 15o RECEIVE 52K 560K 4096(132K)
57356 7 sbin/io-net 21o RECEIVE 52K 560K 4096(132K)
57356 8 sbin/io-net 10o RECEIVE 52K 560K 4096(132K)
57356 12 sbin/io-net 10o CONDVAR 52K 560K 4096(132K)

I’m having trouble with my filter crashing. It turns out that I’m simply
overrunning my stack and as a result dying with a SIGSEGV. Why is the stack
size of an io-net thread so small by default? As I understand it, QNX uses a
lazy stack allocation method where stack segments are only allocated as
they’re needed. So, there’s no need to artificially reduce the max stack
size to the limit of 12k seen above. Why then does QNX do this?

Now on to the solution. How do I fix this? pthread_attr_setstacksize()
modifies a pthread_attr_t structure which can be passed to pthread_create().
This doesn’t affect the max stack size of the current thread though.
Alternatively, I can modify my program to use less stack space and more heap
space.

Thanks,
Shaun

In 6.2, the stack sizes as reported here have been increased and
there is a command line option to npm-tcpip.so to increase its
stacksize.

-seanb

Shaun Jackman <sjackman@nospam.vortek.com> wrote:
: When I check the memory usage of io-net I get the following:
: $ pidin m | grep io-net
: 57356 1 sbin/io-net 10o SIGWAITINFO 52K 560K
: 8192(516K)*
: 57356 2 sbin/io-net 10o RECEIVE 52K 560K 8192(12K)
: 57356 3 sbin/io-net 10o RECEIVE 52K 560K 4096(12K)
: 57356 4 sbin/io-net 18o RECEIVE 52K 560K 8192(12K)
: 57356 5 sbin/io-net 10o RECEIVE 52K 560K 4096(12K)
: 57356 6 sbin/io-net 15o RECEIVE 52K 560K 4096(132K)
: 57356 7 sbin/io-net 21o RECEIVE 52K 560K 4096(132K)
: 57356 8 sbin/io-net 10o RECEIVE 52K 560K 4096(132K)
: 57356 12 sbin/io-net 10o CONDVAR 52K 560K 4096(132K)

: I’m having trouble with my filter crashing. It turns out that I’m simply
: overrunning my stack and as a result dying with a SIGSEGV. Why is the stack
: size of an io-net thread so small by default? As I understand it, QNX uses a
: lazy stack allocation method where stack segments are only allocated as
: they’re needed. So, there’s no need to artificially reduce the max stack
: size to the limit of 12k seen above. Why then does QNX do this?

: Now on to the solution. How do I fix this? pthread_attr_setstacksize()
: modifies a pthread_attr_t structure which can be passed to pthread_create().
: This doesn’t affect the max stack size of the current thread though.
: Alternatively, I can modify my program to use less stack space and more heap
: space.

: Thanks,
: Shaun