openai / openai/codex

Linux x86_64 .deb contains malformed bundled Tectonic binary

Open
#38,995 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using?

26.810.52044 (Linux .deb package version)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Linux x86_64

What issue are you seeing?

The Linux x86_64 .deb contains a malformed Tectonic executable at:

/usr/lib/chatgpt/resources/plugins/openai-bundled/plugins/latex/bin/tectonic

The bundled LaTeX plugin invokes this executable using Tectonic's V2 CLI. The process hangs indefinitely and does not produce a PDF.

The executable is structurally invalid as an ELF file:

ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
missing section headers at 60077368

readelf reports:

readelf: Error: Reading 2240 bytes extends past end of file for section headers

A byte-level comparison with the official Tectonic 0.17.0 x86_64-unknown-linux-gnu release identifies the corruption precisely:

  • Both binaries have GNU Build ID 14a82f2adbabbf18f5692344d7633674040a8c36.
  • Official Tectonic size: 60077496 bytes.
  • Bundled Tectonic size: 60048824 bytes.
  • Difference: exactly 0x7000 / 28672 bytes.
  • Both files are byte-identical through offset 0x33b516f.
  • The official binary contains 0x7000 zero bytes from 0x33b5170 through 0x33bc16f.
  • Those bytes are absent from the bundled binary.
  • From official-binary offset 0x33bc170 onward, the remainder is byte-identical to the bundled binary, shifted earlier by exactly 0x7000.

The removed range is inside the ELF .got section and ends exactly where .got.plt begins:

.got      file offset 0x33b46c8, size 0x7aa8
.got.plt  file offset 0x33bc170

The ELF offsets were not adjusted for this removal. Consequently, data following the removed range is interpreted at incorrect file offsets and the section-header table points beyond EOF.

What steps can reproduce the bug?

Create a minimal document:

cat > test.tex <<'EOF'
\documentclass{article}
\begin{document}
Hello from Tectonic.
\end{document}
EOF

Run Tectonic using the command used by the bundled LaTeX plugin:

TECTONIC_UNTRUSTED_MODE=1 \
timeout 30s \
/usr/lib/chatgpt/resources/plugins/openai-bundled/plugins/latex/bin/tectonic \
  -X compile \
  --outdir . \
  --outfmt pdf \
  --print \
  --untrusted \
  test.tex

The command times out and no test.pdf is produced.

The official upstream Tectonic 0.17.0 x86_64-unknown-linux-gnu executable successfully compiles the same document with the same arguments and produces test.pdf.

What is the expected behavior?

The Tectonic executable bundled with the Linux .deb should be a valid ELF executable and should successfully compile LaTeX documents using the command invoked by the bundled LaTeX plugin.

Additional information

Bundled executable:

SHA-256: dacccc2c38395a72332910ff54223a5ee2f0acacbd94ed40ab98bda636a5aa9e
GNU Build ID: 14a82f2adbabbf18f5692344d7633674040a8c36
Size: 60048824 bytes

The matching official Tectonic 0.17.0 binary has the same GNU Build ID and is exactly 0x7000 bytes larger.

The byte pattern is consistent with a zero-filled/sparse region being collapsed during packaging or post-processing without preserving the file's logical layout. This is an inference from the resulting file structure; the exact packaging step responsible is not known.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Linux .deb artifact at /usr/lib/chatgpt/resources/plugins/openai-bundled/plugins/latex/bin/tectonic and reproduce the failure using the provided timeout command and test.tex. Inspect the packaged binary with readelf and compare it with the official Tectonic 0.17.0 executable. Done means the bundled file is a valid ELF and the same command produces test.pdf.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, linux, rust
Domain
build-system, devops, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.