Segfaults on FreeBSD

Rainer Müller raimue at macports.org
Wed Jun 23 18:43:51 UTC 2021


On 19/06/2021 17.58, atmail.dreamhost.com wrote:
> Every now and then I try to get MacPorts to build and run on FreeBSD.
> 
> Getting it to build requires less than a handful of edits.
> 
> However, when running portindex I get a Segfault with a Signal 11.
> 
> Here’s what gdb says (after recompiling with debug symbols enabled)"

> [...]

So it is failing at this point inside the Tcl_NewStringObj():
https://github.com/macports/macports-base/blob/v2.7.1/src/pextlib1.0/mktemp.c#L99

gdb already tells us that the pointer 0xa51b60 doesn't look good. But
mktemp() is never supposed to return anything else than either the
pointer given or NULL [1].

Could you try to break in gdb here in line 99 (after the call to mktemp)
and compare the variables sp and template? They must point to the same
memory address.

You could even check whether there is a proper C string terminated by
'\0' in memory... but actually gdb already told us it is not, because it
cannot access memory at this address. :-/

Rainer

[1] https://www.freebsd.org/cgi/man.cgi?mktemp(3)


More information about the macports-dev mailing list