vercel-labs / vercel-labs/native

Example app from the documentation crashes on Linux when pressing the "Stamp" button

Open
#342 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Zig
Stars
7.7k
Forks
314
Avg merge
5h
Merged PRs (30d)
13

Description

The example app from the documentation at https://native-sdk.dev/docs/quick-start crashes on Linux when pressing the "Stamp" button

After compiling the app with "native build", run it with ./zig-out/bin/my-app and pressing the stamp button
you get a reproducible crash

s=1786634743454409533 level=info kind=event name="runtime.event" event="canvas_widget_pointer"
ts=1786634743454526151 level=info kind=event name="runtime.event" event="gpu_surface_input"
ts=1786634743674410437 level=info kind=event name="runtime.event" event="timer"
ts=1786634744174516755 level=info kind=event name="runtime.event" event="timer"
ts=1786634744320854556 level=info kind=event name="runtime.event" event="canvas_widget_pointer"
ts=1786634744320998149 level=info kind=event name="runtime.event" event="gpu_surface_input"
ts=1786634744329523694 level=info kind=event name="runtime.event" event="gpu_surface_frame"
ts=1786634744335039828 level=info kind=event name="runtime.event" event="gpu_surface_frame"
ts=1786634744435130674 level=info kind=event name="runtime.event" event="canvas_widget_pointer"
thread 3745 panic: Uncaught Error: an integer slot carries a non-integer or out-of-range value — the i64 encoding has no honest bytes for it
SC4013nsc_core_model_snapshotrebuild the app: an exception escaping a core entry is contract skew between the compiled core and its host bindings, and one build regenerates both from one contract.
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/debug/root.zig:121:27: 0x14baf4c in capturePanic (my-app)
std.debug.defaultPanic(msg, ra);
^
/run/media/pablo/SEGURO/pablo-seguro-minipc/prueba/prueba-native/my_app/.native/build/.zig-cache/o/e0fe0f3f463205701a1286dbd46428bb/shim_rt.zig:342:15: 0x14bc6ee in panicSink (my-app)
@panic(msg[0..msg_len]);
^
???:?:?: 0x14c7181 in ??? (???)
???:?:?: 0x14c6dd8 in ??? (???)
???:?:?: 0x14d7272 in ??? (???)
???:?:?: 0x14c6951 in ??? (???)
/run/media/pablo/SEGURO/pablo-seguro-minipc/prueba/prueba-native/my_app/.native/build/.zig-cache/o/e0fe0f3f463205701a1286dbd46428bb/core.zig:204:23: 0x13fa7d1 in snapshotModel (my-app)
abi.model_snapshot(&snap_ptr, &snap_len);
^
/run/media/pablo/SEGURO/pablo-seguro-minipc/prueba/prueba-native/my_app/.native/build/.zig-cache/o/e0fe0f3f463205701a1286dbd46428bb/core.zig:162:37: 0x13fc616 in update (my-app)
return .{ .model = snapshotModel(), .cmd = cmd_ptr[0..cmd_len] };
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/ts_core_host.zig:857:43: 0x13fbbab in dispatchDepth (my-app)
const result = core.update(model_root, msg);
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/ui_app.zig:1618:26: 0x13f8aef in applyMsg (my-app)
update_fx(&self.model, msg, &self.effects);
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/ui_app.zig:4005:70: 0x1350256 in handleRuntimeEvent (my-app)
.audio => |audio_event| if (self.effects.takeAudioMsg(audio_event)) |msg| {
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/ui_app.zig:3920:31: 0x13487f1 in eventFn (my-app)
handleRuntimeEvent(self, runtime, event_value) catch |err| {
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/api.zig:438:55: 0x13327bc in event (my-app)
if (self.event_fn) |event_fn| try event_fn(self.context, runtime, event_value);
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/gpu_surface_events.zig:684:39: 0x12cfdb6 in dispatchGpuSurfaceInput (my-app)
try self.dispatchEvent(app, .{ .canvas_widget_pointer = pointer_event });
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/flow.zig:417:101: 0x1241ffa in dispatchPlatformEvent (my-app)
.gpu_surface_input => |input_event| GpuSurfaceEventMethods().dispatchGpuSurfaceInput(self, app, input_event) catch |err| {
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/runtime/flow.zig:623:58: 0x133b53a in handlePlatformEvent (my-app)
try run_context.runtime.dispatchPlatformEvent(run_context.app, event_value);
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/platform/linux/root.zig:536:16: 0x133f29a in emit (my-app)
handler(context, event) catch {
^
../../../../../../../../home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/platform/linux/gtk_host.c:2214:25: 0x11891f5 in native_sdk_emit (../../../../../../../../home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/platform/linux/gtk_host.c)
if (host->callback) host->callback(host->callback_context, &event);
^
???:?:?: 0x7effbd08faa7 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbcdd3b79 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3cd8 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3d93 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbd150bb4 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbcdb5e62 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3b79 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3cd8 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3d93 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbd15376d in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd155efa in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd156cba in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd2e102a in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd19cc71 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd19d7c2 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd0948da in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd55a347 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbcdb1bcb in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd184a in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3293 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3cd8 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbcdd3d93 in ??? (/usr/lib/libgobject-2.0.so.0)
???:?:?: 0x7effbd560831 in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbd4b66fb in ??? (/usr/lib/libgtk-4.so.1)
???:?:?: 0x7effbcc9ec75 in ??? (/usr/lib/libglib-2.0.so.0)
???:?:?: 0x7effbcca0ed6 in ??? (/usr/lib/libglib-2.0.so.0)
???:?:?: 0x7effbcca1054 in ??? (/usr/lib/libglib-2.0.so.0)
???:?:?: 0x7effbcee6185 in ??? (/usr/lib/libgio-2.0.so.0)
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/platform/linux/root.zig:513:27: 0x133e550 in run (my-app)
native_sdk_gtk_run(self.host, gtkCallback, &self.state);
^
/home/pablo/.local/share/pnpm/store/v11/links/@native-sdk/cli/0.8.4/3fd569866a88f2713341b945bbad85ab0794459459dfb3720df000677242f1ca/node_modules/@native-sdk/cli/src/platform/types.zig:3370:27: 0x11905f4 in run (my-app)
return self.run_fn(self.context, handler, handler_context);
^
/run/media/pablo/SEGURO/pablo-seguro-minipc/prueba/prueba-native/my_app/.native/build/.zig-cache/o/e0fe0f3f463205701a1286dbd46428bb/main.zig:173:30: 0x119405d in main (my-app)
try runner.runWithOptions(app_state.app(), .{
^
???:?:?: 0x7effbc827780 in ??? (/usr/lib/libc.so.6)
???:?:?: 0x7effbc8278b8 in ??? (/usr/lib/libc.so.6)
???:?:?: 0x117caf4 in ??? (???)

Info about my system

uname -a
Linux minipc 6.18.43-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri, 07 Aug 2026 08:19:13 +0000 x86_64 GNU/Linux

native version
native 0.8.4 (commit a404ca1, automation protocol 0x096c8aa4730c11ec)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash from the documentation quick-start example with native build, ./zig-out/bin/my-app, and the Stamp button. Start at the generated core.zig snapshotModel entry point and trace through runtime/ts_core_host.zig and platform/linux/root.zig. Done means the Linux example no longer panics when Stamp is pressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
zig
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.