Skip to content

math_cfuns being a constant causes a sigsev on macos #73

@trescenzi

Description

@trescenzi

Working with jaylib for the first time and it seems like math_cfuns being a constant causes an immediate sigsev on macos.

Reproduction steps:

(on a m2 macbook air)

  • jpm install jaylib
  • janet
Janet 1.39.1-homebrew macos/aarch64/clang - '(doc)' for help
repl:1:> (import jaylib)
fish: Job 1, 'janet' terminated by signal SIGSEGV (Address boundary error)

I then cloned jaylib locally and used lldb to do some debugging. Didn't really find anything helpful since I was too lazy to rebuild janet with debug symbols. I found, by slowly reducing the janet_cfuns calls in main.c that by not including the math functions it would import without crashing. Commented out the whole contents of math_cfuns and it still crashed. I noticed the only major difference between the math functions and everything else was that math_cfuns was a constant. By removing the constant declaration it compiled, and imported successfully.

Not sure I know enough about C to understand why this might be happening but since it seemed consistently reproducible and the math bindings look relatively new I wanted to file an issue. Let me know if there's anything else I can include to help debug this.

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