<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Every now and then I try to get MacPorts to build and run on FreeBSD.<br />
<br />
Getting it to build requires less than a handful of edits.<br />
<br />
However, when running portindex I get a Segfault with a Signal 11.<br />
<br />
Here’s what gdb says (after recompiling with debug symbols enabled)"<br />
<br />
<span style="color:#000000;font-family:Menlo;font-size: 11px">[marius@mars /opt/local/var/macports/sources/github.com/macports/macports-ports]# portindex </span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Creating port index in /opt/local/var/macports/sources/github.com/macports/macports-ports</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Segmentation fault (core dumped)</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">[marius@mars /opt/local/var/macports/sources/github.com/macports/macports-ports]# gdb /opt/local/libexec/macports/bin/tclsh8.5 ./tclsh8.5.core </span><span style="font-size: 11px"><br /></span><strong style="color:#db27da;font-family:Menlo;font-size: 11px">GNU gdb (GDB) 10.2 [GDB v10.2 for FreeBSD]</strong><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Copyright (C) 2021 Free Software Foundation, Inc.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">This is free software: you are free to change and redistribute it.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">There is NO WARRANTY, to the extent permitted by law.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Type "show copying" and "show warranty" for details.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">This GDB was configured as "x86_64-portbld-freebsd13.0".</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Type "show configuration" for configuration details.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">For bug reporting instructions, please see:</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px"><https://www.gnu.org/software/gdb/bugs/>.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Find the GDB manual and other documentation resources online at:</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">    <http://www.gnu.org/software/gdb/documentation/>.</span><span style="font-size: 11px"><br /></span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">For help, type "help".</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Type "apropos word" to search for commands related to "word"...</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">Reading symbols from /opt/local/libexec/macports/bin/tclsh8.5...</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">[New LWP 111376]</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Core was generated by `/opt/local/libexec/macports/bin/tclsh8.5 /opt/local/bin/portindex'.</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">Program terminated with signal SIGSEGV, Segmentation fault.</span><span style="font-size: 11px"><br /></span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">#0  0x000000080058a25f in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">strlen</span><span style="color:#5620f4;font-family:Menlo;font-size: 11px"> () from </span><span style="color:#39c026;font-family:Menlo;font-size: 11px">/lib/libc.so.7</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">(gdb) where</span><span style="font-size: 11px"><br /></span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">#0  0x000000080058a25f in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">strlen</span><span style="color:#5620f4;font-family:Menlo;font-size: 11px"> () from </span><span style="color:#39c026;font-family:Menlo;font-size: 11px">/lib/libc.so.7</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">#1  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x0000000800325321</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">Tcl_NewStringObj</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">bytes</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=0xa51b60 <error: Cannot access memory at address 0xa51b60>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">length</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=-1) at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclStringObj.c:267</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">#2  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x0000000801290041</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">MktempCmd</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">clientData</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">objc</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">objv</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>) at </span><span style="color:#39c026;font-family:Menlo;font-size: 11px">mktemp.c</span><span style="color:#000000;font-family:Menlo;font-size: 11px">:99</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">#3  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x00000008002a87e7</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">TclEvalObjvInternal</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">objc</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">objc@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=2, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">objv=objv@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a62f70, </span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">    </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">command</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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"..., </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">length</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0)</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">    at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:3734</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">#4  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x00000008002a94c6</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">TclEvalEx</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">script</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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"..., </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">numBytes</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=39, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">    </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">line</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">line@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">clNextOuter</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">outerScript</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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 "...)</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">    at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:4433</span><span style="font-size: 11px"><br /></span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">#5  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x0000000800317eab</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">TclSubstTokens</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px"> (interp=interp@entry=0x800a52550, tokenPtr=tokenPtr@entry=0x800a62998, count=1, tokensLeftPtr=tokensLeftPtr@entry=0x0, line=<optimized out>, clNextOuter=0x8080808080808080, </span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">    </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">outerScript</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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 </span><span style="color:#39c026;font-family:Menlo;font-size: 11px">/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclParse.c</span><span style="color:#000000;font-family:Menlo;font-size: 11px">:2320</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">#6  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x00000008002a9108</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">TclEvalEx</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">script</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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 "..., </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">numBytes</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=1493, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">    </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">line</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">line@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=1, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">clNextOuter</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">clNextOuter@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x0, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">outerScript</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=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 "...)</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">    at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c:4321</span><span style="font-size: 11px"><br /></span><span style="color:#000000;font-family:Menlo;font-size: 11px">#7  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x00000008002a8c5a</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">Tcl_EvalEx</span><span style="color:#000000;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0xa51b60, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">script</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0xffffffff <error: Cannot access memory at address 0xffffffff>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">numBytes</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=5903808, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=10820448, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">flags@entry</span><span style="color:#000000;font-family:Menlo;font-size: 11px">=0) at </span><span style="color:#39c026;font-family:Menlo;font-size: 11px">/home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclBasic.c</span><span style="color:#000000;font-family:Menlo;font-size: 11px">:4090</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">#8  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x0000000800305b68</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">Tcl_FSEvalFileEx</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">interp=interp@entry</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=0x800a52550, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">pathPtr</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=0x800a5bd30, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">encodingName</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=<optimized out>) at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclIOUtil.c:1859</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">#9  </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x000000080030b950</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">Tcl_Main</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">argc</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">argv</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=<optimized out>, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">appInitProc</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=0x2019c0 <Tcl_AppInit>) at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../generic/tclMain.c:443</span><span style="font-size: 11px"><br /></span><span style="color:#39c026;font-family:Menlo;font-size: 11px">#10 </span><span style="color:#5620f4;font-family:Menlo;font-size: 11px">0x00000000002019b0</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> in </span><span style="color:#aaab25;font-family:Menlo;font-size: 11px">main</span><span style="color:#39c026;font-family:Menlo;font-size: 11px"> (</span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">argc</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=10820448, </span><span style="color:#38b9c7;font-family:Menlo;font-size: 11px">argv</span><span style="color:#39c026;font-family:Menlo;font-size: 11px">=0xffffffff) at /home/marius/Development/MacPorts/MacPorts-2.7.1/vendor/tcl/unix/../unix/tclAppInit.c:85</span><span style="font-size: 11px"><br /></span></div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">Marius
<div dir="auto">__</div>
<div dir="auto">Marius Schamschula</div>
</div>
</div>
</body>
</html>