Skip to content

Commit 84880be

Browse files
committed
FEATURE-ci-darwin-header-deadline: Preserve native launcher signal defaults
Restore each available SIGPIPE, SIGXFZ and SIGXFSZ to SIG_DFL immediately before the diagnostic Python launcher execs the native suite, matching direct Popen restore_signals behavior. Keep UID/context/token checks, native code, buffered traces, assertions, budgets and exact archive bindings unchanged. A real native signal-report helper demonstrates RED ignored dispositions through the prior Python exec fragment and GREEN defaults matching direct Popen after restoration. Workflow/Python/shell syntax and non-root rejection checks pass; privileged Darwin execution remains pending.
1 parent c278e45 commit 84880be

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎.github/workflows/v3-package-validation.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,14 @@ jobs:
221221
graph = audit.dependency_graph([str(executable)])
222222
matrix.check_linkage(graph, 'shared', prefix)
223223
receipt['dependencies'] = graph
224-
launch = ('import json,os,sys; assert os.geteuid() == 0; '
224+
launch = ('import json,os,signal,sys; assert os.geteuid() == 0; '
225225
'assert not any(key in os.environ for key in ("GH_TOKEN", "GITHUB_TOKEN")); '
226226
'context=dict(uid=os.getuid(),euid=os.geteuid(),gid=os.getgid(),egid=os.getegid(),cwd=os.getcwd(),'
227227
'runtime={key:os.environ.get(key) for key in ("PATH","DYLD_LIBRARY_PATH","LD_LIBRARY_PATH","V3_PACKAGE_TOOLCHAIN")}); '
228228
'print("V3_DIAGNOSTIC_CONTEXT " + json.dumps(context),flush=True); '
229+
'signal.signal(signal.SIGPIPE, signal.SIG_DFL) if hasattr(signal, "SIGPIPE") else None; '
230+
'signal.signal(signal.SIGXFZ, signal.SIG_DFL) if hasattr(signal, "SIGXFZ") else None; '
231+
'signal.signal(signal.SIGXFSZ, signal.SIG_DFL) if hasattr(signal, "SIGXFSZ") else None; '
229232
'os.execvpe(sys.argv[1],sys.argv[1:],os.environ)')
230233
result = command([sys.executable, '-c', launch, str(executable)], source / 'test', runtime, timeout=180, allow_failure=True)
231234
print(result, end='', flush=True)

‎specs/tasks/FEATURE-ci-darwin-header-deadline.md‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ flags. The build stage asserts EUID 0 and token absence. A final assert-and-exec
7373
launcher records the actual test process UID/GID, cwd and selected runtime
7474
search environment before replacing itself with the unchanged test executable;
7575
its EUID must be 0 and its environment must exclude both token variables.
76+
Immediately before native exec, that launcher restores each available SIGPIPE,
77+
SIGXFZ and SIGXFSZ to SIG_DFL. This preserves the original direct subprocess
78+
signal setup after Python startup would otherwise reintroduce ignored
79+
signals. [Python subprocess documentation](https://docs.python.org/3/library/subprocess.html#subprocess.Popen)
80+
defines this default `restore_signals` behavior. This is an execution comparator
81+
correction, not an established explanation of the deadline failure.
7682

7783
Buffered runner-context run `39978609885`, job `120499691522`, subsequently
7884
finishes successfully with four tests, 52 checks and zero failures/skips. It
@@ -176,8 +182,14 @@ original required gate remain incomplete. For the privilege-only follow-up,
176182
YAML, both Python stages and all macOS shell syntax pass; artifact/overlay code,
177183
permissions, other jobs and all C++ files are unchanged. An actual local env
178184
check proves both token variables are stripped while ordinary context survives;
179-
the literal test launcher rejects local EUID 1000 before exec. These are setup
180-
checks; native sudo/build/test EUID 0 execution remains pending.
185+
the literal test launcher rejects local EUID 1000 before exec. A real tiny C
186+
signal-report helper then demonstrated RED: direct Popen starts with available
187+
SIGPIPE/SIGXFSZ defaults, while the prior Python exec fragment inherits ignored
188+
dispositions. GREEN: the corrected literal signal/exec fragment yields identical
189+
native defaults. SIGXFZ is checked when available. This proves the focused signal
190+
correction locally, without claiming root execution; all native code and archive
191+
bindings remain unchanged. These are setup checks; native sudo/build/test EUID 0
192+
execution remains pending.
181193

182194
The caller reviews/publishes only this task branch and dispatches the existing
183195
workflow, then resumes this same worktree with actual native evidence. No root

0 commit comments

Comments
 (0)