Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Jun 2000 13:21:34 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        core-ix@hushmail.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Possible problem in find_symdef() 
Message-ID:   <200006031321.aa94910@salmon.maths.tcd.ie>
In-Reply-To: Your message of "  , 3 VI 2000 16:42:50 %2B0200 (GMT%2B03:00) ." <200006030847.BAA09423@mail3.hushmail.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200006030847.BAA09423@mail3.hushmail.com>, core-ix@hushmail.com wri
tes:
>--1081836336.960022034728.JavaMail.root@mail3.hushmail.com

>it hard to compile it under FreeBSD (however I can 
>compile it under Linux).I get "Buss error" and coredump

It's a simple programming error - you're not initialising the pointer
'q' in main(), so your code is overwriting memory at whatever junk
addresss ends up in q when main() is invoked. Add a
	
	q = malloc(sizeof(*q));

and it works. The compiler will spot this problem for you if you include
the options '-Wall -O':

> gcc -Wall -O -o q-pr q-pr.c
q-pr.c: In function `main':
q-pr.c:7: warning: `q' might be used uninitialized in this function

Ian


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




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