Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIAFE broken for single files? #56320

Open
Jean-Luc-Picard-2021 opened this issue Dec 19, 2024 · 0 comments
Open

IIAFE broken for single files? #56320

Jean-Luc-Picard-2021 opened this issue Dec 19, 2024 · 0 comments

Comments

@Jean-Luc-Picard-2021
Copy link

Jean-Luc-Picard-2021 commented Dec 19, 2024

Version

v23.4.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

Possibly related to changes made here:
#42868

What steps will reproduce the bug?

Running Dogelog Player with node v22.12.0 works fine:

?- ensure_loaded(library(compat)).
true.

Running Dogelog Player with node v23.4.0 gives an abend:

?- ensure_loaded(library(compat)).
Warning: Detected unsettled top-level await at 
file:///C:/Projects/Novacore/Prototyping/dogelog/player/canned/dogelog.mjs:1

The offending IIAFE is:

(async () => { await dogelog_async() })();

How often does it reproduce? Is there a required condition?

The call dogelog_async() will in turn create some promises,
and await them. If I have the code in two files, everything
works fine:

?- await enter [object Promise]
ensure_loaded(library(compat)).
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
true.

If I have the code in one file, one of the awaits is entered,
but not exited instead a Warning is shown and the
process aborts with code 13.

?- await enter [object Promise]
ensure_loaded(library(compat)).
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
await exit [object Promise]
await enter [object Promise]
Warning: Detected unsettled top-level await at 
file:///C:/Projects/Dogelog/Prototyping/dogelog/player/canned/dogelog.mjs:1

What is the expected behavior? Why is that the expected behavior?

Even if the code is only one file, the awaits should all
be entered and exited without a warning.

What do you see instead?

Currently the error based on the given test case, is always
reproduceable. I always see the process exit code 13.

Additional information

I wish I could exactly identify the changes between
version 22.x and version 23.x of node.js that did break IIAFE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant