File conversion hangs

I am trying to compile a document to ODT format. The process hangs near the end, at the point of converting the file.

I can successfully compile the whole document to PDF, and parts of the document to ODT, but when compiling the whole document it so far always hangs at the file conversion stage. The only difference I can observe between compiling parts and the whole document is that I can see the Java file converter launching for parts, but don’t see it launch for the whole doc.

I have quit and restarted Scrivener and my Mac but that has not helped.

I’m using MacOs 11.6, Scrivener 3.23. Any help very much appreciated.

Mark

When you say it works fine for parts of the Draft folder, does that mean you have tried to compile all parts of it, separately, or that you have only spot checked a few folders? If there is something that is breaking the Java conversion engine, it may be in a spot you haven’t tested compiling, is what I’m getting at.

In the meanwhile, I would compile to RTF which LibreOffice does a good job of reading. It may even arguably be better to let it do the conversion to ODT than a third-party converter, but if not, you’d at least not be stuck unable to proceed, while troubleshooting the problem.

Thanks for the tips. I tried compiling the whole thing to RTF, but once again it hung towards the end of the process. As a workaround I’ve compiled every section to RTF and combined them into a new document, then saved to ODT.

There was no problem compiling each section individually to RTF, and every section has compiled to ODT before without any problem. Is there any way, for example a log file, that might help me understand what is preventing the whole document compiling at once?

And I’ve just checked and each section compiles individually to ODT without problems. So it just seems to be compiling the whole document that’s the issue.

Okay! That helps to narrow things down a bit, though the problem itself remains a bit mysterious. That explains why you weren’t seeing the Java converter icon come up, if it’s hanging before it can finish the RTF, it never finishes it to pass it along to the Java tool for ODT conversion.

Logging or checking for errors is indeed the next step. This post outlines two useful tools for that. I’d ignore the first paragraph, I don’t think your issue is related to system clutter.

Some sanity checks as well: do you have a lot of figures in the text, and how large would you say the RTF file should be, if compiled successfully?

I switched on the logging tools as you suggested and tried to compile the whole document to ODT. That produced an error message at the point where I see it hanging. The message within Scrivener and on the console seem to be the same:

Exception Name: NSRangeException

Exception Reason: *** -[__NSCFString rangeOfString:options:range:locale:]: Range {9223372036854775807, 9223372036854778212} out of bounds; string length 556571

0 CoreFoundation 0x00007fff205ad1db __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff202e6d92 objc_exception_throw + 48
2 Foundation 0x00007fff21268a33 -[NSString rangeOfString:options:range:locale:] + 549
3 Foundation 0x00007fff21268800 -[NSString rangeOfString:options:range:] + 29
4 ScrAppKit 0x000000010dc9af0b -[NSAttributedString(KBAdditions) extendedRTFFromRange:documentAttributes:RTFAttributes:] + 8554
5 ScrAppKit 0x000000010de66ada -[NSAttributedString(AsposeConverters) writeToRichTextFile:documentAttributes:RTFAttributes:error:] + 387
6 Scrivener 0x000000010d660430 Scrivener + 4265008
7 Scrivener 0x000000010d65fa7a Scrivener + 4262522
8 Foundation 0x00007fff212e31a7 __NSFireDelayedPerform + 415
9 CoreFoundation 0x00007fff2054bbe9 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
10 CoreFoundation 0x00007fff2054b6dd __CFRunLoopDoTimer + 927
11 CoreFoundation 0x00007fff2054b23a __CFRunLoopDoTimers + 307
12 CoreFoundation 0x00007fff20531e13 __CFRunLoopRun + 1988
13 CoreFoundation 0x00007fff20530f8c CFRunLoopRunSpecific + 563
14 HIToolbox 0x00007fff287791f3 RunCurrentEventLoopInMode + 292
15 HIToolbox 0x00007fff28778e26 ReceiveNextEventCommon + 284
16 HIToolbox 0x00007fff28778cf3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
17 AppKit 0x00007fff22d3a172 _DPSNextEvent + 864
18 AppKit 0x00007fff22d38945 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
19 AppKit 0x00007fff22d2ac69 -[NSApplication run] + 586
20 AppKit 0x00007fff22cfee6c NSApplicationMain + 816
21 libdyld.dylib 0x00007fff20456f3d start + 1
22 ??? 0x0000000000000001 0x0 + 1


There a lot of images. Based on compiling the individual chapters separately, the end result would be about 32MB. Is the file too large to compile in one go?

32MB is a bit on the large side of things, but in theory it should be fine, I’ve seen larger RTF files from even the older 32-bit version that worked. So I don’t think it’s a memory problem, though you could maybe test that by doing a reboot and compiling in a relatively clean environment without any other heavy-duty tools running.

Something else I would try, if you can, is swapping out the images. If they are all embedded that won’t be something you can easily do, but if they are linked to the disk then you could duplicate the folder they are in, and then try reducing their size to thumbnail quality. If you have Photoshop or Graphic Converter you could do that in one easy batch. If that works, then you can go back to the original files and work toward optimisation, starting with the largest of them.

Unfortunately I’m still trying to solve this problem. Here’s what I’ve tried so far:

  • reducing the size of all the images in the document, as suggested. That roughly halved the size, but doesn’t prevent crashes when compiling the whole document
  • rebooting has had no effect

I’m now trying to compile less and less of the document to see if I can identify where the problem might be. Even when trying to compile a single chapter as a part of the whole manuscript, it crashes on compile. That chapter is just text, and compiled on its own is less than 30Kb. This makes me think that the images may not be the problem.

I’ve pasted the most recent crash report below – can you suggest anything else to try?

Exception Name: NSRangeException

Exception Reason: *** -[__NSCFString rangeOfString:options:range:locale:]: Range {9223372036854775807, 9223372036854777899} out of bounds; string length 43980

0 CoreFoundation 0x00007fff204f31db __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007fff2022cd92 objc_exception_throw + 48
2 Foundation 0x00007fff211aea33 -[NSString rangeOfString:options:range:locale:] + 549
3 Foundation 0x00007fff211ae800 -[NSString rangeOfString:options:range:] + 29
4 ScrAppKit 0x000000010132cf0b -[NSAttributedString(KBAdditions) extendedRTFFromRange:documentAttributes:RTFAttributes:] + 8554
5 ScrAppKit 0x00000001014f8ada -[NSAttributedString(AsposeConverters) writeToRichTextFile:documentAttributes:RTFAttributes:error:] + 387
6 Scrivener 0x0000000100cf5430 Scrivener + 4265008
7 Scrivener 0x0000000100cf4a7a Scrivener + 4262522
8 Foundation 0x00007fff212291a7 __NSFireDelayedPerform + 415
9 CoreFoundation 0x00007fff20491be9 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
10 CoreFoundation 0x00007fff204916dd __CFRunLoopDoTimer + 927
11 CoreFoundation 0x00007fff2049123a __CFRunLoopDoTimers + 307
12 CoreFoundation 0x00007fff20477e13 __CFRunLoopRun + 1988
13 CoreFoundation 0x00007fff20476f8c CFRunLoopRunSpecific + 563
14 HIToolbox 0x00007fff286bea83 RunCurrentEventLoopInMode + 292
15 HIToolbox 0x00007fff286be6b6 ReceiveNextEventCommon + 284
16 HIToolbox 0x00007fff286be583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
17 AppKit 0x00007fff22c80172 _DPSNextEvent + 864
18 AppKit 0x00007fff22c7e945 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
19 AppKit 0x00007fff22c70c69 -[NSApplication run] + 586
20 AppKit 0x00007fff22c44e6c NSApplicationMain + 816
21 libdyld.dylib 0x00007fff2039cf3d start + 1
22 ??? 0x0000000000000001 0x0 + 1

Okay, give this a try:

  1. Create a new test project from the “Blank” starter and open it alongside your main project.
  2. Drag one of the chapters that you know causes a crash into the blank project’s Draft folder.
  3. Compile that using the same settings (if it is a custom compile format, you can drag and drop between Format sidebars with both compile overview windows open).

If this crashes, could you send the test project to technical support, so that we can take a look at it?

WeI could do a Zoom session if you want. Maybe I’ll see a clue.