MacDownApp / MacDownApp/macdown

Exception when restoring document version

Open
#464 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rich Text Format
Stars
9.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

When the version selection view is invoked:

```
2015-10-10 14:38:12.918 MacDown[41439:2989412] NSDocumentRevisionsDebugMode=YES
Oct 10 14:38:12 MacDown[41439] : Set a breakpoint at CGSLogError to catch errors as they are logged.
Oct 10 14:38:12 MacDown[41439] : CGSGetSystemWindow: Invalid window
```

After clicking **Restore**:

```
2015-10-10 14:41:10.903 MacDown[41704:2991874] An instance 0x60800018b6d0 of class MPEditorView was deallocated while key value observers were still registered with it. Current observation info: (
Context: 0x0, Property: 0x600000057c70>
Context: 0x0, Property: 0x600000057e20>
Context: 0x0, Property: 0x600000057ca0>
Context: 0x0, Property: 0x600000057e50>
Context: 0x0, Property: 0x600000057fd0>
Context: 0x0, Property: 0x600000058180>
Context: 0x0, Property: 0x600000058030>
Context: 0x0, Property: 0x6000000581e0>
)
2015-10-10 14:41:10.904 MacDown[41704:2991874] (
0 CoreFoundation 0x00007fff8d969bd2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff925594fa objc_exception_throw + 48
2 CoreFoundation 0x00007fff8d9d03fd +[NSException raise:format:] + 205
3 Foundation 0x00007fff93c354f0 NSKVODeallocate + 294
4 AppKit 0x00007fff8dfa75a3 -[NSTextView release] + 442
5 libsystem_blocks.dylib 0x00007fff8f3d96b1 _Block_release + 128
6 libsystem_blocks.dylib 0x00007fff8f3d96b1 _Block_release + 128
7 libdispatch.dylib 0x000000010020a061 _dispatch_source_cancel_callout + 87
8 libdispatch.dylib 0x00000001001fbcea _dispatch_source_invoke + 924
9 libdispatch.dylib 0x000000010020e012 _dispatch_main_queue_callback_4CF + 1153
10 CoreFoundation 0x00007fff8d91f789 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
11 CoreFoundation 0x00007fff8d8de73d __CFRunLoopRun + 1949
12 CoreFoundation 0x00007fff8d8ddd38 CFRunLoopRunSpecific + 296
13 HIToolbox 0x00007fff8fa28d55 RunCurrentEventLoopInMode + 235
14 HIToolbox 0x00007fff8fa28b8f ReceiveNextEventCommon + 432
15 HIToolbox 0x00007fff8fa289cf _BlockUntilNextEventMatchingListInModeWithFilter + 71
16 AppKit 0x00007fff8dedff3a _DPSNextEvent + 1067
17 AppKit 0x00007fff8dedf369 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
18 AppKit 0x00007fff8ded3ecc -[NSApplication run] + 682
19 AppKit 0x00007fff8de9d162 NSApplicationMain + 1176
20 MacDown 0x000000010000ba12 main + 34
21 libdyld.dylib 0x00007fff9337e5ad start + 1
22 ??? 0x0000000000000003 0x0 + 3
)
(lldb)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by invoking the version selection view and clicking Restore, then inspect the MPEditorView lifecycle and the listed KVO observers. Done means restoring a document version no longer produces the deallocation exception shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, objective-c
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.