Close reader descriptor after open errors#28
Conversation
Signed-off-by: Jeet Dekivadia <jeet.university@gmail.com>
Signed-off-by: Jeet Dekivadia <jeet.university@gmail.com>
|
Small follow-up on this one: the patch is limited to the The regression exercises repeated malformed opens and checks that |
|
I rechecked this today while it is waiting for review. The diff is still narrowly on the One detail I wanted to call out explicitly: the cleanup intentionally preserves the original parse/open exception and treats descriptor close as best-effort only on that failure path. The normal successful reader path is unchanged. DCO is still green. |
Fixes #27.
Reader.open_opened a descriptor and passed it directly into trace-header parsing. If a truncated or malformed trace raised duringmake_reader, the caller never received a reader value and had no descriptor to close.Close the descriptor best-effort on the exception path and re-raise the original parsing exception. Successful readers retain ownership exactly as before.
The Linux regression opens an invalid trace ten times and checks
/proc/self/fdbefore and after the loop, so the failure path must leave the descriptor count flat.Validation:
git diff --checkppx_jane, then randune build @all -j2; compilation reaches the repository sources but the public toolchain cannot compile existingDomain.SafeandSys.Safeuses and existing warning-as-error findings, sodune runtestis not reachable outside the Jane Street build environment