Skip to content

[Dylink] Remove a racy assertion#13060

Merged
kripken merged 1 commit into
masterfrom
dyrace
Dec 17, 2020
Merged

[Dylink] Remove a racy assertion#13060
kripken merged 1 commit into
masterfrom
dyrace

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Dec 16, 2020

If 2 side modules are loaded, A and B, and loadModule is called on A, then B,
then it is possible that if instantiation is done async here then the
postInstantiation() callbacks may happen in the reverse order, racily. If that
happens, the extra assertions on the table not changing can fire incorrectly -
the other parts of the table will appear to have changed meanwhile, but for
valid reasons.

Fixes #13054
Fixes #11458

@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented Dec 16, 2020

I guess we need to add some tests that load more than one side module?

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Dec 17, 2020

Looks like test_ld_library_path tests multiple ones, but not asynchronous loading. Yes, an area we need more coverage. May require some work on test_dylink though as it kind of assumes just one side module.

@kripken kripken merged commit 6484297 into master Dec 17, 2020
@kripken kripken deleted the dyrace branch December 17, 2020 00:17
kripken added a commit that referenced this pull request Dec 17, 2020
)

To test async loading, we have to test this on the web (in node, we'll use
sync loading for all files, even dynamic libraries, and not just dlopen).

This sort of tests #13060, but that's a race, so it may not have caught it.
Still, it gives us coverage we were missing before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants