Title: double free or corruption when enable python.IsolateNativeModules · Issue #563 · oracle/graalpython · GitHub
Open Graph Title: double free or corruption when enable python.IsolateNativeModules · Issue #563 · oracle/graalpython
X Title: double free or corruption when enable python.IsolateNativeModules · Issue #563 · oracle/graalpython
Description: How to reproduce? > environment container image: ghcr.io/graalvm/graalpy-community:25 jdk: graalvm-jdk-25_linux-x64_bin.tar.gz > python venv deps installed pip install torch transformers patchelf > multi context in maven repo(not package...
Open Graph Description: How to reproduce? > environment container image: ghcr.io/graalvm/graalpy-community:25 jdk: graalvm-jdk-25_linux-x64_bin.tar.gz > python venv deps installed pip install torch transformers patchelf >...
X Description: How to reproduce? > environment container image: ghcr.io/graalvm/graalpy-community:25 jdk: graalvm-jdk-25_linux-x64_bin.tar.gz > python venv deps installed pip install torch transformers patc...
Opengraph URL: https://github.com/oracle/graalpython/issues/563
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"double free or corruption when enable python.IsolateNativeModules","articleBody":"## How to reproduce?\n\n### \u003e environment\ncontainer image: ghcr.io/graalvm/graalpy-community:25\njdk: graalvm-jdk-25_linux-x64_bin.tar.gz\n\n### \u003e python venv deps installed\n`pip install torch transformers patchelf`\n\n### \u003e multi context in maven repo(not packaged as native-image)\n```java\n// Create a new GraalVM Python context and managed by org.apache.commons.pool2.impl.GenericObjectPool\nContext context = GraalPyResources\n .contextBuilder(Path.of(\"python-resources\"))\n .option(\"python.IsolateNativeModules\", \"true\")\n .allowExperimentalOptions(true)\n .allowIO(IOAccess.ALL)\n .allowCreateThread(true)\n .allowCreateProcess(true)\n .allowHostAccess(HostAccess.ALL)\n .allowAllAccess(true)\n .build();\n```\n\n```java\n// use contexts in parallel, scriptPool has 3 context above\nString scriptText = \"\"\n + \"import torch\\n\"\n + \"import transformers\\n\"\n + \"\\n\"\n + \"def main():\\n\"\n + \" print(f'Torch version: {torch.__version__}, Transformers version: {transformers.__version__}')\\n\";\nPythonScriptPool scriptPool = new PythonScriptPool(\"testScript\", scriptText, 3);\njava.util.stream.Stream.iterate(0, n -\u003e n + 1).limit(10).parallel().forEach(n -\u003e {\n try {\n scriptPool.executeMethod(\"main\", new Object[] {});\n } catch (Throwable e) {\n e.printStackTrace();\n System.exit(1);\n }\n});\n```\n\n### \u003e error log\n```\n18:18:13 #14 0.761 WARNING: A restricted method in java.lang.System has been called\n18:18:13 #14 0.761 WARNING: java.lang.System::load has been called by com.oracle.truffle.polyglot.JDKSupport in an unnamed module (file:/app/repo/target/bb-1.0-SNAPSHOT.jar)\n18:18:13 #14 0.761 WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module\n18:18:13 #14 0.761 WARNING: Restricted methods will be blocked in a future release unless native access is enabled\n18:18:13 #14 0.761 \n18:18:13 #14 1.081 WARNING: A terminally deprecated method in sun.misc.Unsafe has been called\n18:18:13 #14 1.081 WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime (file:/app/repo/target/bb-1.0-SNAPSHOT.jar)\n18:18:13 #14 1.081 WARNING: Please consider reporting this to the maintainers of class com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime\n18:18:13 #14 1.081 WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release\n18:18:21 #14 8.482 [To redirect Truffle log output to a file use one of the following options:\n18:18:21 #14 8.482 * '--log.file=\u003cpath\u003e' if the option is passed using a guest language launcher.\n18:18:21 #14 8.482 * '-Dpolyglot.log.file=\u003cpath\u003e' if the option is passed using the host Java launcher.\n18:18:21 #14 8.482 * Configure logging using the polyglot embedding API.]\n18:18:21 #14 8.482 [To redirect Truffle log output to a file use one of the following options:\n18:18:21 #14 8.482 * '--log.file=\u003cpath\u003e' if the option is passed using a guest language launcher.\n18:18:21 #14 8.482 * '-Dpolyglot.log.file=\u003cpath\u003e' if the option is passed using the host Java launcher.\n18:18:21 #14 8.482 * Configure logging using the polyglot embedding API.]\n18:18:21 #14 8.482 [To redirect Truffle log output to a file use one of the following options:\n18:18:21 #14 8.482 * '--log.file=\u003cpath\u003e' if the option is passed using a guest language launcher.\n18:18:21 #14 8.482 * '-Dpolyglot.log.file=\u003cpath\u003e' if the option is passed using the host Java launcher.\n18:18:21 #14 8.482 * Configure logging using the polyglot embedding API.]\n18:18:21 #14 8.482 [python::CApiContext] WARNING: Loading C extension module torch._C from '/app/repo/python-resources/venv/lib/python3.12/site-packages/torch/_C.graalpy250-312-native-x86_64-linux.so'. Support for the Python C API is considered experimental. See https://www.graalvm.org/latest/reference-manual/python/Native-Extensions/#embedding-limitations for the limitations. You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'.\n18:18:21 #14 8.482 [python::CApiContext] WARNING: Loading C extension module torch._C from '/app/repo/python-resources/venv/lib/python3.12/site-packages/torch/_C.graalpy250-312-native-x86_64-linux.so'. Support for the Python C API is considered experimental. See https://www.graalvm.org/latest/reference-manual/python/Native-Extensions/#embedding-limitations for the limitations. You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'.\n18:18:21 #14 8.482 [python::CApiContext] WARNING: Loading C extension module torch._C from '/app/repo/python-resources/venv/lib/python3.12/site-packages/torch/_C.graalpy250-312-native-x86_64-linux.so'. Support for the Python C API is considered experimental. See https://www.graalvm.org/latest/reference-manual/python/Native-Extensions/#embedding-limitations for the limitations. You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'.\n18:18:21 #14 8.806 double free or corruption (out)\n18:18:21 #14 8.806 double free or corruption (!prev)\n18:18:21 #14 8.806 #\n18:18:21 #14 8.806 # A fatal error has been detected by the Java Runtime Environment:\n18:18:21 #14 8.806 #\n18:18:21 #14 8.806 # SIGSEGV (0xb) at pc=0x00007f24b9d9a997, pid=1, tid=52\n18:18:21 #14 8.806 #\n18:18:21 #14 8.806 # JRE version: Java(TM) SE Runtime Environment Oracle GraalVM 25.0.1+8.1 (25.0.1+8) (build 25.0.1+8-LTS-jvmci-b01)\n18:18:21 #14 8.806 # Java VM: Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25.0.1+8.1 (25.0.1+8-LTS-jvmci-b01, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, g1 gc, linux-amd64)\n18:18:21 #14 8.806 # Problematic frame:\n18:18:21 #14 8.806 # C [libc.so.6+0x28997] abort+0x174\n18:18:21 #14 8.806 #\n18:18:21 #14 8.806 # Core dump will be written. Default location: /app/repo/core.1\n18:18:21 #14 8.806 #\n18:18:21 #14 8.807 # An error report file with more information is saved as:\n18:18:21 #14 8.807 # /app/repo/hs_err_pid1.log\n18:18:21 #14 8.835 [8.718s][warning][os] Loading hsdis library failed\n18:18:53 #14 39.29 #\n18:18:53 #14 39.29 # If you would like to submit a bug report, please visit:\n18:18:53 #14 39.29 # https://bugreport.java.com/bugreport/crash.jsp\n18:18:53 #14 39.29 # The crash happened outside the Java Virtual Machine in native code.\n18:18:53 #14 39.29 # See problematic frame for where to report the bug.\n18:18:53 #14 39.29 #\n```\n\n","author":{"url":"https://github.com/suiwenfeng","@type":"Person","name":"suiwenfeng"},"datePublished":"2025-10-28T10:47:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/563/graalpython/issues/563"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:be221fa5-58ad-99a0-20f9-6911dacda376 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87B0:2EB8B3:20B5673:2E0E60B:696F6297 |
| html-safe-nonce | cf233a72465b5fbdccd46f7dcbbfa45dfbaaa043549ef16f66f0e80b250cd5e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0IwOjJFQjhCMzoyMEI1NjczOjJFMEU2MEI6Njk2RjYyOTciLCJ2aXNpdG9yX2lkIjoiMzQzMzIzNTQxODk2MDU4NTM2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5bc5690b4d8e4ebcecf2528b445bfeac27b5de2ccb6b493347b56bc01a5df097 |
| hovercard-subject-tag | issue:3560939675 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/oracle/graalpython/563/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ebd20d07b904681d482bef0c228cd5d6ed16241af7851eb3b2e3290039df916b/oracle/graalpython/issues/563 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ebd20d07b904681d482bef0c228cd5d6ed16241af7851eb3b2e3290039df916b/oracle/graalpython/issues/563 |
| og:image:alt | How to reproduce? > environment container image: ghcr.io/graalvm/graalpy-community:25 jdk: graalvm-jdk-25_linux-x64_bin.tar.gz > python venv deps installed pip install torch transformers patchelf >... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | suiwenfeng |
| hostname | github.com |
| expected-hostname | github.com |
| None | 774d0922d2c4577043d2dab90427344eb4c6ce1d5579acb1dd504cff1a7e46f8 |
| turbo-cache-control | no-preview |
| go-import | github.com/oracle/graalpython git https://github.com/oracle/graalpython.git |
| octolytics-dimension-user_id | 4430336 |
| octolytics-dimension-user_login | oracle |
| octolytics-dimension-repository_id | 129883600 |
| octolytics-dimension-repository_nwo | oracle/graalpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 129883600 |
| octolytics-dimension-repository_network_root_nwo | oracle/graalpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 650acea592f12d1bd8931d44546c209e0b06ed6e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width