Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2012 17:44:46 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Luca Pizzamiglio <luca.pizzamiglio@gmail.com>, Michael Scheidell <scheidell@FreeBSD.org>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: gdb75 dumps core on startup
Message-ID:  <503B87DE.6070209@FreeBSD.org>
In-Reply-To: <503B7E3B.9010306@FreeBSD.org>
References:  <503B7E3B.9010306@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 27/08/2012 17:03 Andriy Gapon said the following:
> Program terminated with signal 11, Segmentation fault
> ...
> #0  0x00000000004777e2 in i386_use_watchpoints ()
> #1  0x0000000000476bbd in _initialize_amd64fbsd_nat ()
> #2  0x000000000060deea in initialize_all_files ()
> #3  0x00000000005e710f in gdb_init ()
> #4  0x0000000000549086 in relocate_gdb_directory ()
> #5  0x0000000000547aa4 in catch_errors ()
> #6  0x0000000000548bb4 in gdb_main ()
> #7  0x0000000000457ea9 in main ()
> 
> This is on amd64 head.
> 

The problem seems to be caused by files/patch-gdb-amd64-nat.h, which for some
cryptic reason removes prototype of amd64bsd_target() from amd64-nat.h.  That
allows the code to be compilable still (sloppy gdb developers!) but the assumed
return type of the function becomes int instead of a pointer which it really is.
Thus, the returned pointer value gets truncated on amd64 and as a result an
invalid pointer is passed to i386_use_watchpoints() from _initialize_amd64fbsd_nat().

Oh, looking at the patch in PR ports/165357
(http://www.freebsd.org/cgi/query-pr.cgi?pr=165357), it seems that
amd64bsd_target() should have re-appeared in a new header file "amd64bsd-nat.h"...
 But that part of the patch seems to be incorrect in that it would create
files/amd64bsd-nat.h instead of a patch file to create amd64bsd-nat.h in the
source directory.  Apparently this file never made it as a result.

-- 
Andriy Gapon



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