Skip to content

fixes shmem SIGSEGV#479

Merged
coderfeli merged 3 commits into
mainfrom
yashao/fix_shmem
May 9, 2026
Merged

fixes shmem SIGSEGV#479
coderfeli merged 3 commits into
mainfrom
yashao/fix_shmem

Conversation

@yanboshao
Copy link
Copy Markdown
Contributor

@yanboshao yanboshao commented May 7, 2026

Motivation

FlyDSL's <#fly.explicit_module> declared its GPU-module loader helpers as single-arg void(void*) that hand-unpacked the outputs, but MLIR's ExecutionEngine already wraps every JIT entry in its own packed-args trampoline, so two layers of "packing" stacked up. Python packed the args once, the trampoline dereferenced once more, the real loader received NULL pointers and store-to-NULL segfaulted on the very first GPU module init.

Technical Details

Change init/load's LLVM signature to a plain N-arg void(void** module_out, int32_t* err) so MLIR's wrapper sees a normal one-slot-per-arg function. Rewrite _pack_ciface_args to the canonical packed-args layout — one holder cell per argument — so the C++ and Python sides finally agree on a single, MLIR-standard ABI.

Test Plan

Test Result

Submission Checklist

@yanboshao yanboshao marked this pull request as draft May 7, 2026 15:09
@yanboshao yanboshao force-pushed the yashao/fix_shmem branch from 56bee9c to 9e34cc9 Compare May 8, 2026 02:14
@yanboshao yanboshao force-pushed the yashao/fix_shmem branch from 9e34cc9 to 3efbbf8 Compare May 8, 2026 02:22
@yanboshao yanboshao marked this pull request as ready for review May 9, 2026 02:37
@coderfeli coderfeli merged commit 3b69469 into main May 9, 2026
11 checks passed
@coderfeli
Copy link
Copy Markdown
Collaborator

LGTM. merged @yanboshao

@coderfeli coderfeli deleted the yashao/fix_shmem branch May 9, 2026 06:20
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.

2 participants