Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 1999 00:31:11 +0100
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        James Snow <sno@teardrop.org>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Weird segfault
Message-ID:  <19990930003111.B10799@lithium.scientia.demon.co.uk>
In-Reply-To: <Pine.BSF.3.96.990929102030.53798A-100000@silver.teardrop.org>
References:  <Pine.OSF.4.10.9909282027170.23202-100000@fly.HiWAAY.net> <Pine.BSF.3.96.990929102030.53798A-100000@silver.teardrop.org>

next in thread | previous in thread | raw e-mail | index | archive | help
James Snow wrote:

> int main() {
>         printf("a:");
>         uptime();
>         printf("b:");
>         loadavg();
>         printf("c:\n");
>         return 0;
> }
> silver:~> gcc ut.c
> silver:~> ./a.out 
> a:6d 19h:29m:11s
> b:0.11 0.06 0.01
> c:
> Segmentation fault(core dumped)
> silver:~> 

Have you tried compiling it with -g and analyzing the core file with
gdb?

(Also, you probably meant int mib[2], rather than int mib[1], given that
you try to access mib[1], but it doesn't look like that's causing this
problem.)

-- 
Ben Smithurst            | PGP: 0x99392F7D
ben@scientia.demon.co.uk |   key available from keyservers and
                         |   ben+pgp@scientia.demon.co.uk


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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