Skip to content

Commit

Permalink
minor stuff (#100933)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara authored Apr 11, 2024
1 parent 2b9b588 commit 74639e2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ await executor.Execute(async () =>


[Theory, MemberData(nameof(GetTargetThreads2x))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/100931")]
public async Task WebSocketClient_ResponseCloseInDifferentThread(Executor executor1, Executor executor2)
{
using var cts = CreateTestCaseTimeoutSource();
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@
<!-- Issue: https://github.com/dotnet/runtime/issues/95795 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Tests\Hybrid\System.Globalization.Hybrid.WASM.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Globalization.Calendars.Tests\Hybrid\System.Globalization.Calendars.Hybrid.WASM.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/100932 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Reflection.Tests\System.Reflection.Tests.csproj" />
</ItemGroup>

<!-- Aggressive Trimming related failures -->
Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/runtime/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export function instantiate_asset (asset: AssetEntry, url: string, bytes: Uint8A
// FIXME
const lastSlash = virtualName.lastIndexOf("/");
let parentDirectory = (lastSlash > 0)
? virtualName.substr(0, lastSlash)
? virtualName.substring(0, lastSlash)
: null;
let fileName = (lastSlash > 0)
? virtualName.substr(lastSlash + 1)
? virtualName.substring(lastSlash + 1)
: virtualName;
if (fileName.startsWith("/"))
fileName = fileName.substr(1);
fileName = fileName.substring(1);
if (parentDirectory) {
mono_log_debug(`Creating directory '${parentDirectory}'`);

Expand Down
6 changes: 3 additions & 3 deletions src/mono/browser/runtime/loader/exit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function mono_exit (exit_code: number, reason?: any): void {
}
}
} catch (err) {
mono_log_warn("mono_exit failed", err);
mono_log_warn("mono_exit A failed", err);
// don't propagate any failures
}

Expand All @@ -132,7 +132,7 @@ export function mono_exit (exit_code: number, reason?: any): void {
appendElementOnExit(exit_code);
}
} catch (err) {
mono_log_warn("mono_exit failed", err);
mono_log_warn("mono_exit B failed", err);
// don't propagate any failures
}

Expand Down Expand Up @@ -177,7 +177,7 @@ function set_exit_code_and_quit_now (exit_code: number, reason?: any): void {
runtimeHelpers.nativeExit(exit_code);
} catch (error: any) {
if (runtimeHelpers.ExitStatus && !(error instanceof runtimeHelpers.ExitStatus)) {
mono_log_warn("mono_wasm_exit failed: " + error.toString());
mono_log_warn("set_exit_code_and_quit_now failed: " + error.toString());
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions src/mono/browser/runtime/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ export const wasm_func_map = new Map<number, string>();
let wasm_pending_symbol_table: string | undefined;
const regexes: any[] = [];

// V8
// at <anonymous>:wasm-function[1900]:0x83f63
// at dlfree (<anonymous>:wasm-function[18739]:0x2328ef)
regexes.push(/at (?<replaceSection>[^:()]+:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/);

//# 5: WASM [009712b2], function #111 (''), pc=0x7c16595c973 (+0x53), pos=38740 (+11)
regexes.push(/(?:WASM \[[\da-zA-Z]+\], (?<replaceSection>function #(?<funcNum>[\d]+) \(''\)))/);

//# chrome
//# at http://127.0.0.1:63817/dotnet.wasm:wasm-function[8963]:0x1e23f4
regexes.push(/(?<replaceSection>[a-z]+:\/\/[^ )]*:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)/);

//# <?>.wasm-function[8962]
regexes.push(/(?<replaceSection><[^ >]+>[.:]wasm-function\[(?<funcNum>[0-9]+)\])/);

export function mono_wasm_symbolicate_string (message: string): string {
try {
performDeferredSymbolMapParsing();
Expand Down Expand Up @@ -186,6 +171,21 @@ function performDeferredSymbolMapParsing () {
if (!wasm_pending_symbol_table)
return;

// V8
// at <anonymous>:wasm-function[1900]:0x83f63
// at dlfree (<anonymous>:wasm-function[18739]:0x2328ef)
regexes.push(/at (?<replaceSection>[^:()]+:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/);

//# 5: WASM [009712b2], function #111 (''), pc=0x7c16595c973 (+0x53), pos=38740 (+11)
regexes.push(/(?:WASM \[[\da-zA-Z]+\], (?<replaceSection>function #(?<funcNum>[\d]+) \(''\)))/);

//# chrome
//# at http://127.0.0.1:63817/dotnet.wasm:wasm-function[8963]:0x1e23f4
regexes.push(/(?<replaceSection>[a-z]+:\/\/[^ )]*:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)/);

//# <?>.wasm-function[8962]
regexes.push(/(?<replaceSection><[^ >]+>[.:]wasm-function\[(?<funcNum>[0-9]+)\])/);

const text = wasm_pending_symbol_table!;
wasm_pending_symbol_table = undefined;
try {
Expand Down
8 changes: 8 additions & 0 deletions src/mono/browser/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ static void *sysglobal_native_handle;
static void*
wasm_dl_load (const char *name, int flags, char **err, void *user_data)
{
#if WASM_SUPPORTS_DLOPEN
if (!name)
return dlopen(NULL, flags);
#else
if (!name)
return NULL;
#endif

void* handle = wasm_dl_lookup_pinvoke_table (name);
if (handle)
return handle;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/browser/test-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (!ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WEB && typeof globalThis.crypto ===
}

if (ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER) {
console.log("Running '" + globalThis.navigator.userAgent + "' at: " + globalThis.location.href);
console.log("Running '" + globalThis.navigator.userAgent + "' at: \n" + globalThis.location.href + "\n");
}

let v8args;
Expand Down

0 comments on commit 74639e2

Please sign in to comment.