From owner-freebsd-hackers Sat Jun 3 5:21:38 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id DCBD537B9ED for ; Sat, 3 Jun 2000 05:21:35 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 3 Jun 2000 13:21:34 +0100 (BST) To: core-ix@hushmail.com Cc: freebsd-hackers@freebsd.org Subject: Re: Possible problem in find_symdef() In-reply-to: Your message of " , 3 VI 2000 16:42:50 +0200 (GMT+03:00) ." <200006030847.BAA09423@mail3.hushmail.com> Date: Sat, 03 Jun 2000 13:21:34 +0100 From: Ian Dowse Message-ID: <200006031321.aa94910@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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