Skip to content

vfunc chain-up (super.<vfunc>()) crashes on macOS in g_vfunc_info_invoke #453

Description

@romgrk

Follow-up to #451 (which adds super.<vfunc>() chain-up).

Symptom

tests/register-class__vfunc_chain_up.js crashes the test process on macOS (arm64, all of Node 20/22/24) with no JS output — mocha reports the test failed with an empty error, i.e. a native crash rather than an assertion failure. Ubuntu and Windows (Node 20/22/24) and local Linux all pass.

The crash is in the chain-up native call itself: CallVFuncg_vfunc_info_invoke(vfuncInfo, parentGType, ...). It is not the construction-timing case — the test was changed to chain up post-construction (from a regular method, with a live instance) and it still crashes on macOS only.

Notes

  • g_vfunc_info_invoke is not used anywhere else in node-gtk, so there's no existing macOS coverage of this girepository-1.0 entry point.
  • macOS CI installs gobject-introspection 1.86.0 via Homebrew (the new girepository era); a behavior/ABI difference in g_vfunc_info_invoke there is a prime suspect.
  • The instance is valid (non-null) at the call site by this point, and the same code path works on Linux/Windows, so the marshalling of in_args[0] (the instance) and the void return appears correct on those platforms.

Workaround in #451

The test is skipped on process.platform === 'darwin' so CI stays green; the feature ships working on Linux and Windows. This issue tracks getting chain-up working (and the test un-skipped) on macOS.

To investigate

  • Reproduce on a macOS box / a tmate CI debug session with lldb to get the crashing frame inside g_vfunc_info_invoke.
  • Compare against resolving the parent impl with g_vfunc_info_get_address(vfuncInfo, parentGType) + a hand-rolled ffi_call (node-gtk already has the cif/ffi machinery in src/function.cc) — this may behave differently on macOS than g_vfunc_info_invoke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions