Re: SOS v2.0 - fork()
From: Martin Blume (mblume_at_socha.net)
Date: 08/30/03
- Previous message: Tauno Voipio: "Re: Allocating Page Aligned Memory in User Space"
- Next in thread: Martin Blume: "Re: SOS v2.0 - fork()"
- Maybe reply: Martin Blume: "Re: SOS v2.0 - fork()"
- Maybe reply: Martin Blume: "Re: SOS v2.0 - fork()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 30 Aug 2003 18:51:34 +0200
"Aaron" <coldhouse@163.com> schrieb
> it failed, showing "segementation fault".
> for ( i = 0; i < loop_cnt; i++ ) {
> ...
> ftimeout = fopen("ftimeout.dat", "w");
> ftimeout_test = fopen("ftimeout_test.dat", "w");
> ...
> }
In every round of the loop you are opening your log files again.
Take this out and see if it improves stability. My guess is that
sooner or later your process runs out of file descriptors so that
fopen returns -1. As you don't check the return value of fopen,
you'll write to an invalid file descriptor.
HTH
Martin
- Previous message: Tauno Voipio: "Re: Allocating Page Aligned Memory in User Space"
- Next in thread: Martin Blume: "Re: SOS v2.0 - fork()"
- Maybe reply: Martin Blume: "Re: SOS v2.0 - fork()"
- Maybe reply: Martin Blume: "Re: SOS v2.0 - fork()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|