Closing copyholder crashes Scrivener

Closing Copyholder after clicking on/creating comments crashes Scrivener!

Mac OS: Monterrey 12.7.4
Macbook Air 13" Early 2015, Intel
Screenshot 2024-05-27 at 2.37.34 PM
Scrivener version: 3.3.6 (16305), currently the latest update

2 Scenarios:

  1. When creating a new comment within the text of a copyholder, Scrivener crashes when I close the copyholder.

  2. This also happens when I reopen the project after the crash and simply click on the comment in the copyholder, then close the copyholder.

I’ve reproduced this many times, and now it’s happening every time.

Every time I reopen my Scrivener project after this crash, Scrivener has to rebuild the project’s search indexes.

I’ve enabled Scrivener to “Show internal error alerts” in Preferences>General>Warnings but every time a crash happens, the most I can get is this:

Screenshot 2024-05-27 at 2.30.06 PM

When I try to click any of the buttons, nothing works, and the scroll bar just goes wonky like it’s rapidly scrolling up and down, but the error text doesn’t move. I always have to Force Quit Scrivener.

Each time I reopen my project, my cursor goes back to the same spot in my project before these crashes began happening. Sometimes it saves what I’ve done, and sometimes the last few changes I’ve made in the project get lost and I have to redo them.

Here’s a screenshot from the latest Console.log file from the Package Contents of my project:

I had to restart my Macbook once because this crash resulted in Scrivener using up all my Memory and CPU in my Activity Monitor. So I used a program called Onyx to perform some maintenance procedures on my Mac, which resulted in the restart. The Scrivener crash still continued to happen.

I’m not sure how to get the full crash/error report since I don’t know if Scrivener saves a copy elsewhere besides in the actual error message. But will be happy to provide this if I can get instructions on how to do so. I haven’t found a way to do this in the Scrivener Manual.

I did not attempt to reproduce this problem. But I can advise that the macOS manages “crashes” and logs them, including crash reports. You can see the crash reports using the macOS Utility app “Console” available in /Applications/Utility/console.app.

I’m not surprised that using Onyx cleanup did not appear to help. Worse, it might delete the evidence of logs and crash reports to help diagnose the issue.

Moved to a location where people might be able to help.

With any crash, the first thing to check is to see if it happens with all projects.

“Creating a new comment within the text of the copyholder” is unclear. Are you creating an (inspector) comment, or an (inline) annotation? Are you closing the copyholder immediately after creating the comment, or after typing some additional text, or doesn’t it matter?

Thanks for the report! I was able to reproduce this, though I had to make sure to view something other than the original test document for the copyholder (so at least two files in the test project):

  1. New project from Blank.
  2. Press ⌘N to make a new section.
  3. Alt-drag the first section into the header bar to load it as a copyholder.
  4. Type in a word and press ⇧⌘8 to attach a comment to it.
  5. Click the X button on the copyholder pane.

I also tried closing the comment first, so that the cursor wasn’t left blinking within it on step 5, but that made no difference.

It wasn’t technically a crash, which explains the lack of crash log anywhere. I had to force quit, as it kept generating exceptions at a rapid rate (and that in and of itself is probably a clue that it’s stuck in an infinite loop).

2 Likes

Thanks for the tip about the Console utility. Here’s the Diagnostic Report I found from that day:

Date/Time:        2024-05-27 14:16:36.798 -0500
End time:         2024-05-27 14:19:29.662 -0500
OS Version:       macOS 12.7.4 (Build 21H1123)
Architecture:     x86_64h
Report Version:   35.1
Incident Identifier: 513BEE14-B281-4865-A303-D8563E3E3D7C

Data Source:      Microstackshots
Shared Cache:     49E18B84-2CD0-3C1E-9270-0E198C2FDF68 slid base address 0x7ff80e1cb000, slide 0xe1cb000

Command:          Scrivener
Path:             /Applications/Scrivener 3.app/Contents/MacOS/Scrivener
Identifier:       com.literatureandlatte.scrivener3
Version:          3.3.6 (16305)
Team ID:          W4QTL7X778
Architecture:     x86_64
Parent:           UNKNOWN [1]
PID:              838

Event:            cpu usage
Action taken:     none
CPU:              90 seconds cpu time over 173 seconds (52% cpu average), exceeding limit of 50% cpu over 180 seconds
CPU limit:        90s
Limit duration:   180s
CPU used:         90s
CPU duration:     173s
Duration:         172.86s
Duration Sampled: 168.42s
Steps:            37

Hardware model:   MacBookAir7,2
Active cpus:      4
HW page size:     4096
VM page size:     4096

Fan speed:        2043 rpm
Advisory levels:  Battery -> 2, User -> 2, ThermalPressure -> 1, Combined -> 2
Free disk space:  11.94 GB/112.80 GB, low space threshold 3072 MB

Heaviest stack for the target process:
  37  start + 462 (dyld + 21806) [0x10d33752e]
  37  NSApplicationMain + 817 (AppKit + 14234) [0x7ff810fb579a]
  12  -[NSApplication run] + 765 (AppKit + 194763) [0x7ff810fe18cb]
  12  ??? (Scrivener + 495690) [0x1012cf04a]
  12  -[NSApplication reportException:] + 963 (AppKit + 3913731) [0x7ff81136d803]
  12  _os_log_impl + 21 (libsystem_trace.dylib + 18426) [0x7ff80e25f7fa]
  12  _os_log + 128 (libsystem_trace.dylib + 18566) [0x7ff80e25f886]
  12  _os_log_impl_flatten_and_send + 2243 (libsystem_trace.dylib + 20850) [0x7ff80e260172]
  12  _os_log_fmt_flatten_object + 366 (libsystem_trace.dylib + 31220) [0x7ff80e2629f4]
  12  _os_log_fmt_flatten_NSCF + 42 (libsystem_trace.dylib + 32901) [0x7ff80e263085]
  12  _NS_os_log_callback + 273 (Foundation + 137288) [0x7ff80f3d2848]
  11  -[_NSCallStackArray descriptionWithLocale:indent:] + 129 (Foundation + 955898) [0x7ff80f49a5fa]
  11  backtrace_symbols + 109 (libsystem_c.dylib + 97801) [0x7ff80e3cee09]
  11  dyld4::APIs::dladdr(void const*, dl_info*) + 206 (dyld + 144802) [0x10d3555a2]
  8   dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 529 (dyld + 216633) [0x10d366e39]


Powerstats for:   Scrivener [838]
UUID:             74849526-AC5B-3603-87E2-7A874A6FE62D
Path:             /Applications/Scrivener 3.app/Contents/MacOS/Scrivener
Identifier:       com.literatureandlatte.scrivener3
Version:          3.3.6 (16305)
Team ID:          W4QTL7X778
Architecture:     x86_64
Parent:           UNKNOWN [1]
UID:              501
Sudden Term:      Tracked
Footprint:        359.35 MB -> 425.35 MB (+66 MB)
Pageins:          1 pages
Start time:       2024-05-27 14:16:40.629 -0500
End time:         2024-05-27 14:19:29.053 -0500
Num samples:      37 (100%)
Primary state:    36 samples Non-Frontmost App, Non-Suppressed, User mode, Effective Thread QoS User Interactive, Requested Thread QoS User Interactive, Override Thread QoS Unspecified
User Activity:    0 samples Idle, 37 samples Active
Power Source:     37 samples on Battery, 0 samples on AC
  37  start + 462 (dyld + 21806) [0x10d33752e]
    37  NSApplicationMain + 817 (AppKit + 14234) [0x7ff810fb579a]
      12  -[NSApplication run] + 765 (AppKit + 194763) [0x7ff810fe18cb]
        12  ??? (Scrivener + 495690) [0x1012cf04a]
          12  -[NSApplication reportException:] + 963 (AppKit + 3913731) [0x7ff81136d803]
            12  _os_log_impl + 21 (libsystem_trace.dylib + 18426) [0x7ff80e25f7fa]
              12  _os_log + 128 (libsystem_trace.dylib + 18566) [0x7ff80e25f886]
                12  _os_log_impl_flatten_and_send + 2243 (libsystem_trace.dylib + 20850) [0x7ff80e260172]
                  12  _os_log_fmt_flatten_object + 366 (libsystem_trace.dylib + 31220) [0x7ff80e2629f4]
                    12  _os_log_fmt_flatten_NSCF + 42 (libsystem_trace.dylib + 32901) [0x7ff80e263085]
                      12  _NS_os_log_callback + 273 (Foundation + 137288) [0x7ff80f3d2848]
                        11  -[_NSCallStackArray descriptionWithLocale:indent:] + 129 (Foundation + 955898) [0x7ff80f49a5fa]
                          11  backtrace_symbols + 109 (libsystem_c.dylib + 97801) [0x7ff80e3cee09]
                            11  dyld4::APIs::dladdr(void const*, dl_info*) + 206 (dyld + 144802) [0x10d3555a2]
                              8   dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 529 (dyld + 216633) [0x10d366e39]
                              1   dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 584 (dyld + 216688) [0x10d366e70]
                              1   dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 537 (dyld + 216641) [0x10d366e41]
                              1   dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 375 (dyld + 216479) [0x10d366d9f]
                        1   -[_NSCallStackArray descriptionWithLocale:indent:] + 288 (Foundation + 956057) [0x7ff80f49a699]
                          1   -[__NSCFString appendFormat:] + 188 (CoreFoundation + 408838) [0x7ff80e597d06]
                            1   _CFStringAppendFormatAndArgumentsAux2 + 73 (CoreFoundation + 408962) [0x7ff80e597d82]
                              1   __CFStringAppendFormatCore + 9782 (CoreFoundation + 201426) [0x7ff80e5652d2]
                                1   __CFStringAppendBytes + 549 (CoreFoundation + 210492) [0x7ff80e56763c]
                                  1   __CFStringChangeSizeMultiple + 1771 (CoreFoundation + 79868) [0x7ff80e5477fc]
                                    1   <Frontmost App, Kernel mode>
      12  -[NSApplication run] + 446 (AppKit + 194444) [0x7ff810fe178c]
        9   -[NSApplication setWindowsNeedUpdate:] + 253 (AppKit + 248537) [0x7ff810feead9]
          9   CFRunLoopAddObserver + 295 (CoreFoundation + 443128) [0x7ff80e5a02f8]
            7   CFArrayContainsValue + 195 (CoreFoundation + 213610) [0x7ff80e56826a]
              4   CFEqual + 145 (CoreFoundation + 40017) [0x7ff80e53dc51]
              1   CFEqual + 275 (CoreFoundation + 40147) [0x7ff80e53dcd3]
              1   CFEqual + 223 (CoreFoundation + 40095) [0x7ff80e53dc9f]
              1   CFEqual + 31 (CoreFoundation + 39903) [0x7ff80e53dbdf]
            1   CFArrayContainsValue + 190 (CoreFoundation + 213605) [0x7ff80e568265]
            1   CFArrayContainsValue + 164 (CoreFoundation + 213579) [0x7ff80e56824b]
              1   -[__NSArrayM objectAtIndex:] + 6 (CoreFoundation + 138852) [0x7ff80e555e64]
        3   -[NSApplication setWindowsNeedUpdate:] + 274 (AppKit + 248558) [0x7ff810feeaee]
          3   CFRunLoopAddObserver + 295 (CoreFoundation + 443128) [0x7ff80e5a02f8]
            1   CFArrayContainsValue + 202 (CoreFoundation + 213617) [0x7ff80e568271]
            1   CFArrayContainsValue + 195 (CoreFoundation + 213610) [0x7ff80e56826a]
              1   CFEqual + 145 (CoreFoundation + 40017) [0x7ff80e53dc51]
            1   objc_msgSend + 26 (libobjc.A.dylib + 29210) [0x7ff80e38021a]
      11  -[NSApplication run] + 586 (AppKit + 194584) [0x7ff810fe1818]
        11  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394 (AppKit + 250214) [0x7ff810fef166]
          11  _DPSNextEvent + 927 (AppKit + 256681) [0x7ff810ff0aa9]
            11  _BlockUntilNextEventMatchingListInModeWithFilter + 70 (HIToolbox + 188645) [0x7ff8172640e5]
              11  ReceiveNextEventCommon + 283 (HIToolbox + 188947) [0x7ff817264213]
                11  RunCurrentEventLoopInMode + 292 (HIToolbox + 189926) [0x7ff8172645e6]
                  6   CFRunLoopRunSpecific + 449 (CoreFoundation + 515323) [0x7ff80e5b1cfb]
                    4   __CFRunLoopDoObservers + 298 (CoreFoundation + 520685) [0x7ff80e5b31ed]
                    1   __CFRunLoopDoObservers + 247 (CoreFoundation + 520634) [0x7ff80e5b31ba]
                      1   -[__NSArrayM objectAtIndex:] + 40 (CoreFoundation + 138886) [0x7ff80e555e86]
                    1   objc_msgSend + 46 (libobjc.A.dylib + 29230) [0x7ff80e38022e]
                  5   CFRunLoopRunSpecific + 562 (CoreFoundation + 515436) [0x7ff80e5b1d6c]
                    5   __CFRunLoopRun + 840 (CoreFoundation + 518004) [0x7ff80e5b2774]
                      1   __CFRunLoopDoObservers + 543 (CoreFoundation + 520930) [0x7ff80e5b32e2]
                        1   __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 (CoreFoundation + 521296) [0x7ff80e5b3450]
                          1   ___NSRunLoopObserverCreateWithHandler_block_invoke + 41 (AppKit + 4638129) [0x7ff81141e5b1]
                            1   __38-[NSApplication setWindowsNeedUpdate:]_block_invoke_2 + 50 (AppKit + 4623461) [0x7ff81141ac65]
                              1   -[NSApplication updateWindows] + 83 (AppKit + 274903) [0x7ff810ff51d7]
                                1   -[NSApplication(NSWindowCache) _updateWindowsUsingCache] + 390 (AppKit + 275342) [0x7ff810ff538e]
                                  1   -[NSArray makeObjectsPerformSelector:] + 272 (CoreFoundation + 696260) [0x7ff80e5ddfc4]
                                    1   -[NSNotificationCenter postNotificationName:object:userInfo:] + 82 (Foundation + 38862) [0x7ff80f3ba7ce]
                                      1   _CFXNotificationPost + 735 (CoreFoundation + 291576) [0x7ff80e57b2f8]
                                        1   _CFXRegistrationPost + 496 (CoreFoundation + 1124896) [0x7ff80e646a20]
                                          1   ___CFXRegistrationPost_block_invoke + 49 (CoreFoundation + 1125026) [0x7ff80e646aa2]
                                            1   __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12 (CoreFoundation + 480908) [0x7ff80e5a968c]
                                              1   -[KBTextCommentsView(TouchBar) updateCommentsTouchBar] + 104 (ScrAppKit + 633912) [0x105af6c38]
                                                1   -[KBTextCommentsView commentsAtIndexesAreAllFootnotes:] + 113 (ScrAppKit + 1439182) [0x105bbb5ce]
                                                  1   -[__NSArrayM objectAtIndex:] + 142 (CoreFoundation + 138988) [0x7ff80e555eec]
                                                    1   _CFThrowFormattedException + 202 (CoreFoundation + 1797980) [0x7ff80e6eaf5c]
                                                      1   objc_exception_throw + 302 (libobjc.A.dylib + 92601) [0x7ff80e38f9b9]
                                                        1   __cxa_throw + 108 (libc++abi.dylib + 72900) [0x7ff80e4aacc4]
                                                          1   _Unwind_RaiseException + 166 (libunwind.dylib + 39862) [0x7ff8192b7bb6]
                                                            1   libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step() + 475 (libunwind.dylib + 32339) [0x7ff8192b5e53]
                                                              1   libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool) + 273 (libunwind.dylib + 22183) [0x7ff8192b36a7]
                      1   __CFRunLoopDoObservers + 257 (CoreFoundation + 520644) [0x7ff80e5b31c4]
                      1   __CFRunLoopDoObservers + 253 (CoreFoundation + 520640) [0x7ff80e5b31c0]
                      1   CFArrayGetValueAtIndex + 0 (CoreFoundation + 138827) [0x7ff80e555e4b]
                      1   objc_msgSend + 33 (libobjc.A.dylib + 29217) [0x7ff80e380221]
      1   -[NSApplication run] + 751 (AppKit + 194749) [0x7ff810fe18bd]
        1   -[NSApplication enumerateWindowsWithOptions:usingBlock:] + 90 (AppKit + 232230) [0x7ff810feab26]
          1   -[NSPointerArray(NSArrayConveniences) allObjects] + 61 (Foundation + 208144) [0x7ff80f3e3d10]
            1   +[NSArray array] + 29 (CoreFoundation + 299605) [0x7ff80e57d255]
              1   __NSArrayM_new + 50 (CoreFoundation + 121180) [0x7ff80e55195c]
                1   __CFAllocateObject + 15 (CoreFoundation + 16529) [0x7ff80e538091]
                  1   class_createInstance + 64 (libobjc.A.dylib + 28637) [0x7ff80e37ffdd]
                    1   _malloc_zone_calloc + 60 (libsystem_malloc.dylib + 121717) [0x7ff80e323b75]
                      1   nanov2_calloc + 126 (libsystem_malloc.dylib + 13967) [0x7ff80e30968f]
                        1   nanov2_allocate + 63 (libsystem_malloc.dylib + 5684) [0x7ff80e307634]
      1   -[NSApplication run] + 523 (AppKit + 194521) [0x7ff810fe17d9]
        1   objc_msgSend + 56 (libobjc.A.dylib + 29240) [0x7ff80e380238]

  Binary Images:
           0x101256000 -        0x104bddfff  com.literatureandlatte.scrivener3 3.3.6 (16305) <74849526-AC5B-3603-87E2-7A874A6FE62D>  /Applications/Scrivener 3.app/Contents/MacOS/Scrivener
           0x105a5c000 -        0x105d63fff  com.literatureandlatte.ScrAppKit (1.0)          <DE6B109D-9A45-34DB-BEE8-FB5678A4DF06>  /Applications/Scrivener 3.app/Contents/Frameworks/ScrAppKit.framework/Versions/A/ScrAppKit
           0x10d332000 -        0x10d3b5fff  dyld (960)                                      <430A12C9-134A-3904-9D88-C2DF933FDF54>  /usr/lib/dyld
        0x7ff80e25b000 -     0x7ff80e273fff  libsystem_trace.dylib (1375.140.2)              <ABE99F0F-C49E-3B95-B7DF-C4130AB183AA>  /usr/lib/system/libsystem_trace.dylib
        0x7ff80e306000 -     0x7ff80e331fff  libsystem_malloc.dylib (374.120.1)              <0FF21147-73CD-36DC-99E9-606217A75B77>  /usr/lib/system/libsystem_malloc.dylib
        0x7ff80e379000 -     0x7ff80e3b3fff  libobjc.A.dylib (841.13.1)                      <B36A2B52-68A9-3E44-B927-71C24BE1272F>  /usr/lib/libobjc.A.dylib
        0x7ff80e3b7000 -     0x7ff80e43ffff  libsystem_c.dylib (1507.100.9.700.1)            <202D7260-EA46-3956-A471-19C9BCF45274>  /usr/lib/system/libsystem_c.dylib
        0x7ff80e499000 -     0x7ff80e4aefff  libc++abi.dylib (1300.36)                       <69AC868B-1157-364A-984A-5EF26973F661>  /usr/lib/libc++abi.dylib
        0x7ff80e534000 -     0x7ff80ea36fff  com.apple.CoreFoundation 6.9 (1866)             <FB79A14A-FDA9-3A3B-BC97-6EB525B794A6>  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
        0x7ff80f3b1000 -     0x7ff80f76dfff  com.apple.Foundation 6.9 (1866)                 <42CDD517-7F3B-3C5E-8AC1-CE7477AC31DB>  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
        0x7ff810fb2000 -     0x7ff811e41fff  com.apple.AppKit 6.9 (2113.65.150)              <E8F3AA77-ABD4-3C87-AC98-E3BCEF1B290F>  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
        0x7ff817236000 -     0x7ff817529fff  com.apple.HIToolbox 2.1.1 (1114.1)              <913D3D2E-4E4C-3907-98FE-8F4ABD551297>  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
        0x7ff8192ae000 -     0x7ff8192b8fff  libunwind.dylib (202.2)                         <FED5B053-635B-3A3C-9620-7F139F6B3659>  /usr/lib/system/libunwind.dylib

Awesome! Happy to help. I’m a Scrivener fanatic so I definitely want to help keep it working smoothly.

Nice to know you could reproduce the problem. Definitely a weird bug. I tried this in a different project, but so far I haven’t been able to reproduce it myself. The infinite loop must be why I couldn’t click any of the buttons in the dialogue box that popped up.

Hopefully, this will be fixed in the next update. I found the Diagnostic report and attached it in a different reply here.

1 Like

Well, looks like it’s happening again, so I’m not sure if there was a Scrivener update between now and when I first posted this. Beware closing the Copyholder after creating a comment!