Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node-ffi] TypeError: error setting argument 0 - valabind [StructType]#set got a bad value #22

Open
3demax opened this issue Mar 20, 2014 · 6 comments

Comments

@3demax
Copy link

3demax commented Mar 20, 2014

I've generated binding for tox, but

/home/user/node-tox-ffi/node_modules/ffi/lib/_foreign_function.js:55
      throw e
            ^
TypeError: error setting argument 0 - valabind [StructType]#set got a bad value
    at Function.set (/home/user/node-tox-ffi/tox_custom.js:65:10)
    at Object.set (/home/user/node-tox-ffi/node_modules/ref/lib/ref.js:479:10)
    at Object.alloc (/home/user/node-tox-ffi/node_modules/ref/lib/ref.js:513:13)
    at ForeignFunction.proxy (/home/user/node-tox-ffi/node_modules/ffi/lib/_foreign_function.js:50:22)
    at StructType.size (/home/user/node-tox-ffi/tox_custom.js:141:13)
    at Object.<anonymous> (/home/user/node-tox-ffi/tox_custom.js:338:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

I'm trying to understand this types system, and it's very complicated.
Can you please explain, what's wrong here?

@msmaromi
Copy link

I have the same issue. May someone explain this?

@radare
Copy link
Owner

radare commented Jul 2, 2014

Can you provide a simpler test case and (vapi+makefile) to reproduce the issue? I guess that's related to a wrongly defined vapi file. did you tested it with Vala?

@msmaromi
Copy link

msmaromi commented Jul 3, 2014

I've recheck my case and it turns out a different problem. Thankyou anyway

@futurepaycc
Copy link

futurepaycc commented Nov 7, 2020

same error

os: linux-x64
vala: 0.50
valabind: 1.7.2
nodejs: v10.22.1
github.com/antono/vala-object node example (updated node ffi ...)

@futurepaycc
Copy link

figured out:

nodeffiwriter.vala: 395,397

val.buffer -> val['ref.buffer']

@trufae
Copy link
Collaborator

trufae commented Nov 9, 2020

Awesome! Can you send a PR? Just pressing the pencil button in github allows you to edit the file and create the pr automatically.

I will setup the CI for further testimg too

Thanks!!

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

No branches or pull requests

5 participants