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

Segfault on LoadModelAnimations #164

Open
konsumer opened this issue Nov 24, 2022 · 2 comments
Open

Segfault on LoadModelAnimations #164

konsumer opened this issue Nov 24, 2022 · 2 comments

Comments

@konsumer
Copy link
Collaborator

konsumer commented Nov 24, 2022

jardeltorres reported on raylib discord, so I followed up.

The code works fine if the animation is commented out, but segfaults if not. Additionally, I get TypeError: r.SetMaterialTexture is not a function

I forked their repro here

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
    frame #0: 0x0000000104ddcd61 node-raylib.node`LoadModelAnimations + 177
node-raylib.node`LoadModelAnimations:
->  0x104ddcd61 <+177>: movl   %eax, (%r15)
    0x104ddcd64 <+180>: movl   0x54(%r13), %eax
    0x104ddcd68 <+184>: shlq   $0x2, %rax
    0x104ddcd6c <+188>: leaq   (%rax,%rax,4), %rdi
Target 0: (node) stopped.
@konsumer
Copy link
Collaborator Author

konsumer commented Nov 24, 2022

I also tested C raylib 4.2 with this (with the animation stuff uncommented) and it worked ok (hold space to animate.)

Screen.Recording.2022-11-24.at.1.30.20.AM.mov

I compiled with

gcc $(pkg-config --cflags --libs raylib) main.c -o tester

c_test.zip

@konsumer
Copy link
Collaborator Author

konsumer commented Nov 24, 2022

I think it might be passing a value when it expects a pointer, but I'm not totally sure. (address=0x1 in error, and I happen to be setting the animation-count to 1, in a param that is a pointer, not a value. If I set it to 66 I get that address: 0x42.)

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

1 participant