Skip to content

Segfault on LoadModelAnimations #164

Open

Description

@konsumer

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.

Activity

  1. konsumer commented on Nov 24, 2022

    @konsumer
    CollaboratorAuthor

    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

  2. konsumer commented on Nov 24, 2022

    @konsumer
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions