Skip to content

pg query ext segfault at thread exit after the extension is unloaded frankenphp zts - #2797

Merged
norberttech merged 4 commits into
1.xfrom
2796-pg-query-ext-segfault-at-thread-exit-after-the-extension-is-unloaded-frankenphp-zts
Dec 3, 2026
Merged

norberttech merged 4 commits into
1.xfrom
2796-pg-query-ext-segfault-at-thread-exit-after-the-extension-is-unloaded-frankenphp-zts

Conversation

@norberttech

Copy link
Copy Markdown
Member

Resolves: #2796

Change Log


Added

  • flow-php/pg-query-ext - ZTS test for threads that exit after the extension is unloaded
  • flow-php/flow-php-ext - ZTS test for threads that exit after the extension is unloaded
  • flow-php/arrow-ext - ZTS test for threads that exit after the extension is unloaded
  • flow-php/arrow-ext - test for a stream that calls back into its own writer

Fixed

  • flow-php/pg-query-ext - segfault at thread exit after the extension is unloaded (FrankenPHP, ZTS)

Changed

  • flow-php/flow-php-ext - ext-php-rs upgraded to 0.17
  • flow-php/arrow-ext - ext-php-rs upgraded to 0.17
  • flow-php/arrow-ext - a stream that calls back into its own writer gets an Error
  • flow-php/flow-php-ext - CI lints the ZTS test with the zts-embed feature
  • flow-php/arrow-ext - CI lints the ZTS test with the zts-embed feature

Removed

Deprecated

Security

…on is unloaded

- keep pg_query.so mapped for the life of the process
- ZTS test: engine thread and a parsing thread exit after the unload
…unload

- engine thread and a late worker exit after the engine shutdown
- compile-time ZTS assertion in the flow-php-ext test
- CI lints the ZTS tests with the zts-embed feature
- class objects come out of a Zval as borrow guards
- re-entry into a writer from its own stream throws an Error
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.56%. Comparing base (cfb8a66) to head (5086e03).
⚠️ Report is 5 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2797      +/-   ##
============================================
+ Coverage     91.50%   91.56%   +0.05%     
  Complexity    32588    32588              
============================================
  Files          2256     2245      -11     
  Lines         94239    93522     -717     
============================================
- Hits          86237    85635     -602     
+ Misses         8002     7887     -115     
Components Coverage Δ
etl 97.33% <ø> (+0.15%) ⬆️
cli 87.86% <ø> (+0.46%) ⬆️
lib-array-dot 96.48% <ø> (-0.05%) ⬇️
lib-azure-sdk 69.84% <ø> (ø)
lib-doctrine-dbal-bulk 95.06% <ø> (-0.32%) ⬇️
lib-filesystem 89.43% <ø> (+0.01%) ⬆️
lib-types 96.48% <ø> (+0.52%) ⬆️
lib-parquet 82.67% <ø> (-0.13%) ⬇️
lib-parquet-viewer 83.03% <ø> (-0.12%) ⬇️
lib-snappy 89.86% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 90.62% <ø> (+0.02%) ⬆️
lib-telemetry 87.30% <ø> (+0.06%) ⬆️
bridge-filesystem-async-aws 96.91% <ø> (-0.01%) ⬇️
bridge-filesystem-azure 95.94% <ø> (+0.18%) ⬆️
bridge-filesystem-sftp 90.36% <ø> (ø)
bridge-monolog-http 97.87% <ø> (+1.03%) ⬆️
bridge-monolog-telemetry 98.91% <ø> (+6.05%) ⬆️
bridge-openapi-specification 91.79% <ø> (-0.17%) ⬇️
symfony-http-foundation 80.00% <ø> (-0.77%) ⬇️
bridge-symfony-console 98.58% <ø> (+0.56%) ⬆️
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.88% <ø> (-0.07%) ⬇️
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.34% <ø> (+0.23%) ⬆️
bridge-symfony-http-foundation-telemetry 100.00% <ø> (+7.14%) ⬆️
bridge-symfony-filesystem-bundle 94.43% <ø> (+1.24%) ⬆️
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 94.12% <ø> (+0.23%) ⬆️
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 91.36% <ø> (-0.14%) ⬇️
adapter-chartjs 82.46% <ø> (ø)
adapter-csv 97.68% <ø> (ø)
adapter-doctrine 94.24% <ø> (-1.12%) ⬇️
adapter-google-sheet 97.53% <ø> (ø)
adapter-http 87.31% <ø> (-0.10%) ⬇️
adapter-json 90.46% <ø> (-0.16%) ⬇️
adapter-logger 47.05% <ø> (ø)
adapter-parquet 95.94% <ø> (-1.00%) ⬇️
adapter-text 97.68% <ø> (ø)
adapter-xml 98.34% <ø> (+0.32%) ⬆️
adapter-avro 6.25% <ø> (ø)
adapter-excel 96.57% <ø> (-0.23%) ⬇️
adapter-postgresql 97.43% <ø> (-0.16%) ⬇️
adapter-seal 85.90% <ø> (-4.10%) ⬇️
bridge-phpunit-postgresql 75.00% <ø> (-0.31%) ⬇️
bridge-phpunit-telemetry 87.85% <ø> (+0.49%) ⬆️
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official

This comment has been minimized.

@norberttech
norberttech merged commit 45a8e57 into 1.x Dec 3, 2026
34 checks passed
@norberttech
norberttech deleted the 2796-pg-query-ext-segfault-at-thread-exit-after-the-extension-is-unloaded-frankenphp-zts branch December 3, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pg-query-ext: segfault at thread exit after the extension is unloaded (FrankenPHP, ZTS)

1 participant