Fix sig 11 crash on macOS when using a Japanese (or possibly other CJK type) keyboard #1652
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings,
I recently attempted to bathe in the nostalgia that is gameflorist/dunedynasty and immediately encountered a signal 11 crash. At first I assumed the problem was dunedynasty, but enough messing about with lldb showed me that it was actually liballegro5 that was crashing. Enough debugging with a -pg build showed me:
frame #2: 0x00000001050cb36c
liballegro.5.2.10.dylib`_al_osx_keyboard_handler(pressed=,
event=0x000060000390c300, dpy=0x0000000125832200) at keybd.m:280:69 [opt]
Digging a bit further I found that this is actually a fairly common problem; if you use a CJK type layout (Chinese, Japanese, or Korean) you can trigger it fairly easily. Discussions with suggested code fixes can be seen in places like:
https://github.com/microsoft/node-native-keymap/blob/main/src/keyboard_mac.mm
microsoft/vscode#23833
This PR fixes the issue with relatively the same method. The
spicecode must flow.Cheers