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

Test failure Loader/classloader/explicitlayout/NestedStructs/case05/case05.sh #62311

Closed
VincentBu opened this issue Dec 3, 2021 · 7 comments
Closed
Assignees
Labels
arch-x64 area-VM-meta-mono disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro)
Milestone

Comments

@VincentBu
Copy link
Contributor

VincentBu commented Dec 3, 2021

Edit there are two separate issues here all on the Linux x64 LLVM AOT lane:

  1. The new tests from [Mono] Fix support for nested structs with explicit layout #61467
Loader/classloader/explicitlayout/NestedStructs/case05/case05.sh
Loader/classloader/explicitlayout/NestedStructs/case04/case04.sh
Loader/classloader/explicitlayout/NestedStructs/case03/case03.sh
Loader/classloader/explicitlayout/NestedStructs/case01/case01.sh
  1. The new test from [mono] Fix StackTrace from a dim and Vtable offsets for static interface method #60770
Loader/classloader/DefaultInterfaceMethods/regressions/github60486/github60486.sh

Run: runtime 20211202.64

Failed test:

Mono Linux x64 Release @ Ubuntu.1804.Amd64.Open
Loader/classloader/explicitlayout/NestedStructs/case05/case05.sh
Loader/classloader/DefaultInterfaceMethods/regressions/github60486/github60486.sh
Loader/classloader/explicitlayout/NestedStructs/case04/case04.sh
Loader/classloader/explicitlayout/NestedStructs/case03/case03.sh
Loader/classloader/explicitlayout/NestedStructs/case01/case01.sh

Mono Linux x64 Release no_tiered_compilation @ Ubuntu.1804.Amd64.Open
- Loader/classloader/explicitlayout/NestedStructs/case05/case05.sh
- Loader/classloader/DefaultInterfaceMethods/regressions/github60486/github60486.sh
- Loader/classloader/explicitlayout/NestedStructs/case04/case04.sh
- Loader/classloader/explicitlayout/NestedStructs/case03/case03.sh
- Loader/classloader/explicitlayout/NestedStructs/case01/case01.sh

Error message:

=================================================================
External Debugger Dump:
[New LWP 14932]
[New LWP 14934]
[New LWP 14936]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f597c62232a in __waitpid (pid=14937, stat_loc=0x7ffc46cd52c0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
Id   Target Id         Frame

1    Thread 0x7f597cc49740 (LWP 14930) "corerun" 0x00007f597c62232a in __waitpid (pid=14937, stat_loc=0x7ffc46cd52c0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2    Thread 0x7f5978bff700 (LWP 14932) "SGen worker" 0x00007f597c61dad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f597b8a9698 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
3    Thread 0x7f5976ff7700 (LWP 14934) "corerun" 0x00007f597b9f4cb9 in __GI___poll (fds=0x7f5970002d40, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
4    Thread 0x7f5976df6700 (LWP 14936) "Finalizer" 0x00007f597c6207c6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7f597b89a520 <finalizer_sem>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
Thread 4 (Thread 0x7f5976df6700 (LWP 14936)):

0  0x00007f597c6207c6 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7f597b89a520 <finalizer_sem>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
1  do_futex_wait (sem=sem@entry=0x7f597b89a520 <finalizer_sem>, abstime=0x0) at sem_waitcommon.c:111
2  0x00007f597c6208b8 in __new_sem_wait_slow (sem=0x7f597b89a520 <finalizer_sem>, abstime=0x0) at sem_waitcommon.c:181
3  0x00007f597a0cd166 in mono_os_sem_wait (sem=<optimized out>, flags=MONO_SEM_FLAGS_ALERTABLE) at /__w/1/s/src/mono/mono/mini/../utils/mono-os-semaphore.h:204
4  mono_coop_sem_wait (sem=<optimized out>, flags=MONO_SEM_FLAGS_ALERTABLE) at /__w/1/s/src/mono/mono/mini/../../mono/utils/mono-coop-semaphore.h:41
5  finalizer_thread (unused=<optimized out>) at /__w/1/s/src/mono/mono/metadata/gc.c:873
6  0x00007f597a0a5aaa in start_wrapper_internal (start_info=0x0, stack_ptr=<optimized out>) at /__w/1/s/src/mono/mono/metadata/threads.c:1200
7  0x00007f597a0a5939 in start_wrapper (data=0x558b1640c480) at /__w/1/s/src/mono/mono/metadata/threads.c:1262
8  0x00007f597c6176db in start_thread (arg=0x7f5976df6700) at pthread_create.c:463
9  0x00007f597ba0171f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 3 (Thread 0x7f5976ff7700 (LWP 14934)):

0  0x00007f597b9f4cb9 in __GI___poll (fds=0x7f5970002d40, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
1  0x00007f597a32faca in ipc_poll_fds (fds=<optimized out>, nfds=1, timeout=4294967295) at /__w/1/s/src/native/eventpipe/ds-ipc-pal-socket.c:470
2  ds_ipc_poll (poll_handles_data=0x7f5970002530, poll_handles_data_len=1, timeout_ms=4294967295, callback=0x7f597a32efc0 <server_warning_callback>) at /__w/1/s/src/native/eventpipe/ds-ipc-pal-socket.c:1082
3  0x00007f597a32d115 in ds_ipc_stream_factory_get_next_available_stream (callback=0x7f597a32efc0 <server_warning_callback>) at /__w/1/s/src/native/eventpipe/ds-ipc.c:395
4  0x00007f597a32b979 in server_thread (data=<optimized out>) at /__w/1/s/src/native/eventpipe/ds-server.c:127
5  0x00007f597a32efa1 in ep_rt_thread_mono_start_func (data=0x558b164c7e20) at /__w/1/s/src/mono/mono/mini/../eventpipe/ep-rt-mono.h:1271
6  0x00007f597c6176db in start_thread (arg=0x7f5976ff7700) at pthread_create.c:463
7  0x00007f597ba0171f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 2 (Thread 0x7f5978bff700 (LWP 14932)):

0  0x00007f597c61dad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f597b8a9698 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
1  __pthread_cond_wait_common

Stack trace
   at Loader_classloader._explicitlayout_NestedStructs_case05_case05_._explicitlayout_NestedStructs_case05_case05_sh()

Failed test:

Mono Browser wasm Release @ Ubuntu.1804.Amd64.Open

- Loader/classloader/explicitlayout/NestedStructs/case04/case04.sh

Error message:

Return code:      1
Raw output file:      /datadisks/disk1/work/A3F40905/w/ABAB093F/uploads/Reports/Loader.classloader/explicitlayout/NestedStructs/case04/case04.output.txt
Raw output:
BEGIN EXECUTION
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

AppDir: /datadisks/disk1/work/A3F40905/w/ABAB093F/e/Loader/classloader/explicitlayout/NestedStructs/case04/WasmApp/
TestBinDir: /datadisks/disk1/work/A3F40905/w/ABAB093F/e/Loader/classloader/explicitlayout/NestedStructs/case04
ArtifactsBinDir:
/datadisks/disk1/work/A3F40905/p/build/WasmApp.targets(210,5): warning : Could not find $(AssemblyName)=WasmTestRunner.dll in the assemblies to be bundled. [/datadisks/disk1/work/A3F40905/p/wasm-test-runner/WasmTestRunner.proj]
Incoming arguments: --run case04.dll
Application arguments: --run case04.dll
console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
console.info: Initializing.....
FAIL: object and non-object field overlap was not detected
Expected: 100
Actual: 101
END EXECUTION - FAILED
Test Harness Exitcode is : 1
To run the test:

set CORE_ROOT=/datadisks/disk1/work/A3F40905/p
/datadisks/disk1/work/A3F40905/w/ABAB093F/e/Loader/classloader/explicitlayout/NestedStructs/case04/case04.sh
Expected: True
Actual:   False


Stack trace
   at Loader_classloader._explicitlayout_NestedStructs_case04_case04_._explicitlayout_NestedStructs_case04_case04_sh()
@VincentBu VincentBu added os-linux Linux OS (any supported distro) arch-x64 labels Dec 3, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Dec 3, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@lambdageek
Copy link
Member

lambdageek commented Dec 3, 2021

https://helix.dot.net/api/2019-06-17/jobs/b87e187d-fda5-4804-8d32-7d3181784498/workitems/Loader.classloader/console

* Assertion at /__w/1/s/src/mono/mono/metadata/class-init.c:1906, condition `m_class_is_fields_inited (embedded_class)' not met

It's the LLVM AOT lane. which makes sense - we may have only loaded some AOT image info about the nested class, not necessarilly fully initialized it.

/cc @simonrozsival

@lambdageek
Copy link
Member

@vargaz @thaystg the new test from #60770 is failing on the AOT lane - looks like context->method_inst is non-NULL but garbage:

https://helix.dot.net/api/2019-06-17/jobs/37967d43-ee2b-411f-aa01-5e4f6f0fab43/workitems/Loader.classloader/console

Look at collect_ginst_images in frame 6

      Thread 1 (Thread 0x7f5b14887740 (LWP 15280)):
      #0  0x00007f5b1426032a in __waitpid (pid=15312, stat_loc=0x7fff9c8a4840, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
      #1  0x00007f5b11ea4917 in dump_native_stacktrace (signal=<optimized out>, mctx=<optimized out>) at /__w/1/s/src/mono/mono/mini/mini-posix.c:842
      #2  mono_dump_native_crash_info (signal=<optimized out>, mctx=0x7fff9c8a53b0, info=<optimized out>) at /__w/1/s/src/mono/mono/mini/mini-posix.c:869
      #3  0x00007f5b11e46a1e in mono_handle_native_crash (signal=0x7f5b116e9be9 "SIGSEGV", mctx=0x7fff9c8a53b0, info=0x7fff9c8a5670) at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:2947
      #4  0x00007f5b11da6741 in mono_sigsegv_signal_handler_debug (_dummy=11, _info=0x7fff9c8a5670, context=0x7fff9c8a5540, debug_fault_addr=0x17) at /__w/1/s/src/mono/mono/mini/mini-runtime.c:3709
      #5  <signal handler called>
      #6  collect_ginst_images (ginst=0x13, data=0x7fff9c8a5af8) at /__w/1/s/src/mono/mono/metadata/metadata.c:3031
      #7  collect_method_images (method=0x55dba8cdb080, data=0x7fff9c8a5af8) at /__w/1/s/src/mono/mono/metadata/metadata.c:3074
      #8  mono_metadata_get_mem_manager_for_method (method=0x55dba8cdb080) at /__w/1/s/src/mono/mono/metadata/metadata.c:3324
      #9  0x00007f5b11c6a4ff in mono_class_inflate_generic_method_full_checked (method=0x55dba84312c0, klass_hint=<optimized out>, context=0x7fff9c8a5da8, error=0x7fff9c8a5db8) at /__w/1/s/src/mono/mono/metadata/class.c:1210
      #10 0x00007f5b11e43871 in get_method_from_stack_frame (ji=0x55dba8ceac00, generic_info=0x55dba8407e28) at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:899
      #11 0x00007f5b11e44323 in ves_icall_get_frame_info (skip=-1, need_file_info=1 '\001', method=0x7fff9c8a6370, iloffset=0x7fff9c8a6360, native_offset=0x7fff9c8a6364, file=0x7fff9c8a6378, line=0x7fff9c8a6368, column=0x7fff9c8a636c) at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:1465
      #12 0x0000000041bfc3da in ?? ()

lambdageek added a commit to lambdageek/runtime that referenced this issue Dec 3, 2021
On AOT the field's class may not have been fully inited yet.

Related to dotnet#62311
@lambdageek lambdageek added area-VM-meta-mono and removed untriaged New issue has not been triaged by the area owner labels Dec 3, 2021
@lambdageek lambdageek added this to the 7.0.0 milestone Dec 3, 2021
@lambdageek lambdageek added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Dec 3, 2021
@lambdageek
Copy link
Member

@steveisok Another pair of failures that would have been caught if we ran the linux runtime test lanes on PRs

lambdageek added a commit that referenced this issue Dec 3, 2021
* Update overlapped field test to conflict on 32-bit arches

   Fixes #62303

* [class-init] Setup fields of nested structs in layout check

   On AOT the field's class may not have been fully inited yet.

   Related to #62311
@jakobbotsch jakobbotsch removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label May 3, 2022
@SamMonoRT SamMonoRT added the disabled-test The test is disabled in source code against the issue label Aug 4, 2022
@SamMonoRT SamMonoRT modified the milestones: 7.0.0, 8.0.0 Aug 4, 2022
@SamMonoRT SamMonoRT modified the milestones: 8.0.0, 9.0.0 Jul 25, 2023
@jandupej
Copy link
Member

When the test case05 is moved to a console app, the following happens. A method tries to instantiate a type with an invalid layout, its compile_method bails out because cfg->exception_type is set to MONO_EXCEPTION_TYPE_LOAD. Then at run time, the method is not found and we get a System.ExecutionEngineException: Attempting to JIT compile method '...' while running in aot-only mode. The test presumably fails because it encounters the wrong type of exception when instantiating the invalid type.

@lambdageek What is the expected behavior here? Should the AOT compiler replace the newobj instance with a throw when the type has a failure?

@lambdageek
Copy link
Member

When the test case05 is moved to a console app, the following happens. A method tries to instantiate a type with an invalid layout, its compile_method bails out because cfg->exception_type is set to MONO_EXCEPTION_TYPE_LOAD. Then at run time, the method is not found and we get a System.ExecutionEngineException: Attempting to JIT compile method '...' while running in aot-only mode. The test presumably fails because it encounters the wrong type of exception when instantiating the invalid type.

@lambdageek What is the expected behavior here? Should the AOT compiler replace the newobj instance with a throw when the type has a failure?

In general, we have been moving in the direction of following NativeAOT's behavior, which is to not fail the AOT compilation, but to generate code that throws something at runtime. I'm not sure if that is what they do for this specific test, too.

@jandupej
Copy link
Member

jandupej commented Oct 5, 2023

The said tests have been reenabled in #91261 and seem to work fine. Closing the issue.

@jandupej jandupej closed this as completed Oct 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x64 area-VM-meta-mono disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro)
Projects
None yet
Development

No branches or pull requests

5 participants