asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
35 stars 17 forks source link

StackOverflowError at uri_3a_classloader_3a_.gems.ttfunk_minus_1_dot_7_dot_0.lib.ttfunk.reader.RUBY$method$read_signed$0(uri:classloader:/gems/ttfunk-1.7.0/lib/ttfunk/reader.rb:16) #89

Open rocketraman opened 1 year ago

rocketraman commented 1 year ago

I received this StackOverflowError from my JVM backend while doing PDF conversions. The error was not specific to the inputs -- the system automatically retried and successfully generated the output for the same inputs.

I was not able to reproduce the problem either.

However, hopefully the exception will help with isolating the issue.

java.lang.StackOverflowError: null
    at uri_3a_classloader_3a_.gems.ttfunk_minus_1_dot_7_dot_0.lib.ttfunk.reader.RUBY$method$read_signed$0(uri:classloader:/gems/ttfunk-1.7.0/lib/ttfunk/reader.rb:16)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
    at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
    at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:177)
    at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
    at org.jruby.runtime.Block.yieldArray(Block.java:230)
    at org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1759)
    at org.jruby.RubyBasicObject.instance_exec(RubyBasicObject.java:2677)
    at org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec.call(RubyBasicObject$INVOKER$i$0$3$instance_exec.gen)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
    at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
    at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:157)
    at org.jruby.ir.targets.indy.YieldSite.yieldSpecific(YieldSite.java:161)
    at uri_3a_classloader_3a_.gems.prawn_minus_2_dot_4_dot_0.lib.prawn.font.RUBY$block$font$1(uri:classloader:/gems/prawn-2.4.0/lib/prawn/font.rb:60)
    at org.jruby.ir.targets.indy.YieldSite.yieldSpecific(YieldSite.java:157)
    at uri_3a_classloader_3a_.gems.prawn_minus_2_dot_4_dot_0.lib.prawn.font.RUBY$method$save_font$0(uri:classloader:/gems/prawn-2.4.0/lib/prawn/font.rb:214)
    at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:152)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:148)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:362)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:154)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:161)
    at uri_3a_classloader_3a_.gems.prawn_minus_2_dot_4_dot_0.lib.prawn.font.invokeOther16:save_font(uri:classloader:/gems/prawn-2.4.0/lib/prawn/font.rb:58)
    at uri_3a_classloader_3a_.gems.prawn_minus_2_dot_4_dot_0.lib.prawn.font.RUBY$method$font$0(uri:classloader:/gems/prawn-2.4.0/lib/prawn/font.rb:58)
    at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:112)
    at org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:1338)
    at uri_3a_classloader_3a_.gems.asciidoctor_minus_pdf_minus_2_dot_3_dot_4.lib.asciidoctor.pdf.ext.prawn.extensions.invokeSuper6:-dynamic-super_target-(uri:classloader:/gems/asciidoctor-pdf-2.3.4/lib/asciidoctor/pdf/ext/prawn/extensions.rb:329)
    at uri_3a_classloader_3a_.gems.asciidoctor_minus_pdf_minus_2_dot_3_dot_4.lib.asciidoctor.pdf.ext.prawn.extensions.RUBY$method$font$0(uri:classloader:/gems/asciidoctor-pdf-2.3.4/lib/asciidoctor/pdf/ext/prawn/extensions.rb:329)
    at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:139)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:112)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:94)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:546)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:383)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:185)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:192)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.RubyClass.finvokeWithRefinements(RubyClass.java:530)
    at org.jruby.RubyBasicObject.send(RubyBasicObject.java:1715)
    at org.jruby.RubyKernel.send(RubyKernel.java:2235)
    at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrTwoOrNBlock.call(JavaMethod.java:444)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:142)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
    at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
    at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:177)
    at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
    at org.jruby.runtime.Block.yieldNonArray(Block.java:224)
    at org.jruby.RubyArray.collectArray(RubyArray.java:2633)
    at org.jruby.RubyArray.map(RubyArray.java:2667)
    at org.jruby.RubyArray$INVOKER$i$0$0$map.call(RubyArray$INVOKER$i$0$0$map.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:560)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:94)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:546)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
    at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1229)
    at org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:131)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:351)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:144)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.RubyClass.finvokeWithRefinements(RubyClass.java:530)
    at org.jruby.RubyBasicObject.send(RubyBasicObject.java:1715)
    at org.jruby.RubyKernel.send(RubyKernel.java:2235)
    at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrTwoOrNBlock.call(JavaMethod.java:444)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:351)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:144)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
    at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
    at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:177)
    at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
    at org.jruby.runtime.Block.yieldNonArray(Block.java:224)
    at org.jruby.RubyArray.collectArray(RubyArray.java:2633)
    at org.jruby.RubyArray.map(RubyArray.java:2667)
    at org.jruby.RubyArray$INVOKER$i$0$0$map.call(RubyArray$INVOKER$i$0$0$map.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:560)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:94)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:546)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
    at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1229)
    at org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:131)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:351)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:144)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:372)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:175)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)
    at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
    at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:76)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:157)
    at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:498)
    at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:176)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:94)
    at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:546)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
    at org.jruby.RubyClass.finvokeWithRefinements(RubyClass.java:530)
    at org.jruby.RubyBasicObject.send(RubyBasicObject.java:1715)
    at org.jruby.RubyKernel.send(RubyKernel.java:2235)
    at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrTwoOrNBlock.call(JavaMethod.java:444)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:351)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:144)
    at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
    at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
    at org.jruby.RubyClass.finvoke(RubyClass.java:784)
    at org.jruby.runtime.Helpers.invoke(Helpers.java:661)
    at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:370)
    at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convert(JRubyAsciidoctor.java:311)
    at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convert(JRubyAsciidoctor.java:336)
    at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convert(JRubyAsciidoctor.java:331)
    at my.package.MyPdfGenerator.generatePdf(MyPdfGenerator.kt:133)
mojavelinux commented 1 year ago

It appears as though this error is coming from ttfunk. It likely has to do with either an invalid font or a font which contains something that ttfunk is not anticipating. Either way, if it is an issue with ttfunk, there is little we can do about it in this project. It would need to be reported to ttfunk.

Can you tell us whether this happens when using a built-in theme, or only when using a custom theme with your own fonts?

mojavelinux commented 1 year ago

the system automatically retried and successfully generated the output for the same inputs

Given that's the case, it may be that the amount of input is just too large for the amount of memory allocated to the JVM. This is not uncommon when generating PDFs since the process requires a large amount of memory. So we might just have to say that if you see an error like this, it's necessary to allocate more memory to the JVM. (It probably scales linearly with the size of the PDF being generated, and hence the input).

rocketraman commented 1 year ago

Can you tell us whether this happens when using a built-in theme, or only when using a custom theme with your own fonts?

It is a custom theme with my own fonts. Here is the configuration theme.yml:

# https://docs.asciidoctor.org/pdf-converter/latest/theme/keys/
extends: default
font:
  catalog:
    merge: true
    Roboto:
      normal: roboto-normal.ttf
      italic: roboto-italic.ttf
      bold: roboto-bold.ttf
      bold_italic: roboto-bold_italic.ttf
    NotoSansSymbols2:
      normal: notosans-symbols2-normal.ttf
      italic: notosans-symbols2-normal.ttf
      bold: notosans-symbols2-normal.ttf
      bold_italic: notosans-symbols2-normal.ttf
  fallbacks:
    - NotoSansSymbols2
base:
  font-color: #24262b
  font-family: Roboto
  font-size: 12
  line-height-length: 17
  line-height: $base-line-height-length / $base-font-size
vertical-spacing: $base-line-height-length
page:
  margin: [$base_line_height_length * 4, 1in, 0.75in, 1in]
green:
  font-color: #00A664
title-page:
  title:
    font-color: #00A664
  subtitle:
    font-color: #00A664
heading:
  font-color: #333333
  font-size: 17
  font-style: bold
  line-height: 1.2
  margin-bottom: $vertical-spacing
  h2:
    font-color: #00A664
header:
  height: $base_line_height_length * 3
  border-color: #dddddd
  border-width: 0.25
  vertical-align: middle
  image-vertical-align: middle
  recto: &shared_header
    right:
      content: image:logo.png[pdfwidth=0.3in]
    center:
      content: '{document-title}: {document-subtitle}'
  verso: *shared_header
footer:
  columns: =100%
  recto: &shared_footer
    center:
      content: '{page-number}'
  verso: *shared_footer

Here is the calling code:

    asciidoctor.convert(
      adoc,
      Options.builder()
        .backend("pdf")
        .headerFooter(true)
        .attributes(
          Attributes.builder()
            .attribute(
              "pdf-theme",
              "uri:classloader:/my/package/render/pdf/theme.yml"
            )
            .attribute(
              "pdf-fontsdir",
              "uri:classloader:/my/package/render/pdf/fonts;GEM_FONTS_DIR"
            )
            .attribute("imagesdir", "uri:classloader:/my/package/render/pdf/")
            .build()
        )
        .safe(SafeMode.UNSAFE)
        .toStream(outputStream)
        .build()

Given that's the case, it may be that the amount of input is just too large for the amount of memory allocated to the JVM.

That's possible. I've only seen the error happen in a memory-constrained container environment. The asciidoc is small (about 6.6k of text) which outputs to about 7 pages. However the logo is 66KB and the font TTFs total about 1.3 MB. The output PDFs are between 160 and 190 KB -- the particular one that failed was 171.6 KB.

These containers are at the moment allocated 1Gi of memory.

mojavelinux commented 1 year ago

It could very well be the size of the font, since ttfunk has to go through an process all of the data in it in order to be able to use it.