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][AOT] Profiled AOT compilation fails with Segmentation fault #70773

Closed
jeromelaban opened this issue Jun 15, 2022 · 4 comments · Fixed by #70926
Closed

[Wasm][AOT] Profiled AOT compilation fails with Segmentation fault #70773

jeromelaban opened this issue Jun 15, 2022 · 4 comments · Fixed by #70926
Assignees
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono
Milestone

Comments

@jeromelaban
Copy link
Contributor

jeromelaban commented Jun 15, 2022

Description

Unknown crash with AOT compiling the attached repro.

Reproduction Steps

Under Linux, using the following archive: 70773-workAot.zip
Run with the following parameters:

cd workAot
MONO_PATH=./aot-in:./linker-out dotnet-runtime-wasm-linux-33813c4-59b2dd9fa37-2492148814-Release/runtimes/browser-wasm/native/cross/browser-wasm/mono-aot-cross --debug   --wasm-exceptions  --aot=,llvmonly,asmonly,no-opt,static,direct-icalls,deterministic,nodebug,llvm-path="~/.uno/emsdk/emsdk-3.1.7/emsdk/upstream/bin",profile="./aot.profile",profile-only,interp,,depfile=./linker-out/Syncfusion.SfChart.Uno.dll.depfile,llvm-outfile=./Syncfusion.SfChart.Uno.dll.bc.tmp ./linker-out/Syncfusion.SfChart.Uno.dll

Expected behavior

No crash

Actual behavior

Mono Ahead of Time compiler - compiling assembly workAot/linker-out/Syncfusion.SfChart.Uno.dll
Using profile data file './aot.profile'
Segmentation fault (core dumped)

Regression?

yes

Known Workarounds

None

Configuration

495d08f

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 15, 2022
@lewing
Copy link
Member

lewing commented Jun 15, 2022

cc @steveisok

@lewing lewing added the arch-wasm WebAssembly architecture label Jun 15, 2022
@ghost
Copy link

ghost commented Jun 15, 2022

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

Issue Details

Description

Unknown crash with AOT compiling the attached repro.

Reproduction Steps

Under Linux, using the following archive: 70773-workAot.zip
Run with the following parameters:

cd workAot
MONO_PATH=./aot-in:./linker-out dotnet-runtime-wasm-linux-33813c4-59b2dd9fa37-2492148814-Release/runtimes/browser-wasm/native/cross/browser-wasm/mono-aot-cross --debug   --wasm-exceptions  --aot=,llvmonly,asmonly,no-opt,static,direct-icalls,deterministic,nodebug,llvm-path="~/.uno/emsdk/emsdk-3.1.7/emsdk/upstream/bin",profile="./aot.profile",profile-only,interp,,depfile=./linker-out/Syncfusion.SfChart.Uno.dll.depfile,llvm-outfile=./Syncfusion.SfChart.Uno.dll.bc.tmp ./linker-out/Syncfusion.SfChart.Uno.dll

Expected behavior

No crash

Actual behavior

Mono Ahead of Time compiler - compiling assembly workAot/linker-out/Syncfusion.SfChart.Uno.dll
Using profile data file './aot.profile'
Segmentation fault (core dumped)

Regression?

yes

Known Workarounds

None

Configuration

495d08f

Other information

No response

Author: jeromelaban
Assignees: -
Labels:

arch-wasm, untriaged, area-Codegen-AOT-mono

Milestone: -

@lewing lewing added this to the 7.0.0 milestone Jun 15, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jun 15, 2022
@vargaz vargaz self-assigned this Jun 15, 2022
@jeromelaban
Copy link
Contributor Author

@vargaz It may not be super useful, but here one part of the stack:

Thread 1 "mono-aot-cross" received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
65      ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#1  0x00007fffff258d15 in __vfprintf_internal (s=s@entry=0x7ffffffed530, format=format@entry=0x88170dd "%s_%s", ap=ap@entry=0x7ffffffed680, mode_flags=mode_flags@entry=2) at vfprintf-internal.c:1688
#2  0x00007fffff26bbca in __vasprintf_internal (result_ptr=0x7ffffffed678, format=0x88170dd "%s_%s", args=0x7ffffffed680, mode_flags=mode_flags@entry=2) at vasprintf.c:57
#3  0x00007fffff30f6ec in __vasprintf_chk (result_ptr=<optimized out>, flag=flag@entry=1, format=<optimized out>, ap=<optimized out>) at vasprintf_chk.c:36
#4  0x00000000080dca21 in vasprintf (__ap=<optimized out>, __fmt=<optimized out>, __ptr=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:210
#5  monoeg_g_vasprintf (ret=<optimized out>, fmt=<optimized out>, ap=<optimized out>) at /__w/Uno.DotnetRuntime.WebAssembly/Uno.DotnetRuntime.WebAssembly/runtime/src/mono/mono/eglib/gstr.c:68
#6  0x000000000b0c6c10 in ?? ()
#7  0x00007ffffffed788 in ?? ()
#8  0x0000003000000010 in ?? ()
#9  0x00007ffffffed760 in ?? ()
#10 0x00007ffffffed6a0 in ?? ()
#11 0x421dab0f3b799a00 in ?? ()
#12 0x0000005b0000006e in ?? ()
#13 0x0000048000010093 in ?? ()
#14 0x000000000b0c6c30 in ?? ()
#15 0x0000000000000065 in ?? ()
#16 0x0000000000000000 in ?? ()

@jeromelaban
Copy link
Contributor Author

@vargaz

Starting program: /mnt/c/temp/mono-aot-cross --debug --wasm-exceptions --aot=,llvmonly,asmonly,no-opt,static,direct-icalls,deterministic,nodebug,llvm-path=\~/.uno/emsdk/emsdk-3.1.7/emsdk/upstream/bin,profile=./aot.profile,profile-only,interp,,depfile=./linker-out/Syncfusion.SfChart.Uno.dll.depfile,llvm-outfile=./Syncfusion.SfChart.Uno.dll.bc.tmp ./linker-out/Syncfusion.SfChart.Uno.dll
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffffe7f0700 (LWP 1426)]
Mono Ahead of Time compiler - compiling assembly /mnt/c/s/uno.clients/Kahua/20220615-aot-crash-workaot/workAot/linker-out/Syncfusion.SfChart.Uno.dll
Using profile data file './aot.profile'

Thread 1 "mono-aot-cross" received signal SIGSEGV, Segmentation fault.
0x000000000810cd3b in collect_aggregate_modifiers_images (amods=0x802000001, data=0x7ffffffed4b0) at /home/jay/runtime/src/mono/mono/metadata/metadata.c:3093
3093    /home/jay/runtime/src/mono/mono/metadata/metadata.c: No such file or directory.
(gdb) bt
#0  0x000000000810cd3b in collect_aggregate_modifiers_images (amods=0x802000001, data=0x7ffffffed4b0) at /home/jay/runtime/src/mono/mono/metadata/metadata.c:3093
#1  0x000000000810cdaf in collect_type_images (type=0x916d298, data=0x7ffffffed4b0) at /home/jay/runtime/src/mono/mono/metadata/metadata.c:3102
#2  0x000000000810d663 in mono_metadata_get_mem_manager_for_type (type=0x916d298) at /home/jay/runtime/src/mono/mono/metadata/metadata.c:3312
#3  0x00000000082bfb96 in mini_get_shared_gparam (t=0x916d298, constraint=0x916c978) at /home/jay/runtime/src/mono/mono/mini/mini-generic-sharing.c:4109
#4  0x00000000082c01f4 in get_shared_type (t=0x916d298, type=0xac823c0) at /home/jay/runtime/src/mono/mono/mini/mini-generic-sharing.c:4207
#5  0x00000000082c02f6 in get_shared_inst (inst=0xac7cd70, shared_inst=0xa4b9780, container=0xa4be2a8, use_gsharedvt=0) at /home/jay/runtime/src/mono/mono/mini/mini-generic-sharing.c:4231
#6  0x00000000082c0740 in mini_get_shared_method_full (method=0xac82590, flags=SHARE_MODE_NONE, error=0x7ffffffed9a0) at /home/jay/runtime/src/mono/mono/mini/mini-generic-sharing.c:4345
#7  0x00000000082769aa in add_extra_method_with_depth (acfg=0x917d270, method=0xac82590, depth=0) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:4314
#8  0x0000000008276bd0 in add_extra_method (acfg=0x917d270, method=0xac82590) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:4346
#9  0x0000000008290f1f in add_profile_method (acfg=0x917d270, m=0xac82590) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:13137
#10 0x0000000008291073 in add_single_profile_method (acfg=0x917d270, method=0xac82590) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:13183
#11 0x0000000008291190 in add_profile_instances (acfg=0x917d270, data=0x918b0f0) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:13218
#12 0x0000000008294129 in mono_compile_assembly (ass=0x917d010, opts=374417919,
    aot_options=0x911e7d0 ",llvmonly,asmonly,no-opt,static,direct-icalls,deterministic,nodebug,llvm-path=~/.uno/emsdk/emsdk-3.1.7/emsdk/upstream/bin,profile=./aot.profile,profile-only,interp,,depfile=./linker-out/Syncfusion.SfC"..., global_aot_state=0x7ffffffedc08) at /home/jay/runtime/src/mono/mono/mini/aot-compiler.c:14362
#13 0x0000000008266ef8 in main_thread_handler (user_data=0x7ffffffedde0) at /home/jay/runtime/src/mono/mono/mini/driver.c:1419
#14 0x000000000826e122 in mono_main (argc=4, argv=0x7ffffffedfa8) at /home/jay/runtime/src/mono/mono/mini/driver.c:2651
#15 0x00000000080809ad in mono_main_with_options (argc=5, argv=0x7ffffffedfa8) at /home/jay/runtime/src/mono/mono/mini/main.c:36
#16 0x00000000080809cf in main (argc=5, argv=0x7ffffffedfa8) at /home/jay/runtime/src/mono/mono/mini/main.c:88
(gdb)

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 18, 2022
vargaz added a commit to vargaz/runtime that referenced this issue Jun 18, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 5, 2022
vargaz added a commit that referenced this issue Jul 5, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants