Problem using MacPorts bash in MacOS Terminal

Richard L. Hamilton rlhamil at smart.net
Fri Nov 29 03:45:59 UTC 2024


Try this to see what libraries it's loading:
sh-3.2$ otool -L /opt/local/bin/bash
/opt/local/bin/bash:
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

A login shell at least (don't know for sure about Terminal preferences) should be in /etc/shells. That may or may not exist. If not, it should be populated with the default entries as well as what you want. Mine looks like this:
========== cut here ==========
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/pwsh
========== cut here ==========

The lines other than the last one there are the default, or were at the time I dug that out of whatever system library it was hardcoded in - which is hard to find now, since the actual dylib files no longer exist but are treated by dyld as references to something hidden in its cache. (that means that the otool -L output above is misleading, too). The rude thing is that the shells(5) man page (at least on Monterey) doesn't list the hardcoded defaults.


> On Nov 28, 2024, at 21:47, Steve Schow <steve at bstage.com> wrote:
> 
> I am new to MacPorts, so please excuse if this is dumb question.
> 
> I installed macports bash with the intention to use it as my primary shell with Terminal.app.  But when I configured Terminal to use /opt/local/bin/bash as the shell, then I get crashing behavior.  Specifically I can launch the terminal new window, it will open up the terminal window with bash running.  However if I type in an unknown command, it crashes with the following:
> 
> Steves-MacBook-Air:~ sjs$ lasdfasdf
> objc[61030]: +[Swift.__SharedStringStorage initialize] may have been in progress in another thread when fork() was called.
> objc[61030]: +[Swift.__SharedStringStorage initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
> Abort trap: 6
> Steves-MacBook-Air:~ sjs$ 
> 
> If I run /opt/local/bin/bash another level deeper, then that instance of bash works as expected without crashing…
> 
> So what do I need to do in order to use /opt/local/bin/bash as my primary login shell under Terminal.app?
> 
> My suspicion is that when it’s first launched, it does not have /opt/local in the path yet until .bashrc is loaded later.  And so I’m theorizing that it’s linking up the wrong libraries or something from my MacOS Sequoia system.  On the other hand once I’m in the broken shell, how the path is set from .bashrc, so running bash again, then links up the second bash instance with the right underlying libs.  Just guessing out loud…
> 
> But anyone know what we need to do in order to use /opt/local/bin/bash as primary shell from Terminal.app?
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20241128/c58f8235/attachment.htm>


More information about the macports-users mailing list