Hi, again.

It seems that TTFSubsetter.buildGlyfTable() iterates on glyphIds, but
inside the loop glyphIds is modified. This is why it may fail. Concurrent
modification detection is not guaranteed to always work, even if it is
fail-fast, though I doubt this is such a case. Modification of glyphIds
inside the loop should not happen.

Regards,
Constantine

--
There is a computer disease that anybody who works with computers knows
about. It's a very serious disease and it interferes completely with the
work. The trouble with computers is that you 'play' with them!
- Richard P. Feynman


On Tue, Oct 21, 2025 at 7:37 AM Andreas Lehmkühler <[email protected]>
wrote:

> Hi,
>
> sounds like a concurrency issue. What exactly are you doing? Maybe
> something with multiple threads working with the same document?
>
> Andreas
>
> Am 20.10.25 um 17:41 schrieb Constantine Dokolas:
> > Hi there!
> >
> > I keep getting this exception when subsetting NotoSansDevanagari-Regular
> > with PDFBox 3.0.5:
> >
> > Exception in thread "main" java.util.ConcurrentModificationException
> >>      at
> >>
> java.base/java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1486)
> >>      at java.base/java.util.TreeMap$KeyIterator.next(TreeMap.java:1540)
> >>      at
> >>
> org.apache.fontbox.ttf.TTFSubsetter.buildGlyfTable(TTFSubsetter.java:617)
> >>      at
> >>
> org.apache.fontbox.ttf.TTFSubsetter.writeToStream(TTFSubsetter.java:1030)
> >>      at
> >>
> org.apache.pdfbox.pdmodel.font.TrueTypeEmbedder.subset(TrueTypeEmbedder.java:346)
> >>      at
> >> org.apache.pdfbox.pdmodel.font.PDType0Font.subset(PDType0Font.java:304)
> >>      at
> >>
> org.apache.pdfbox.pdmodel.PDDocument.subsetDesignatedFonts(PDDocument.java:1064)
> >>      at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1052)
> >
> >
> > Could this be related to PDFBOX-5918
> > <https://issues.apache.org/jira/browse/PDFBOX-5918>?
> >
> > Thanks in advance,
> > Constantine
> >
> > --
> > There is a computer disease that anybody who works with computers knows
> > about. It's a very serious disease and it interferes completely with the
> > work. The trouble with computers is that you 'play' with them!
> > - Richard P. Feynman
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to