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)"

[marius@mars 
/opt/local/var/macports/sources/github.com/macports/macports-ports]# portindex
Creating port index in 
/opt/local/var/macports/sources/github.com/macports/macports-ports
Segmentation fault (core dumped)
[marius@mars 
/opt/local/var/macports/sources/github.com/macports/macports-ports]# gdb 
/opt/local/libexec/macports/bin/tclsh8.5 ./tclsh8.5.core
GNU gdb (GDB) 10.2 [GDB v10.2 for FreeBSD]
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/local/libexec/macports/bin/tclsh8.5...
[New LWP 111376]
Core was generated by `/opt/local/libexec/macports/bin/tclsh8.5 
/opt/local/bin/portindex'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000080058a25f in strlen () from /lib/libc.so.7
(gdb) where
#0  0x000000080058a25f in strlen () from /lib/libc.so.7
#1  0x0000000800325321 in Tcl_NewStringObj (bytes=0xa51b60 <error: Cannot 
access memory at address 0xa51b60>, length=-1) at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclStringObj.c:267
#2  0x0000000801290041 in MktempCmd (clientData=<optimized out>, 
interp=0x800a52550, objc=<optimized out>, objv=<optimized out>) at mktemp.c:99
#3  0x00000008002a87e7 in TclEvalObjvInternal (interp=<optimized out>, 
interp@entry=0x800a52550, objc=<optimized out>, objc@entry=2, 
objv=objv@entry=0x800a62f70,
    command=0x800ae8db2 "mktemp \"/tmp/mports.portindex.XXXXXXXX\"]\nset fd 
[open $tempportindex w]\nset save_prefix ${macports::prefix}\n\n# keys for a 
normal portindex\nforeach key {categories depends_fetch depends_extract 
depends"..., length=<optimized out>, flags=<optimized out>, flags@entry=0)
    at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:3734
#4  0x00000008002a94c6 in TclEvalEx (interp=<optimized out>, 
interp@entry=0x800a52550, script=0x800ae8db2 "mktemp 
\"/tmp/mports.portindex.XXXXXXXX\"]\nset fd [open $tempportindex w]\nset 
save_prefix ${macports::prefix}\n\n# keys for a normal portindex\nforeach key 
{categories depends_fetch depends_extract depends"..., numBytes=39, 
flags=<optimized out>,
    flags@entry=0, line=<optimized out>, line@entry=0, clNextOuter=<optimized 
out>, outerScript=0x800ae6750 "#!/opt/local/libexec/macports/bin/tclsh8.5\n# 
-*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; 
c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4\n# 
Traverse through "...)
    at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:4433
#5  0x0000000800317eab in TclSubstTokens (interp=interp@entry=0x800a52550, 
tokenPtr=tokenPtr@entry=0x800a62998, count=1, 
tokensLeftPtr=tokensLeftPtr@entry=0x0, line=<optimized out>, 
clNextOuter=0x8080808080808080,
    outerScript=0x800ae6750 "#!/opt/local/libexec/macports/bin/tclsh8.5\n# -*- 
coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 
4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4\n# Traverse through "...) 
at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclParse.c:2320
#6  0x00000008002a9108 in TclEvalEx (interp=<optimized out>, 
interp@entry=0x800a52550, script=0x800ae6750 
"#!/opt/local/libexec/macports/bin/tclsh8.5\n# -*- coding: utf-8; mode: tcl; 
tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4\n# Traverse through "..., 
numBytes=1493, flags=<optimized out>,
    flags@entry=0, line=<optimized out>, line@entry=1, clNextOuter=<optimized 
out>, clNextOuter@entry=0x0, outerScript=0x800ae6750 
"#!/opt/local/libexec/macports/bin/tclsh8.5\n# -*- coding: utf-8; mode: tcl; 
tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4\n# Traverse through "...)
    at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:4321
#7  0x00000008002a8c5a in Tcl_EvalEx (interp=0xa51b60, 
interp@entry=0x800a52550, script=0xffffffff <error: Cannot access memory at 
address 0xffffffff>, numBytes=5903808, flags=10820448, flags@entry=0) at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:4090
#8  0x0000000800305b68 in Tcl_FSEvalFileEx (interp=interp@entry=0x800a52550, 
pathPtr=0x800a5bd30, encodingName=<optimized out>) at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclIOUtil.c:1859
#9  0x000000080030b950 in Tcl_Main (argc=<optimized out>, argv=<optimized out>, 
appInitProc=0x2019c0 <Tcl_AppInit>) at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclMain.c:443
#10 0x00000000002019b0 in main (argc=10820448, argv=0xffffffff) at 
/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../unix/tclAppInit.c:85

Marius
__
Marius Schamschula

Reply via email to