Ticket #32417

処理の順番が入れ替わる?ために beginEditing と endEditing の呼び出しが釣り合わなくなることがある

Eröffnet am: 2013-11-08 22:44 Letztes Update: 2013-12-17 23:58

Auswertung:
Verantwortlicher:
(Keine)
Typ:
Status:
Geschlossen
Komponente:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
Keine

Details

2013/11/05 23:49:46.610 BathyScaphe[9016]: Exception raised during background layout:  -[BSLayoutManager _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *** attempted layout while textStorage is editing.  It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)
2013/11/05 23:49:46.611 BathyScaphe[9016]: -[BSLayoutManager _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *** attempted layout while textStorage is editing.  It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)
2013/11/05 23:49:46.635 BathyScaphe[9016]: (
	0   CoreFoundation                      0x00007fff8b6c441c __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x00007fff850bce75 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff8b6c42cc +[NSException raise:format:] + 204
	3   AppKit                              0x00007fff89699f6f -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 624
	4   AppKit                              0x00007fff89699ac9 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 201
	5   AppKit                              0x00007fff897a94c9 +[NSLayoutManager(NSPrivate) _doSomeBackgroundLayout] + 729
	6   AppKit                              0x00007fff897a7c06 _NSPostBackgroundLayout + 310
	7   CoreFoundation                      0x00007fff8b5f50a7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
	8   CoreFoundation                      0x00007fff8b5f5017 __CFRunLoopDoObservers + 391
	9   CoreFoundation                      0x00007fff8b5e6893 __CFRunLoopRun + 995
	10  CoreFoundation                      0x00007fff8b5e6275 CFRunLoopRunSpecific + 309
	11  HIToolbox                           0x00007fff8d270f0d RunCurrentEventLoopInMode + 226
	12  HIToolbox                           0x00007fff8d270cb7 ReceiveNextEventCommon + 479
	13  HIToolbox                           0x00007fff8d270abc _BlockUntilNextEventMatchingListInModeWithFilter + 65
	14  AppKit                              0x00007fff895c428e _DPSNextEvent + 1434
	15  AppKit                              0x00007fff895c38db -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
	16  AppKit                              0x00007fff895b79cc -[NSApplication run] + 553
	17  AppKit                              0x00007fff895a2803 NSApplicationMain + 940
	18  BathyScaphe                         0x000000010d91ec54 BathyScaphe + 7252
	19  ???                                 0x0000000000000001 0x0 + 1
)

10.9 に限らず発生する。なんとか防止する対策を考えた方が良さそう。

Ticket-Verlauf (3/6 Historien)

2013-11-08 22:44 Aktualisiert von: tsawada2
  • New Ticket "処理の順番が入れ替わる?ために beginEditing と endEditing の呼び出しが釣り合わなくなることがある" created
2013-11-26 22:30 Aktualisiert von: tsawada2
Kommentar

スレッドを表示処理中に別のスレッドを表示しようとした際の中断処理がきちんとできていない点に問題があると考えている。-[NSOperationQueue cancelAllOperations] を投げても意味が無い、なぜなら NSInvocationOperation は -cancel をサポートしていないから。

NSInvocationOperation を利用して CMRThreadLayoutTask 系のクラスを NSOperationQueue に乗っけている現在の実装を整理して、直接 NSOperation のサブクラスを作って CMRThreadLayoutTask 系のクラスの代替にする。その上で -cancel に反応できるようにすることを検討中。

2013-11-29 02:29 Aktualisiert von: tsawada2
Kommentar

スレッドリスト更新系のタスクと、スレッド内容表示系のレイアウトタスクが同じ NSOperationQueue に乗っていると都合が悪い感じになって来たので、キューを分離する方向で考えている。

あと、「中止」コマンドへの反応、CMRTaskManager への登録などができていないのでこれもきちんとできるようにしないといけない。

それから、様々なシチュエーションでの動作確認……道は遠い。

2013-11-30 17:24 Aktualisiert von: tsawada2
Kommentar
  • スレッド一覧更新系のタスクを動かすための NSOperationQueue は、Browser クラスに持たせて独立させた。
  • NSOperation サブクラスを CMRTask プロトコルに適合させて、進捗状況表示を復活させた。
  • 中止処理だが、一番重たい NSTextView への表示中の時間(NSLayoutManager が働いてるとこ)は中止がきかないねぇ。

ある程度は出来てきたので、順次、コミットしていきます(一部は既にコミット済み)。

2013-12-02 22:57 Aktualisiert von: tsawada2
Kommentar

Sneaky v578 でしばらくフィードバックを観察する。

※なお、スクロール時の白抜け問題は別の要因なので、このバグのクローズ判定には考慮しないものとする。

2013-12-17 23:58 Aktualisiert von: tsawada2
  • Lösung Update from Keine to Gefixt
  • Status Update from Offen to Geschlossen
  • Ticket Close date is changed to 2013-12-17 23:58
Kommentar

たまたまかもしれないけど…「治りました」というはっきりした報告も無いが、問題発生の報告もなくなったので、いったんクローズします。

Dateianhangliste

Keine Anhänge

Bearbeiten

Please login to add comment to this ticket » Anmelden