Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2004 20:54:28 -0800
From:      Chuck McManis <cmcmanis@mcmanis.com>
To:        Abel Navarro <abel@endace.com>, freebsd-questions@freebsd.org
Subject:   Re: time() segmentation fault
Message-ID:  <6.0.0.22.2.20040321205206.0285ae60@66.125.189.29>
In-Reply-To: <200403221724.14033.abel@endace.com>
References:  <200403221724.14033.abel@endace.com>

next in thread | previous in thread | raw e-mail | index | archive | help

At 09:24 PM 3/21/2004, Abel Navarro wrote:
>Hi all,
>this program ends with a segmentation fault in a FreeBSD 5.1.2-RELEASE:
>
>main() { time(); }

Good for it! Seeing as time takes a pointer to a time_t, not passing it one 
would use what ever happened to be on the stack as a pointer.

>I don't have made important changes to the release except cosmetic ones. I'm
>running the Linux compatibility module and have compiled with gcc 3.3.3. Any
>ideas are welcome.

Change it to
main() { time(0); }

And tell us if it crashes then.

--Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20040321205206.0285ae60>