Skip to content

__builtin_setjmp/__builtin_longjmp crashes when mrb_load_exec #5950

Closed

Description

@LanzaSchneider
Target platform: Windows 10 (21H2)
Toolchain: llvm-mingw-20230130-ucrt-x86_64

When I execute mrb_load_exec and it throws an exception, it crashes.
I noticed that the information here says that we should use the standard C library functions declared in <setjmp.h> in user code instead of the builtins.

So I tried editing the <throw.h>:

#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define MRB_SETJMP _setjmp
#define MRB_LONGJMP _longjmp
// #elif defined(__MINGW64__) && defined(__GNUC__) && __GNUC__ >= 4
// #define MRB_SETJMP __builtin_setjmp
// #define MRB_LONGJMP __builtin_longjmp
#else
#define MRB_SETJMP setjmp
#define MRB_LONGJMP longjmp
#endif

This time there was no crash. I hope this message is helpful~

Activity

  1. added a commit that references this issue on Mar 14, 2023
    4fc69ce
  2. dearblue commented on Jan 7, 2024

    @dearblue
    Contributor

    It was fixed once, but then later reverted.
    4fc69ce
    Is it ok if this issue is not reopened?

  3. matz commented on Jan 7, 2024

    @matz
    Member

    This change made mrbtest to fail often. It was unacceptable for us.
    If @LanzaSchneider reopens the issue, it's OK. But without further information, we can do little.

  4. added a commit that references this issue on Feb 7, 2024
    9cf49d0
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