CI: get a backtrace for the crash on MacOS

The count based half of the test, type 5, which writes the collocation
database, dies on macos-latest with "Trace/BPT trap: 5" after about 15% of the
training, while the word embedding half including the memory mappable
conversion passes.

It is not the rocksdb version: the same run passes on Linux against rocksdb
8.9.1 (ubuntu), 10.2.1 (fedora) and 11.0.4 (alpine, musl), the last one being
the version homebrew ships. It also passes with _GLIBCXX_ASSERTIONS, so it is
not something the assertions of libstdc++ catch either.

The job runs the failing command under lldb when it fails, so that the next run
says where it traps instead of only that it did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I109c3928f83240142e668343e843d97f44127c14
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 19685db..3bfddc8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -52,6 +52,20 @@
       - name: Test
         run: ctest --test-dir build --output-on-failure
 
+      # The count based part of the test traps on MacOS, while it runs on Linux
+      # with rocksdb 8.9, 10.2 and 11.0. Without a backtrace there is nothing to
+      # go by, so produce one.
+      - name: Backtrace of the crash (macOS)
+        if: failure() && runner.os == 'macOS'
+        run: |
+          D=$(mktemp -d)
+          ./build/dereko2vec -train tests/data/wpd19_10000.w2vinput -output "$D/m.vecs" \
+              -type 3 -save-vocab "$D/m.vocab" -size 50 -window 5 -negative 5 \
+              -threads 4 -iter 1 -min-count 2 -binary 1 > /dev/null 2>&1
+          lldb --batch -o run -o 'bt all' -o quit -- ./build/dereko2vec \
+              -train tests/data/wpd19_10000.w2vinput -output "$D/m.rocksdb" \
+              -type 5 -read-vocab "$D/m.vocab" -threads 8 2>&1 | tail -80
+
       # The training writes the memory mappable form of the model, which
       # derekovecs maps. vecs2mmap does the same for models trained earlier.
       - name: Check the memory mappable model form