rust-lang / rust-lang/rust-bindgen

Debugging possible crash for bindgen-generated bindings?

Open
#1,383 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

I-unclear
Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

Hi,

I'm trying to build a rust wrapper for the V8 JavaScript engine. When attempting to replicate the hello world example from Rust, I get an access violation every time I attempt to create a context, which does not occur when I use it from C++. Hence, I'm either doing something wrong, or there is a problem in the generated bindings.

I've combed through my code and they replicate the c++ calls as far as I can tell, except that I have to provide more params that are left out in c++ as they have default values. The layouts of the structs are also right as far as I can tell.

Is there anything else that I might be overlooking?

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

Start by reproducing the V8 hello world example from the linked C++ sample through the Rust wrapper, focusing on the context-creation call and the bindgen-generated bindings. Compare the Rust arguments and struct layouts with the C++ calls, then document whether the crash comes from wrapper usage or generated bindings and provide a minimal reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.