[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with GNU C



On Tue, Jul 31, 2001 at 10:51:38AM +0600, Ilya Teterin wrote:
> Good daytime,
> 
> I write the program under GNU C. Has faced with a not clear problem. I
> have two box: 486 16 mb RAM and PIII. On both it is installed debian
> linux. On first my program (?in call of strlen()?) inside dispatch_connect
> function unexpectedly terminated, no error messages (such as "segmentation
> fault") are displayed. On the other box all works normal. In what a
> problem - in the program, hardware or OS? The code of the program:
> 
> http://www.npp-integris.ru/alien/spider.c

The only thing I can think of (since you didn't indicate what the
differences were between the two boxes) is the first argument you passed to
select(). I'm pretty sure you'll never have 31000 descriptors open and I'm
not even sure if the default fd_set can hold that many, leading to your
stack being trashed.

Other things: you should use snprintf, not sprintf and setting the 100th
byte to null is a waste of time.

HTH,
-- 
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.



Reply to: