Bound the judge, and name what it would not finish - #22
Merged
Conversation
pdfimages does not return on pdfforms/gh-qpdf/qpdf_qtest_qpdf_shared-unnamed-field.pdf, 2496 bytes, and neither does pdfimages -list nor pdfinfo. Two sweeps stalled on it and were killed by hand. The hang is a property of the judge; what makes it dangerous is that a hang and a long job are indistinguishable from outside, so a sweep that stops dead at document 900 of 2268 is waited on rather than investigated. Every invocation of a poppler tool now goes through internal/poppler under one bound, and a document that exceeds it is recorded BY NAME with the tool that hung — Missing.Hung and Result.Tool, Summary.Hung in the record, a named line in both reports. It is never dropped and never retried. Three consequences are decisions rather than fallout. The deadline is read off the context, not off the error: a killed process reports a signal and a tool that merely failed reports a status, so the error cannot tell a hang from a refusal. A pdfinfo that hangs is not an unopenable document. Counting no answer as "neither would open it" would credit the document as unopenable, which is subtracted from a population's real size — so it would shrink the denominator every rate is quoted over. A listing that hangs does not make a page's pictures colour-converted. The listing decides which bucket every picture on the page lands in, so a page whose listing never came back would be tallied as wholly converted: a real number in a real column, indistinguishable from a page of CMYK. The bound is not calibrated from timings and says so. The machine is shared, so a duration measured on it measures the other job too, and a bound read off a loaded machine would fire on documents that are merely large. It is two minutes, far above any plausible handling of one page, -timeout on both commands, and the value a run used is recorded beside the gate because a run under a shorter bound names as hung what a longer one measures. Closes #21
pdfimages prints its version on STDERR, so reading only stdout recorded an empty judge in every baseline record — and the judge is half the measurement: a filter whose agreement falls because poppler changed has not regressed, and telling those apart afterwards is impossible if nobody wrote down which poppler it was. poppler.Combined sits beside poppler.Run for that one call, and for that one only: a listing read column by column must not have the tool's warnings folded into the table, where a line of complaint is a row.
Contributor
Author
|
The bound fires on the real document, end to end. With the document that hangs as its own one-document population and And one honesty about |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pdfimages -listdoes not return onpdfforms/gh-qpdf/qpdf_qtest_qpdf_shared-unnamed-field.pdf, a document of 2496 bytes. Neither doespdfimages, and neither doespdfinfo— all three confirmed here under a 25-second bound,rc=124each. Two sweeps stalled on it and had to be killed by hand.The hang is a property of the judge. What makes it dangerous is that a hang and a long job are indistinguishable from outside: a sweep that stops dead at document 900 of 2268 is waited on rather than investigated, and the wait has no end.
What changed
Every invocation of a poppler tool in this repository now goes through
internal/poppler, under one bound, and a document that exceeds it is recorded by name with the tool that hung —Missing.HungandResult.Tool,Summary.Hungin the baseline record, a named line in both commands' reports. It is never dropped and never retried.Three consequences are decisions rather than fallout, and each has a test:
pdfinfothat hangs is not an unopenable document.blameasks poppler whether it would open what ours refused; counting no answer as "neither would open it" would credit the document asunopenable, which is subtracted from a population's real size — so it would shrink the denominator every rate is quoted over.converted: a real number in a real column, indistinguishable from a page of CMYK.The bound is not calibrated from timings, and says so in the code: the machine is shared, so a duration measured on it measures the other job as much as this one, and a bound read off a loaded machine would fire on documents that are merely large. It is two minutes — far above any plausible handling of one page —
-timeouton both commands, and the value a run used is recorded beside the gate, because a run under a shorter bound names as hung what a longer one measures.The bound is exercised on something that genuinely does not return (
sleep) rather than on poppler, which is absent from the machine that runs the tests and would fail instantly — that would leave the branch that matters untested while looking covered.Gate
gofmt,go vet,-race, exact 100% statement coverage and the nine cross-compile targets, all underGOTOOLCHAIN=go1.27.0,GOWORK=off,CGO_ENABLED=0.Closes #21