Hi
I have been able to spot the SIGSEGV on config reload problem on Cyril's
machine. The problem is caused by a low limit on the stack size when a
program is linked with -pthread (it does not happen on non threaded
program). I have a test program to check if it occurs:
# ulimit -s unlimited
# cat > x.c
#include <stdio.h>
void func(void);
int main(void) {
char buf[5 * 1024 * 1024]; /* 5 MB */
buf[sizeof(buf) - 1] = '\0'; /* Check we got the memory */
printf("before func\n");
func();
printf("after func\n");
return;
}
void func(void) {
printf("function\n");
return;
}
^D
# cc -pthread -o x x.c
# ./x
Segmentation fault
FreeBSD and Linux break on this. NetBSD is alright. Anyone wants to
check other systems?
Now the problem is spotted, anyone knows the fix? Is there some special
function to call in order to book a bigger stack for a thread?
--
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent
le binaire et ceux qui ne le comprennent pas.
manu@...Message
Config reload SIGSEGV in the spotlight
2004-05-29 by manu@netbsd.org
Attachments
- No local attachments were found for this message.