[MacPorts] #68638: bash @5.2.15: When a "command not found" situation happens, Bash prints errors and ends with "Abort Trap: 6" instead of printing "Command not found"
MacPorts
noreply at macports.org
Fri Mar 8 15:33:07 UTC 2024
#68638: bash @5.2.15: When a "command not found" situation happens, Bash prints
errors and ends with "Abort Trap: 6" instead of printing "Command not
found"
----------------------+----------------------
Reporter: some1so | Owner: raimue
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: bash |
----------------------+----------------------
Comment (by DarrenStone):
Call stack:
{{{
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1864de72c
__abort_with_payload + 8
1 libsystem_kernel.dylib 0x186503f88
abort_with_payload_wrapper_internal + 104
2 libsystem_kernel.dylib 0x186503f20
abort_with_reason + 32
3 libobjc.A.dylib 0x186179484
_objc_fatalv(unsigned long long, unsigned long long, char const*, char*) +
128
4 libobjc.A.dylib 0x186179404
_objc_fatal(char const*, ...) + 44
5 libobjc.A.dylib 0x18615fc1c
performForkChildInitialize(objc_class*, objc_class*) + 400
6 libobjc.A.dylib 0x186146390
initializeNonMetaClass + 572
7 libobjc.A.dylib 0x1861461f0
initializeNonMetaClass + 156
8 libobjc.A.dylib 0x1861461f0
initializeNonMetaClass + 156
9 libobjc.A.dylib 0x186163304
initializeAndMaybeRelock(objc_class*, objc_object*,
locker_mixin<lockdebug::lock_mixin<objc_lock_base_t>>&, bool) + 164
10 libobjc.A.dylib 0x186145dc4
lookUpImpOrForward + 892
11 libobjc.A.dylib 0x186145764
_objc_msgSend_uncached + 68
12 libswiftCore.dylib 0x1961145e0 type metadata
accessor for __StringStorage + 24
13 libswiftCore.dylib 0x195eb63e8
String._bridgeToObjectiveCImpl() + 156
14 Foundation 0x187911930 specialized
LocaleCache.preferredLanguages(forCurrentUser:) + 76
15 Foundation 0x187afd428 @objc static
NSLocale._preferredLanguagesForCurrentUser(_:) + 44
16 CoreFoundation 0x1865ebbe4
CFLocaleCopyPreferredLanguages + 28
17 libintl.8.dylib 0x100ad93dc
_libintl_language_preferences_default + 68
18 libintl.8.dylib 0x100ad7d40
libintl_dcigettext + 812
19 bash 0x10057123c
execute_disk_command + 696
20 bash 0x10056c870
execute_simple_command + 3688
21 bash 0x10056a8e0
execute_command_internal + 3056
22 bash 0x100569c7c execute_command
+ 96
23 bash 0x10055a77c reader_loop +
728
24 bash 0x100559238 main + 4788
25 dyld 0x1861910e0 start + 2360
}}}
This has been a long-standing problem. See this comment:
https://trac.macports.org/ticket/41248#comment:13
However, the problem occurs all of the time, not just when LANG is unset.
Bash uses 'gettext' to generate localized error messages. If a child
process calls 'gettext' before the parent process has initialzied the
localization library then the child process will crash.
You can work around the problem by forcing the parent process to generate
a localized error message. Once that is done, child processes can produce
localized text correctly.
For example, you can type ";" on a single line to generate a localized
error message from the parent bash process:
{{{
$ foo
objc[10554]: +[__SwiftNativeNSStringBase initialize] may have been in
progress in another thread when fork() was called.
objc[10554]: +[__SwiftNativeNSStringBase 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
$ ;
-bash: syntax error near unexpected token `;'
$ foo
-bash: foo: command not found
}}}
--
Ticket URL: <https://trac.macports.org/ticket/68638#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list