You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem 11 checker: sprintf into a 30-byte buffer aborts on every correct answer #180
"Ratio: 1.000000, RatioUnbounded: 1.000000" is 41 characters plus the terminator. With the
judge's -O2 build glibc's fortified sprintf detects the overflow and aborts before quitp
runs.
Effect
This line is only reached by outputs that are a valid palindrome path covering every blank
cell and ending at the target, i.e. only correct answers crash the checker. Wrong answers
take the earlier quitp(0.0, ...) paths and get a clean 0; the three cases whose answer is -1 go through quitf(_ok, ...) and score 1. The best any submission can reach is therefore
3/10 = 0.300, and in our archived runs 15 of 16 submissions sit exactly at 0.300 with the judge
message *** buffer overflow detected ***.
Side note, not part of the fix: on line 73 op.size() - bound is evaluated in size_t, so for
any path shorter than bound the subtraction wraps and RatioUnbounded is reported as about -5.7e13. The score is unaffected; only the unbounded figure in the message is garbage.
Verification
Feeding the shipped testdata/1.ans back to the checker as contestant output:
With the fix below all ten shipped answers score points 1.0.
A remark on scoring once the crash is gone
bound = 12 * blank * max(n, m) is about 300,000 moves on the shipped 30×30 cases, while the
shipped .ans paths are 26k–65k moves and every archived agent path is 3k–11k. The checker
never reads .ans. So after the fix every valid answer scores exactly 1.0 and "minimize the
number of moves" is not measured at all; the problem is effectively pass/fail. Whether to
tighten bound (e.g. to the reference length, or a best-known length) is a separate design
decision for the maintainers — this issue only asks for the crash to be fixed.
Problem 22's checker.cpp (lines 122-124) has the identical char mes[30] + sprintf pattern, pointed out by a reviewer on #184. It is fixed in the same PR (commit eb69809); a search of every checker and interactor under algorithmic/problems finds no further instance.
Activity
weiwch commentedon Sep 10, 2026
The same problem is in
algorithmic/problems/22/checker.cpp.Consider fixing it as well.
xiawubing commentedon Sep 10, 2026
Problem 22's
checker.cpp(lines 122-124) has the identicalchar mes[30]+sprintfpattern, pointed out by a reviewer on #184. It is fixed in the same PR (commit eb69809); a search of every checker and interactor underalgorithmic/problemsfinds no further instance.Fix FrontierCS#180 FrontierCS#181: unjudgeable checkers for problems …