Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

LayoutProcessor and multi-threading environment

Aperta
#1,307 12 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Start by reading openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java and the linked BIRT pull request for context on the shared flags and race condition. Trace how PDF content creation uses LayoutProcessor and where its flags are changed. Done means the per-document or per-thread processing no longer shares mutable global flags; verify with a concurrent PDF generation scenario that switches between Arabic and Latin text.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

For different TrueType fonts, it seems that one needs to change static (read: global) flags of the LayoutProcessor class.

https://github.com/LibrePDF/OpenPDF/blob/master/openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java

This will sooner or later lead to hard-to-find bugs in a multi-threaded environment due to race conditions, when OpenPDF is used by more than one thread to create PDFs.

To Reproduce

Due to its nature, this can only reproduced in a multi-threading environment when OpenPDF is used by several threads to create PDF docs, and each thread toggles some of the flags during execution, for example to render arabic text inbetween latin text. And then you still need luck to spot the bug.

So, in practice, this bug will inevitably occur in production, and probably only there.

See my comment on https://github.com/eclipse-birt/birt/pull/2144 for more details

Your real name

Henning von Bargen

Additional context

I think the LayoutProcessor class should be made a normal class (not only static attributes) and an instance of this class should be part of one the basic classes needed to add content to a PDF.

Lingua principale
Java
Stelle
4.4k
Fork
714
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LibrePDF/OpenPDF

Tutte le issue di LibrePDF/OpenPDF

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.