Skip to content

Experimental native-runner CI row; libc int returns sign-extended (waitpid -1 on Linux); pcntl_fork flushes; TLS test flake - #12

Merged
blacktrs merged 4 commits into
mainfrom
runner-ci
Sep 29, 2026
Merged

blacktrs merged 4 commits into
mainfrom
runner-ci

Conversation

@blacktrs

@blacktrs blacktrs commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Experimental native test runner in CI — a new linux-arm64-native-runner row runs the same arm64 build, but the suite goes through tests/aot/runner (compiled by the compiler under test) with its output streamed live. It is continue-on-error, reads the arm64 compiler cache and never writes it or publishes a seed. Both rows print suite time: Ns, so run.sh and the native runner can be compared for speed and readability.

Bugs found on the way

  • libc binds returning a C int lacked #[CType('int')] (23 of them: waitpid, fork, dup, the sig* family, chown, symlink, fnmatch, mkstemp, …). On Linux their -1 came back as 4294967295, so while (pcntl_waitpid(-1, $st) > 0) never ended — the native runner hung on it after its pool. Case pcntl_waitpid_no_child (red on Linux before, green after).
  • pcntl_fork() did not flush stdout — the child re-printed the parent's pending output on exit; php's CLI echo is unbuffered.
  • tls_write_per_park_timeout flake on alpine-amd64 — the test's server treated '' from a non-blocking TLS read as EOF.

Runner parity with run.sh: mc_limit timeouts, @serial, dead-worker cases count red, passed: / failures: lines in discovery order, one case per worker at a time; outside a TTY each failure is named live.

…rom a non-blocking TLS stream is 'no whole record yet', and a slow runner (alpine-amd64 CI) hit it mid-transfer and stopped short
…dup, sig*set/procmask/pending/wait, chown, lchown, symlink, link, truncate, utimes, statvfs, fnmatch, mkstemp, gethostname, sockatmark, getentropy, getrusage, getppid — on Linux their -1 came back as 4294967295, so `while (pcntl_waitpid(-1, $st) > 0)` never ended (the native test runner hung on its reap loop); pcntl_fork() flushes stdout first, as php's unbuffered CLI echo does, or the child printed the parent's pending output again
…EOUT / MC_RUN_TIMEOUT), @serial cases alone after the pool, a dead worker's cases count red, run.sh's passed:/failures: lines (discovery order), one case at a time per worker, the libc probed once; outside a TTY every failure is named the moment it lands
…he suite through tests/aot/runner streamed live (gate.sh MC_RUNNER=native), continue-on-error, reads the arm64 compiler cache but never writes it or publishes a seed; both harnesses print 'suite time' so the two rows compare
@blacktrs
blacktrs merged commit 3a234ec into main Sep 29, 2026
7 checks passed
@blacktrs
blacktrs deleted the runner-ci branch September 30, 2026 11:32
blacktrs added a commit that referenced this pull request Oct 13, 2026
…n, SPKAC, PKCS#7/#12 over libcrypto (#236)

* openssl: symmetric ciphers (incl. AEAD), digests, pbkdf2, random on libcrypto, plus OPENSSL_* constants

* openssl: RSA/EC keys, sign/verify, raw RSA crypt, OpenSSLCertificate and x509_parse over libcrypto (#211, slice 1)

* openssl: CCM/OCB, real cipher/digest registry, key introspection and derive, CSR/SPKAC/PKCS#7/#12 helpers on libcrypto (#211)

* openssl: x509 export/verify/purpose, EC/DSA/DH/X25519/Ed25519 keys, CSR, seal/open, SPKAC, PKCS#7 and PKCS#12 entry points (#211)

* Repro: var_dump() of a void call prints int(0) instead of NULL

* openssl: CMS API; align return values and warnings with php 8.5.11

Adds openssl_cms_sign / verify / encrypt / decrypt / read (DER, S/MIME, PEM) and the
OPENSSL_CMS_* constants, then re-checks the whole openssl surface against php: where php
returns a value or false/-1 WITHOUT a warning this build now returns exactly that; where php
emits a warning and carries on, this build throws a ValueError (project rule).

php parity (no warning in php, same answer here):
- openssl_cms_read returns false for every input and leaves the out-parameter untouched.
- openssl_cms_verify: unreadable input / junk message -> false; once the message parses, $pk7 is
  created empty (it receives the CMS PEM only when a signers file is requested too, as in php),
  $content is filled even by a failed verification, signers are written only on success.
- cms/pkcs7 encrypt|decrypt with a missing or junk input, pkcs7_verify (-1), x509_verify /
  x509_checkpurpose (-1), x509_check_private_key, pkey_derive, pkey_get_public of a private PEM,
  pkey_get_private / csr_get_* of junk, public_encrypt of too much data, decrypt of an AEAD
  message without a tag, pbkdf2 with iterations < 1: all answer false / -1 silently.

Throws where php warns (ValueError instead of warning + false):
- unknown cipher / digest / signature algorithm / curve / DN field / encoding / cipher id
- unusable certificate, private key, public key, CSR or SPKAC argument; a private key object
  where a public key is wanted; a public key object where a private key is wanted
- unreadable input file (cms/pkcs7 sign), unreadable CA path (checkpurpose, *_verify)
- cms_sign with OPENSSL_CMS_DETACHED and S/MIME encoding
- IV / tag problems on encrypt, OPENSSL_DONT_ZERO_PAD_KEY with a wrong key length
- openssl_pkey_new EC without curve_name; csr_sign with a key that does not match the CA

Known gaps: openssl.cnf-driven options (config, req_extensions, x509_extensions, CSR extra
attributes) throw instead of being parsed; openssl_pkey_new(DH) without p/g returns false
where php generates default parameters.

Refs #211

* test: openssl_x509_parse prints only the purposes every OpenSSL version has (codesign is 3.2+)
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