Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

LayoutProcessor and multi-threading environment

Đang mở
#1,307 12 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
4.4k
Fork
714
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LibrePDF/OpenPDF

Tất cả issue của LibrePDF/OpenPDF

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.