Skip to content

Expose sticky SoInput read errors and distinguish compressed failures from EOF - #830

Draft
Dikluwe wants to merge 16 commits into
coin3d:masterfrom
Dikluwe:codex/pr/soinput-read-status
Draft

Dikluwe wants to merge 16 commits into
coin3d:masterfrom
Dikluwe:codex/pr/soinput-read-status

Conversation

@Dikluwe

@Dikluwe Dikluwe commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Callers could not distinguish a backend read failure from normal end-of-input. Truncated gzip data in files or memory could end with a false success state; a valid bzip2 stream could receive a false error after STREAM_END.

Changes

  • Add non-virtual SoInput::hasReadError() backed by private sticky reader state; reset it when input is replaced.
  • Preserve errors across buffered reads and FILE, gzip and bzip2 readers; consult gzerror for gzip files.
  • Report truncated gzip bodies/trailers and CRC failures; close the bzip2 handle at STREAM_END instead of reading it again.
  • Cover real/injected read failures, valid/truncated compressed inputs and reset/reuse. The compression oracle failed against the original readers and passed after correction.

Public object layout/vtable is unchanged. This adds a public method/symbol. Parser errors are distinct from backend IO errors; hasReadError is not a general syntax validator. A client compiled with the old SoInput header linked and ran against the reviewed combined library; formal ABI and native-platform checks remain CI gates.

Dependencies — keep as draft

Depends on #829. The diff against master includes the prerequisite stack. The contribution over the reviewed base is linked below; narrow/rebase the PR after its prerequisites are integrated.

Base: f105276397f2abdef992b9d69e9607580fe78b04 (codex/pr/coin-stdio-consumers). Review this contribution over its base.

Validation

Linux candidate 95/95 CTests at 6231f73050106853fee3479f175e7dbaa5a284e3, with no skips. Dedicated integration lab previously passed 149/149 at a945832842ef72ea3be06c8224f47adec38cf501; that lab count is a separate reviewed snapshot.

Fresh publication gate of all eight exact heads: 35/35 directed and 153/153 total CTests, no skips, at e6687c088077082e6839b4fc39c632d5267b07d8. GCC/Ninja Debug shared build with COIN_THREADSAFE=ON and external Expat, build and compiler temporary files in RAM; Xvfb/software GLX environment. git diff --check passed for the proposed delta. Native Windows/macOS and formal ABI checks rerun on this published head.

Windows DLL fixture correction — 2026-10-09

The first Windows run could not link CoinAtexitTest because it called private, non-exported coin_is_exiting. The fixture now checks callback ordering, initialization during reentrant finish, completed shutdown and restart through exported public SoDB APIs. Production code and public symbols are unchanged by this correction. It is propagated from #827 through #828–#830.

Current head 4bc66f746b288f664ebd7023da1a922c0f2058a4; reviewed contribution base 35c8f75bbbaa001bd838d9b21c2dc3081d10b16f. The refreshed #827 candidate passed 86/86, and the exact published composition passed 35/35 directed and 153/153 full CTests, no skips, at e5c732433599f2407c83ab50cdcb1cd9f23221c8 (GCC/Ninja Debug shared, thread safety, external Expat, RAM/Xvfb/software GLX). Earlier individual counts above refer to their recorded snapshots. Native CI reruns on these heads.

Compression runtime and inherited ABI diagnostic — 2026-10-09

Current head 0e549ee73e2d951d140eecb6098416430b56d6c1 also tries the versioned libbz2.so.1.0/libbz2.so.1 runtime names, allowing compressed input without an unversioned development-library symlink. A loader control rejecting unversioned bz2 names failed with the old glue and passed with the new glue. Candidate 95/95 and publication composition 35/35 directed, 153/153 total CTests, no skips, at d7f08bae8c9b0091789474b334a3dca81de3be3e.

The formal ABI workflow reported reference-to-pointer parameter metadata for cc_xml_doc_get_filter_cb and cc_xml_doc_write_to_buffer already changed by upstream commit c973e1d (#764). This PR has no XML source/header delta against master. A client compiled with the original v4.0.10 XML headers successfully retrieved callback/userdata and serialized a document through those exact old reference signatures against this library. No ABI suppression was added and the formal check is not claimed passed: the inherited diagnostic remains for manual ABI review. Keep this PR as draft while its prerequisites and that review remain outstanding.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant