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

[wasm] just fix the crypto logging #73468

Merged
merged 1 commit into from
Aug 6, 2022

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Aug 5, 2022

This only fixes wrong capture of originalConsole causing the crypto-worker to go to infinite loop when WS are not available.
This doesn't address the problem that forwarding logs to localhost WS in production is bad idea.

Contributes to #72941

@ghost
Copy link

ghost commented Aug 5, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

testing crypto on CI

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: -

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara changed the title [wasm] just fix the logging [wasm] just fix the crypto logging Aug 5, 2022
@pavelsavara pavelsavara added this to the 7.0.0 milestone Aug 5, 2022
@pavelsavara pavelsavara marked this pull request as ready for review August 5, 2022 17:52
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara requested a review from maraf August 5, 2022 18:35
@radical
Copy link
Member

radical commented Aug 6, 2022

wasm/AOT failure:

[21:59:52] info: Using random seed for collections: 1205411788
[21:59:52] info: Starting:    System.Collections.Tests.dll
[22:01:13] fail: 162349888
[22:01:13] fail: [out of order message from the browser]: http://127.0.0.1:49194/dotnet.js 1880:6 Uncaught
[22:01:13] info: WASM EXIT 1

Having an unhandled exception handler to log the trace, specifically for tests, would be very useful in debugging these random crashes.

@radical
Copy link
Member

radical commented Aug 6, 2022

Can you add a description of the problem, and the fix, in the PR description?

@pavelsavara
Copy link
Member Author

pavelsavara commented Aug 6, 2022

Can you add a description of the problem, and the fix, in the PR description?

In old code:
originalConsoleObj is a reference to console object instance.
the methods in it will be rewritten by subsequent call to console[m] = proxyConsoleMethod and therefore are not original, but the modified methods.

In the new code:

const originalConsole = {
        log: console.log,
        error: console.error
    };

creates new object instance with the copy of references to incoming methods and we will not write to that instance after.
So, we could use the original methods in the rest of the setup_proxy_console.

In my other PR I moved all this code to logging.ts and this PR was just speculative.
I will run one more round of CI tests and close it in favor of #73484 which has the same fix in logging.ts

@radical
Copy link
Member

radical commented Aug 6, 2022

And how did the bug show up in practice?
This earlier description and answer to the above can be added to the PR description so it will be in the commit message.

@pavelsavara
Copy link
Member Author

in practice this will run infinite loop and crash the browser as Simon described here #72941

@pavelsavara pavelsavara merged commit d9df7c4 into dotnet:main Aug 6, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 5, 2022
@pavelsavara pavelsavara deleted the wasm_sanity_check branch November 29, 2022 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants