Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Peter Edwards
On Tue, 25 Jan 2005 14:04:45 -0800, Julian Elischer <[EMAIL PROTECTED]> wrote: > > > Jose Hidalgo Herrera wrote: > > >The line causing the SEGFAULT is > >rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); > > > >Why?, because t is declared as: > >int t; > >then you say: > >args for s

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
> > > >This will be what you want: > >rc = pthread_create(&threads[t], NULL, PrintHello, (void *) & t); > > > > probably we shouldn't crash the system however.. (it is crashing right? > that wasn't so clear to me). the user land prog SEG fault itself, it did not bring down the system though, i am n

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
Hi, THanks a lot for the reply! in the call to pthread_create(), i cast _t_ to a void pointer, since that is pthread_create() function prototype asks for.. then in line > printf("\n%d: Hello World!\n", threadid); I use it as (cast it to) a _int_.. or i missed something here, is there a reason that

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
HI, Thanks for all the info! > kse_release() in this context isn't kernel code, its from libpthread. > The kernel equivalent of a segfault would generate a panic. > > Just in case: you're attempting to allocate more than 5000 threads: > Each one from main tries to recursively create 5000 more, and

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Yan Yu
Hi, thanks a LOT for looking into this. yes, that is exactly my output before the SEG fault happens (btw, i add "if (p)" before "p[id]++ ", the prob remains.. what confuses me is that, if the system is out of memory, then i should see the error returned from pthread_create() or calloc(), but not SE

Re: seg fault on kse_release () (fwd)

2005-01-26 Thread Peter Edwards
On Mon, 24 Jan 2005 14:27:53 -0800 (PST), Yan Yu <[EMAIL PROTECTED]> wrote: > Hi, all, I have a newbie Q: > I am trying to use creating large number of threads and allocting > memory to stress the system. > My user program causes SEG fault in the kernel code, kse_release () in > kern_kse.c. >

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Yan Yu
Cool, Thanks A LOT for looking into this! I appreciate it! after I reduce the BSIZE to 50k, it can create more than 10k threads before calloc error.. so i am going to drop this thread:) (just fyi, i use your prog on our machine w/ BSIZE =500k (~512M Ram), again i got SEG fault before the calloc err

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Jose Hidalgo Herrera
This is my last try!, it worked for me, I reached a little more that 1000 threads, then I got the calloc error. :-) #include #include #include #include #define NUM_THREADS 5000 #define THREADS_IN_ONE_PROCESS 5 #define BSIZE 50 static int cc; void *PrintHello(void *); pthread

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Julian Elischer
Jose Hidalgo Herrera wrote: The line causing the SEGFAULT is rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); Why?, because t is declared as: int t; then you say: args for start_routine in pthread_create are located in the address: t This will be what you want: rc = pthread_create(&t

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Jose Hidalgo Herrera
The line causing the SEGFAULT is rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t); Why?, because t is declared as: int t; then you say: args for start_routine in pthread_create are located in the address: t This will be what you want: rc = pthread_create(&threads[t], NULL, PrintHell

Re: seg fault on kse_release () (fwd)

2005-01-25 Thread Jose Hidalgo Herrera
I ran it into: 4.11-STABLE FreeBSD Wed Jan 19 15:23:33 CST 2005 What you find in http://www1.cr.freebsd.org/~jose/stress.tgz is the output of: ktrace ./a.out > stress.txt On Mon, 2005-01-24 at 14:27 -0800, Yan Yu wrote: > Hi, all, I have a newbie Q: > I am trying to use creating large numbe

seg fault on kse_release () (fwd)

2005-01-25 Thread Yan Yu
Hi, all, I have a newbie Q: I am trying to use creating large number of threads and allocting memory to stress the system. My user program causes SEG fault in the kernel code, kse_release () in kern_kse.c. (it SEG fault before the system can be stressed;( the stack when the SEG fault happens