forked from pyodide/pyodide
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Prevent segfaults in CLI runner (pyodide#4836)
After many hours of debugging, I minimized the problem down to this: emscripten-core/emscripten#22052 Thanks to @henryiii for reporting. See thread here for my comments while I was debugging: scikit-hep/boost-histogram#938 Resolves pyodide#2964.
- Loading branch information
Showing
9 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package: | ||
name: cpp-exceptions-test2 | ||
version: "1.0" | ||
tag: | ||
- core | ||
- pyodide.test | ||
source: | ||
path: src | ||
build: | ||
cxxflags: -fexceptions | ||
ldflags: -fexceptions |
13 changes: 13 additions & 0 deletions
13
packages/cpp-exceptions-test2/src/cpp_exceptions_test2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "Python.h" | ||
#include <stdexcept> | ||
|
||
extern "C" __attribute__((visibility("default"))) PyObject* | ||
PyInit_cpp_exceptions_test2() | ||
{ | ||
try { | ||
throw std::runtime_error("something bad?"); | ||
} catch (const std::exception& e) { | ||
PyErr_SetString(PyExc_ImportError, "oops"); | ||
} | ||
return nullptr; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from setuptools import Extension, setup | ||
|
||
setup( | ||
name="cpp-exceptions-test2", | ||
version="1.0", | ||
ext_modules=[ | ||
Extension( | ||
name="cpp_exceptions_test2", # as it would be imported | ||
# may include packages/namespaces separated by `.` | ||
language="c++", | ||
sources=[ | ||
"cpp_exceptions_test2.cpp" | ||
], # all sources are compiled into a single binary file | ||
), | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters