[mu bug] `mu` binary built using `make` crashes on ARM64 MAC OS
Describe the bug
The mu binary built from the distributed tar.gz crashes on ARM64 Mac OS X.
To Reproduce
- Download the tar.xz from: https://github.com/djcb/mu/releases/tag/v1.12.0
- Install using the steps described in the README
-
./autogen.sh -
make -
sudo make install
-
- After this step, I do see a
mubinary in my PATH created at/opt/homebrew/binlocation. However, when I try to get get the version ofmu, it crashes. Like so:
$ /opt/homebrew/bin/mu -V
[1] 44408 trace trap /opt/homebrew/bin/mu -V
It is worth noting that running mu command (without any arguments) succeeds:
$ /opt/homebrew/bin/mu
mu mail indexer/searcher
Copyright (C) 2008-2023 Dirk-Jan C. Binnema
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.
Usage: mu [OPTIONS] [SUBCOMMAND]
Options:
-V,--version Display program version information and exit
-h,--help Show help informmation
--help-all
-q,--quiet Hide non-essential output
-v,--verbose Show verbose output
--nocolor [<false>] Don't show ANSI colors
Subcommands:
add Add message(s) to the database
cfind Find contacts matching pattern
extract Extract MIME-parts from messages
fields Superseded by 'mu info'
find Find messages matching query
help Show help information
index Store message information in the database
info Show information
init Initialize the database
mkdir Create a new Maildir
move Move a message or change flags
remove Remove message from file-system and database
server Start a mu server (for mu4e)
verify Verify cryptographic signatures
view View specific messages
Scripts:
find-dups Find duplicate messages
histogram Histogram of the number of messages per time-unit
msgs-count Count the number of messages matching some query
Environment
- OS: Mac OS X, Arm64 arch
-
muversion: 1.12.0 (latest release from 4 days ago) - Emacs: 29.1
Checklist
- [ ] you are running either the latest 1.8.x/1.10.x release or
master(otherwise, please upgrade).
Can you try make check? That will run the unit tests, and may give some clue.
If you are able to use a debugger (gdb or lldb), can you try to run the mu -V and provide a backtrace? Thanks.
I come from https://github.com/Homebrew/homebrew-core/pull/164231, however, if I compile manually, there is no problem on my side (Arm64), I don't know if I can help provide some information.
I'm running into the same problem using the port at https://github.com/macports/macports-ports/blob/c1c775efafd7bc9732e9dd5258af6596f22402ba/mail/mu/Portfile .
~> mu -V
fish: Job 1, 'mu -V' terminated by signal SIGBUS (Misaligned address error)
~ [138]> lldb mu -- -V
(lldb) target create "mu"
Current executable set to '/opt/local/bin/mu' (arm64).
(lldb) settings set -- target.run-args "-V"
(lldb) run
Process 40360 launched: '/opt/local/bin/mu' (arm64)
Process 40360 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=261, address=0xdac11410)
frame #0: 0x00000001b2fefb10 libunwind.dylib`_Unwind_GetIP + 224
libunwind.dylib`:
-> 0x1b2fefb10 <+224>: autib x16, x0
0x1b2fefb14 <+228>: mov x17, x16
0x1b2fefb18 <+232>: xpaci x17
0x1b2fefb1c <+236>: cmp x16, x17
Target 0: (mu) stopped.
(lldb)
Cloning the repo and running make check passes all the tests:
Ok: 45
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Building and running from source works fine.
Hmm, https://github.com/Homebrew/homebrew-core/pull/164231 is a build failure, the other one is a runtime failure.
The backtrace without symbols suggests there may be some compilation bug; esp also since a local build seems to work. Not sure what I can do about this. Perhaps the Macports folks know more?
Can you try
make check? That will run the unit tests, and may give some clue.If you are able to use a debugger (
gdborlldb), can you try to run themu -Vand provide a backtrace? Thanks.
Looks like a few of the unit tests are failing.
Failing tests:
25/46 test-xapian-db FAIL 1.15s killed by signal 5 SIGTRAP
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=196 /private/tmp/mu-1.12.1/build/lib/tests/test-xapian-db
31/46 test-cmd-add FAIL 1.88s killed by signal 6 SIGABRT
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=10 /private/tmp/mu-1.12.1/build/mu/tests/test-cmd-add
38/46 test-store FAIL 3.10s killed by signal 5 SIGTRAP
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=49 /private/tmp/mu-1.12.1/build/lib/tests/test-store
41/46 test-message FAIL 5.36s killed by signal 5 SIGTRAP
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=88 /private/tmp/mu-1.12.1/build/lib/message/tests/test-message
42/46 test-cmd-find FAIL 2.94s killed by signal 6 SIGABRT
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=132 /private/tmp/mu-1.12.1/build/mu/tests/test-cmd-find
Results summary
Ok: 40
Expected Fail: 0
Fail: 6
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Looking at one of the failing tests specifically:
=================================== 31/46 ====================================
test: test-cmd-add
start time: 02:56:08
duration: 1.88s
result: killed by signal 6 SIGABRT
command: UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=10 /private/tmp/mu-1.12.1/build/mu/tests/test-cmd-add
----------------------------------- stdout -----------------------------------
TAP version 13
# random seed: R02S8ed909c9d42866ca6b190a8c297e6dd0
# mu-DEBUG: run-command: '/bin/rm' '-fr' '/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-PF8FK2'
# mu-DEBUG: removed '/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-PF8FK2'
1..2
# Start of cmd tests
# Start of add tests
# mu-DEBUG: created create-overwrite / WritableDatabase() @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian (batch-size: 50000)
# mu-DEBUG: closing store @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian
# mu-DEBUG: closing db
# mu-DEBUG: run-command: '/private/tmp/mu-1.12.1/build/mu/mu' 'add' '--muhome=/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2' '/private/tmp/mu-1.12.1/testdata/testdir/cur/1220863042.12663_1.mindcrime!2,S'
# mu-DEBUG: created read-only / Database() @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian (batch-size: 50000)
# mu-DEBUG: closing store @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian
# mu-DEBUG: closing db
# mu-DEBUG: run-command: '/private/tmp/mu-1.12.1/build/mu/mu' 'add' '--muhome=/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2' '/private/tmp/mu-1.12.1/testdata/testdir/cur/1220863042.12663_1.mindcrime!2,S'
# mu-DEBUG: created read-only / Database() @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian (batch-size: 50000)
# mu-DEBUG: closing store @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-VK5FK2/xapian
# mu-DEBUG: closing db
ok 1 /cmd/add/ok
# slow test /cmd/add/ok executed in 0.77 secs
# mu-DEBUG: created create-overwrite / WritableDatabase() @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-FHBBK2/xapian (batch-size: 50000)
# mu-DEBUG: closing store @ /var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-FHBBK2/xapian
# mu-DEBUG: closing db
# mu-DEBUG: run-command: '/private/tmp/mu-1.12.1/build/mu/mu' 'add' '--muhome=/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-FHBBK2' '/private/tmp/mu-1.12.1/testdata/testdir/cur/1220863042.12663_1.mindcrime!2,S'
# mu-DEBUG: run-command: '/private/tmp/mu-1.12.1/build/mu/mu' 'add' '--muhome=/var/folders/4g/g02xvq957bn8bjr6wdvs1sgm0000gr/T/mu-tmp-FHBBK2' '/foo/bar/non-existent'
not ok /cmd/add/fail - ERROR:../mu/mu-cmd-add.cc:108:void test_add_fail(): assertion failed (res->exit_code != 0): (0 != 0)
Bail out!
----------------------------------- stderr -----------------------------------
**
ERROR:../mu/mu-cmd-add.cc:108:void test_add_fail(): assertion failed (res->exit_code != 0): (0 != 0)
I am still looking around, but it would be great if you can help with any pointers on how to debug this further.
I'm running into the same problem using the port at https://github.com/macports/macports-ports/blob/c1c775efafd7bc9732e9dd5258af6596f22402ba/mail/mu/Portfile .
~> mu -V fish: Job 1, 'mu -V' terminated by signal SIGBUS (Misaligned address error) ~ [138]> lldb mu -- -V (lldb) target create "mu" Current executable set to '/opt/local/bin/mu' (arm64). (lldb) settings set -- target.run-args "-V" (lldb) run Process 40360 launched: '/opt/local/bin/mu' (arm64) Process 40360 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=261, address=0xdac11410) frame #0: 0x00000001b2fefb10 libunwind.dylib`_Unwind_GetIP + 224 libunwind.dylib`: -> 0x1b2fefb10 <+224>: autib x16, x0 0x1b2fefb14 <+228>: mov x17, x16 0x1b2fefb18 <+232>: xpaci x17 0x1b2fefb1c <+236>: cmp x16, x17 Target 0: (mu) stopped. (lldb)Cloning the repo and running
make checkpasses all the tests:Ok: 45 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0Building and running from source works fine.
FWIW, I am getting the exact same backtrace.
I have the same issue with a version of mu build for nix: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/networking/mu/default.nix#L76
Hmm, this is hard to debug... perhaps there's some exception? In gdb I'd use catch throw and catch catch for that, guess we need to equivalent for lldb...
Is this still seen with 1.12.4? If so, can we get a backtrace with symbols, so we can see what's happening in mu?
Guess this problem is gone... if not, please re-open / file new ticket with the needed information - thank you!