Skip to content

Bizarre crash in JavaScript engine on macOS Monterey #4218

@KockaAdmiralac

Description

@KockaAdmiralac

Describe the bug

I had recently written a custom extension and tried to get two macOS users to run it. Both users are on macOS Monterey and for both of them Tiled unexpectedly crashed when they performed a specific action in my extension.

The crash narrows down to: a JavaScript function takes another function as an argument, runs it at least 4 times, and then Tiled crashes. The reported exception type is EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid)). This could have something to do with QtQml's JavaScript engine, or Tiled's packaging of it.

I'm attaching two crash logs, first is from performing my reproduction steps below on macOS 12.7.6, second is when loading my above extension and performing the File > Publish to wiki action on macOS 12.7.4 (the specific part that crashes is the Array.prototype.map call in includes/auth.mjs:generateCodeChallenge).

crash1.txt
crash2.txt

This cannot be reproduced on Windows or Linux.

Steps to reproduce

  1. Open Console
  2. Run ((c)=>{c();c();c();c()})(()=>{})
  3. Tiled crashes

Expected behavior

Expected behavior of the above function is to not do anything.

OS version

macOS 12.7.4 and 12.7.6

Tiled version

1.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBroken behavior.qt issueQt related issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions