Crash when typing abcdefghijk sequentially on Pinyin input source

image
If I continue type j, app will crash.
Input source issue, Does it only happens on my computer?

It happened on:

  • Pinyin - Simplified / Bike 1.18.2 (177) / macOS 14.4.1
  • Pinyin - Traditional / " / macOS 14.4.1

Not happened on:

  • Pinyin - Simplified / " / macOS 12.7.4
  • Pinyin - Traditional / " / macOS 12.7.4
  • Shaungpin - Traditional / " / macOS 14.4.1
  • Japanese - Kana / " / macOS 14.4.1

Also not on:

  • Pinyin - Simplified / TextEdit.app / macOS 14.4.1
  • Pinyin - Traditional / TextEdit.app / macOS 14.4.1

Seen here too (Bike 177, macOS 14.4.1)

Expand disclosure triangle to view log
System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x00000001aece9a40

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [1408]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libswiftCore.dylib            	       0x1aece9a40 closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 240
1   libswiftCore.dylib            	       0x1aece9908 closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 344
2   libswiftCore.dylib            	       0x1aece9264 _assertionFailure(_:_:file:line:flags:) + 188
3   libswiftCore.dylib            	       0x1aeeb7274 String.UTF16View.index(_:offsetBy:) + 384
4   BikeOutliner                  	       0x1042e8ed8 0x104270000 + 495320
5   BikeOutliner                  	       0x1042e8ddc 0x104270000 + 495068
6   BikeOutliner                  	       0x1042b75a4 0x104270000 + 292260
7   BikeOutliner                  	       0x1042b7914 0x104270000 + 293140
8   AppKit                        	       0x1a35336f0 -[NSTextInputContext(NSInputContext_WithCompletion) setMarkedText:selectedRange:replacementRange:completionHandler:] + 192
9   AppKit                        	       0x1a352dc3c __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.246 + 116
10  AppKit                        	       0x1a2adf298 -[NSTextInputContext tryHandleTSMEvent_setMarkedText_withContext:dispatchCondition:setupForDispatch:dispatchWork:continuation:] + 172
11  AppKit                        	       0x1a352d500 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.227 + 368
12  AppKit                        	       0x1a352d2bc __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2.219 + 280
13  AppKit                        	       0x1a352c934 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.186 + 2020
14  AppKit                        	       0x1a2ad9b2c __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke_2 + 100
15  AppKit                        	       0x1a2ad9a78 -[NSTextInputContext tryHandleTSMEvent_HasMarkedText_withDispatchCondition:dispatchWork:continuation:] + 148
16  AppKit                        	       0x1a2ad8ff0 -[NSTextInputContext handleTSMEvent:completionHandler:] + 2044
17  AppKit                        	       0x1a2ad8788 _NSTSMEventHandler + 332
18  HIToolbox                     	       0x1a984743c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1232

Thanks, I can reproduce this also. Will try to get a fix in soon.

@eno @complexpoint Are you seeing lots of other issues with Pinyin text input now or is this an isolated crash?

I’m trying to make sense of the inputs that the text system is giving me, and in this case the range doesn’t seem to be matching what the documentation says I should expect. I’m trying to understand if the bug is in my code, or in the input manager.

I never have any issues in ordinary use with the Pinyin IMEs (Simplified and Traditional)

I think there are some bugs in the input manager. For example, when typing abcdefghijk in TextEdit.app, you can see that the candidate word crashes in some way, but this crash does not cause the text editor to crash. This example is rare, but I don’t think it is isolated. I encountered similar patterns in several other patterns around macos 10.12 (sorry I can’t remember, but it was not common). I haven’t encountered it since I changed computers.

I think there are some bugs in the input manager. For example, when typing abcdefghijk in TextEdit.app, you can see that the word in the candidate window has crashed in some way, only this crash has not caused the text editor to crash. This example is rare, but I don’t think it’s isolated.

I came across a few other patterns similar to this back in about macos 10.12 (I’m sorry I can’t remember the patterns, and it was not common). I haven’t come across them since I switched computers.

I just did some trying and found the following combinations:

xxghijk
(x can be any lowercase letter)

xxgil
xxgij
xxgik
(x can be f,d,l,q,v,w,x)

Please try this release and let me know if it fixes these issues and seems to behave correctly:

Still seems like an input manager bug, I’m just clipping passed in selection ranges to passed in string now to avoid the crashes.

2 Likes

Solved! too fast!

2 Likes