Skip to content

Commit 98934d1

Browse files
committed
feat: DartBridge.hardExit, and re-pin python-build to 20260908
dart:io's exit() runs the normal C teardown, which destroys the C++ statics inside every loaded CPython extension module. The interpreter lives on a detached thread that may still be running, so that teardown can fault it, giving a SIGSEGV on exit from an app that had already finished its work. The reported case died in matplotlib's ft2font looking up a pybind11 type-caster map that had just been destructed. hardExit routes to serious_python_hard_exit in dart_bridge 1.9.0, which terminates without running atexit handlers or static destructors. The symbol is resolved through the existing _lookupOrNull soft lookup, so an app built against an older libdart_bridge still loads; canHardExit is then false and the caller falls back to exit(). Version tables regenerated from python-build release 20260908, which carries dart_bridge 1.9.0. No CPython or Pyodide versions change.
1 parent a0343f9 commit 98934d1

14 files changed

Lines changed: 53 additions & 22 deletions

File tree

src/serious_python/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.7.0
2+
3+
* **`DartBridge.hardExit(exitCode)`: terminate without running process teardown.** `dart:io`'s `exit()` runs the normal C teardown, which destroys the C++ statics inside every loaded CPython extension module. The interpreter lives on a detached thread that may still be running, so that teardown can fault it, giving a `SIGSEGV` on exit from an app that had already finished its work. `hardExit` skips it. Guard with `DartBridge.canHardExit`, which is `false` against a pre-1.9.0 `libdart_bridge` (the symbol is resolved softly, like `isPythonInitialized` and `signalDartSession`); `hardExit` is then a no-op and the caller should fall back to `exit()`.
4+
* Bundled python-build snapshot re-pinned to [20260908](https://github.com/flet-dev/python-build/releases/tag/20260908) (`dart_bridge` **1.8.0 -> 1.9.0**), which is what carries the new `serious_python_hard_exit` export. No CPython or Pyodide versions change; the release exists to publish the updated manifest.
5+
16
## 4.6.0
27

38
* **The bundled CPython runtimes move to 3.12.14 / 3.13.15 / 3.14.7** (from 3.12.13 / 3.13.14 / 3.14.6) — the first Python version move since 4.3.x; every prior 4.4/4.5 release re-pinned python-build without changing a Python version. All three are security releases: they fix a quadratic-complexity DoS in incremental `html.parser.HTMLParser` parsing ([gh-153030](https://github.com/python/cpython/issues/153030)) and quadratic behaviour in `xml.etree.ElementTree` XPath index predicates ([gh-152674](https://github.com/python/cpython/issues/152674)), among others.

src/serious_python/lib/bridge.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
/// See [PythonBridge] for the per-channel API. The lower-level [DartBridge]
44
/// singleton (from the platform-interface package) is re-exported here for
55
/// embedders that need the process-reuse / session-restart hooks added in
6-
/// libdart_bridge 1.3.0 — `isPythonInitialized` and `signalDartSession`.
6+
/// libdart_bridge 1.3.0 (`isPythonInitialized` and `signalDartSession`), or
7+
/// the teardown-skipping `hardExit` added in 1.9.0.
78
library;
89

910
export 'package:serious_python_platform_interface/src/dart_bridge_ffi.dart'

src/serious_python/lib/src/python_versions.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// GENERATED by `dart run serious_python:gen_version_tables` from python-build's
2-
// manifest.json (release 20260902). Do not edit by hand — edit python-build's
2+
// manifest.json (release 20260908). Do not edit by hand — edit python-build's
33
// manifest.json, cut a release, bump `pythonReleaseDate`, and regenerate.
44

55
const pythonVersionEnvironmentVariable = "SERIOUS_PYTHON_VERSION";
@@ -10,8 +10,8 @@ const pyodideVersionEnvironmentVariable = "SERIOUS_PYTHON_PYODIDE_VERSION";
1010
const dartBridgeVersionEnvironmentVariable = "DART_BRIDGE_VERSION";
1111

1212
/// python-build release the bundled runtimes come from (YYYYMMDD).
13-
const pythonReleaseDate = "20260902";
14-
const dartBridgeVersion = "1.8.0";
13+
const pythonReleaseDate = "20260908";
14+
const dartBridgeVersion = "1.9.0";
1515
const defaultPythonVersion = "3.14";
1616

1717
class PythonRelease {

src/serious_python/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python
22
description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps.
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.6.0
5+
version: 4.7.0
66

77
platforms:
88
ios:

src/serious_python_android/android/python_versions.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# GENERATED by `dart run serious_python:gen_version_tables` from
2-
# python-build manifest.json (release 20260902). Do not edit by hand.
2+
# python-build manifest.json (release 20260908). Do not edit by hand.
33
default_python_version=3.14
4-
dart_bridge_version=1.8.0
5-
python_build_release_date=20260902
4+
dart_bridge_version=1.9.0
5+
python_build_release_date=20260908
66
3.12.full_version=3.12.14
77
3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a
88
3.13.full_version=3.13.15

src/serious_python_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python_android
22
description: Android implementation of the serious_python plugin
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.6.0
5+
version: 4.7.0
66

77
environment:
88
sdk: ">=3.0.0 <4.0.0"

src/serious_python_darwin/darwin/python_versions.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# GENERATED by `dart run serious_python:gen_version_tables` from
2-
# python-build manifest.json (release 20260902). Do not edit by hand.
2+
# python-build manifest.json (release 20260908). Do not edit by hand.
33
default_python_version=3.14
4-
dart_bridge_version=1.8.0
5-
python_build_release_date=20260902
4+
dart_bridge_version=1.9.0
5+
python_build_release_date=20260908
66
3.12.full_version=3.12.14
77
3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a
88
3.13.full_version=3.13.15

src/serious_python_darwin/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python_darwin
22
description: iOS and macOS implementations of the serious_python plugin
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.6.0
5+
version: 4.7.0
66

77
environment:
88
# The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the

src/serious_python_linux/linux/python_versions.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# GENERATED by `dart run serious_python:gen_version_tables` from
2-
# python-build manifest.json (release 20260902). Do not edit by hand.
2+
# python-build manifest.json (release 20260908). Do not edit by hand.
33
default_python_version=3.14
4-
dart_bridge_version=1.8.0
5-
python_build_release_date=20260902
4+
dart_bridge_version=1.9.0
5+
python_build_release_date=20260908
66
3.12.full_version=3.12.14
77
3.12.android_abis=arm64-v8a,x86_64,armeabi-v7a
88
3.13.full_version=3.13.15

src/serious_python_linux/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python_linux
22
description: Linux implementations of the serious_python plugin
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.6.0
5+
version: 4.7.0
66

77
environment:
88
sdk: '>=3.1.3 <4.0.0'

0 commit comments

Comments
 (0)