Skip to content

qjs/std should report async failures via exit code #340

Closed

Description

@bnoordhuis

Example: assert triggered from timer callback should exit with a non-zero error but doesn't. quickjs-libc.c calls js_std_dump_error() and trucks on.

$ build/qjs tests/test_std.js
Error: assertion failed: got |false|, expected |true|
    at assert (tests/test_std.js:21:51)
    at d (tests/test_std.js:287:33)

$ echo $?
0

Originally posted by @saghul in #338 (comment)

Activity

  1. added
    bug
    on Apr 2, 2024
  2. saghul commented on Apr 6, 2024

    @saghul
    Contributor

    While I see that there is currently no way to report the exceptions, what's annoying is I cannot reproduce the original issue, at least on macOS. It seems to repro all the time in the CI though. Any chance it's related to the timer source not being accurate enough since it's a virtualized environment?

  3. bnoordhuis commented on Apr 7, 2024

    @bnoordhuis
    ContributorAuthor

    quickjs only needs millisecond resolution. It seems sorta unlikely if perhaps not completely impossible that the timer source is too coarse.

    Let me add some printf^Wconsole.log statements to see in what order the timeouts actually run.

  4. chqrlie commented on Apr 7, 2024

    @chqrlie
    Collaborator

    quickjs only needs millisecond resolution. It seems sorta unlikely if perhaps not completely impossible that the timer source is too coarse.

    ECMA only specifies millisecond resolution, but precise timings benefit from a finer resolution, at least microsecond if not nanosecond, so we should preserve a simple way to retrieve a precision clock. This however seems unrelated to the current issue.

  5. added a commit that references this issue on Sep 10, 2024
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions