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

tests/src/baseservices/threading/readerwriterlockslim/upgrader.cs CoreCLR acceptance-test fails #9935

Closed
akoeplinger opened this issue Aug 7, 2018 · 2 comments
Assignees

Comments

@akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Aug 7, 2018

Steps to Reproduce

  1. Run third party acceptance tests, via make -C acceptance-tests coreclr-runtest-basic
  2. Observe tests/src/baseservices/threading/readerwriterlockslim/upgrader.exe test failing

This was most probably introduced by #9811. /cc @lambdageek

Current Behavior

MESSAGE:
Main thread EnterUpgradeableReadLock !
    @Thread 0 start 
    @Thread 0 Signal 
    @Thread 1 start 
    @Thread 1 Signal 
    @Thread 2 start 
    @Thread 2 Signal 
    @Thread 3 start 
    @Thread 3 Signal 
    @Thread 4 start 
    @Thread 4 Signal 
    @Thread 5 start 
    @Thread 5 Signal 
    @Thread 6 start 
    @Thread 6 Signal 
    @Thread 7 start 
    @Thread 7 Signal 
    @Thread 8 start 
    @Thread 8 Signal 
    @Thread 9 start 
    ev.wait 
    @Thread 9 Signal 
    @Main thread cannot enter Write Lock! 
    Test Passed! 
* Assertion at exception.c:108, condition `is_ok (error)' not met, function:mono_exception_new_by_name_domain, (null) assembly:/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mcs/class/lib/net_4_x-linux/mscorlib.dll type:ThreadAbortException member:(null)


+++++++++++++++++++
STACK TRACE:
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.Thread.JoinInternal (System.Threading.Thread,int) [0x00017] in <29c7e323d116485c94ee214ef79b56c5>:0
  at System.Threading.Thread.Join () [0x00000] in <29c7e323d116485c94ee214ef79b56c5>:0
  at Upgrader.ThreadMethod (object) [0x00072] in <cbf71e0b78aa403a83e66a28fdebbd56>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in <29c7e323d116485c94ee214ef79b56c5>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in <29c7e323d116485c94ee214ef79b56c5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in <29c7e323d116485c94ee214ef79b56c5>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in <29c7e323d116485c94ee214ef79b56c5>:0
  at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in <29c7e323d116485c94ee214ef79b56c5>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0001e] in <29c7e323d116485c94ee214ef79b56c5>:0
/proc/self/maps:
403a2000-403b2000 rwxp 00000000 00:00 0 
40ed1000-40ee1000 rwxp 00000000 00:00 0 
559060def000-559061224000 r-xp 00000000 08:11 23604604                   /mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono-sgen
559061424000-55906142b000 r--p 00435000 08:11 23604604                   /mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono-sgen
55906142b000-55906142f000 rw-p 0043c000 08:11 23604604                   /mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono-sgen
55906142f000-559061446000 rw-p 00000000 00:00 0 
559061879000-559061975000 rw-p 00000000 00:00 0                          [heap]
7fd0f0000000-7fd0f0021000 rw-p 00000000 00:00 0 
7fd0f0021000-7fd0f4000000 ---p 00000000 00:00 0 
7fd0f4000000-7fd0f4021000 rw-p 00000000 00:00 0 
7fd0f4021000-7fd0f8000000 ---p 00000000 00:00 0 
7fd0f8000000-7fd0f8021000 rw-p 00000000 00:00 0 
7fd0f8021000-7fd0fc000000 ---p 00000000 00:00 0 
7fd0fc000000-7fd0fc021000 rw-p 00000000 00:00 0 
7fd0fc021000-7fd100000000 ---p 00000000 00:00 0 
7fd100000000-7fd100021000 rw-p 00000000 00:00 0 
7fd100021000-7fd104000000 ---p 00000000 00:00 0 
7fd104000000-7fd104021000 rw-p 00000000 00:00 0 
7fd104021000-7fd108000000 ---p 00000000 00:00 0 
7fd108000000-7fd108021000 rw-p 00000000 00:00 0 
7fd108021000-7fd10c000000 ---p 00000000 00:00 0 
7fd10c000000-7fd10c021000 rw-p 00000000 00:00 0 
7fd10c021000-7fd110000000 ---p 00000000 00:00 0 
7fd110000000-7fd110064000 rw-p 00000000 00:00 0 
7fd110064000-7fd114000000 ---p 00000000 00:00 0 
Memory around native instruction pointer (0x7fd122067fff):
0x7fd122067fef  d2 4c 89 ce bf 02 00 00 00 b8 0e 00 00 00 0f 05  .L..............
0x7fd122067fff  48 81 c4 88 00 00 00 44 89 c0 5b c3 0f 1f 44 00  H......D..[...D.
0x7fd12206800f  00 48 8b 15 61 5e 36 00 f7 d8 64 89 02 eb ca 66  .H..a^6...d....f
0x7fd12206801f  90 85 ff 78 0c f7 df e9 e5 02 00 00 0f 1f 44 00  ...x..........D.

Native stacktrace:

	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1280d2) [0x559060f170d2]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1282dd) [0x559060f172dd]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0xbff45) [0x559060eaef45]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0) [0x7fd1225fc0c0]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf) [0x7fd122067fff]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7fd12206942a]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x2e61f4) [0x5590610d51f4]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x2fbe9e) [0x5590610eae9e]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(monoeg_assertion_message+0x96) [0x5590610eb2a6]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1bf824) [0x559060fae824]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1bff0f) [0x559060faef0f]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x2ec542) [0x5590610db542]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x2eca38) [0x5590610dba38]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1c25a8) [0x559060fb15a8]
	/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mono/mini/mono(+0x1c260a) [0x559060fb160a]
	[0x40ed89eb]

Debug info from gdb:

[New LWP 22603]
[New LWP 22605]
[New LWP 22619]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fd1225f815f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
  Id   Target Id         Frame 
* 1    Thread 0x7fd12312d740 (LWP 22550) "mono" 0x00007fd1225f815f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
  2    Thread 0x7fd121bff700 (LWP 22603) "SGen worker" 0x00007fd1225f815f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
  3    Thread 0x7fd11f40b700 (LWP 22605) "Finalizer" 0x00007fd1225fa536 in do_futex_wait.constprop () from /lib/x86_64-linux-gnu/libpthread.so.0
  4    Thread 0x7fd11e2fe700 (LWP 22619) "mono" 0x00007fd1225fbb3a in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0

Thread 4 (Thread 0x7fd11e2fe700 (LWP 22619)):
#0  0x00007fd1225fbb3a in waitpid () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x0000559060f17199 in dump_native_stacktrace (ctx=0x7fd11e2fcdc0, signal=0x55906110efd1 "SIGABRT") at mini-posix.c:1115
#2  0x0000559060f172dd in mono_dump_native_crash_info (signal=signal@entry=0x55906110efd1 "SIGABRT", ctx=ctx@entry=0x7fd11e2fcdc0, info=info@entry=0x7fd11e2fcef0) at mini-posix.c:1138
#3  0x0000559060eaef45 in mono_handle_native_crash (signal=0x55906110efd1 "SIGABRT", ctx=0x7fd11e2fcdc0, info=0x7fd11e2fcef0) at mini-exceptions.c:2948
#4  <signal handler called>
#5  0x00007fd122067fff in raise () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007fd12206942a in abort () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00005590610d51f4 in mono_log_write_logfile (log_domain=<optimized out>, level=<optimized out>, hdr=<optimized out>, message=0x7fd0fc002980 "* Assertion at exception.c:108, condition `is_ok (error)' not met, function:mono_exception_new_by_name_domain, (null) assembly:/mnt/jenkins/workspace/test-mono-pull-request-acceptance-tests/mcs/class/"...) at mono-log-common.c:135
#8  0x00005590610eae9e in monoeg_g_logstr (msg=<optimized out>, log_level=G_LOG_LEVEL_ERROR, log_domain=0x0) at goutput.c:117
#9  monoeg_g_logv_nofree (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x5590610f4430 "* Assertion at %s:%d, condition `%s' not met, function:%s, %s\n", args=args@entry=0x7fd11e2fd648) at goutput.c:128
#10 0x00005590610eb2a6 in monoeg_assertion_message (format=format@entry=0x5590610f4430 "* Assertion at %s:%d, condition `%s' not met, function:%s, %s\n") at goutput.c:163
#11 0x0000559060fae824 in mono_exception_new_by_name_domain (domain=0x55906188c690, image=image@entry=0x5590618912f0, name_space=name_space@entry=0x559061122dea "System", name=name@entry=0x5590610f7aa0 "ExecutionEngineException", error=error@entry=0x7fd11e2fd8b0) at exception.c:108
#12 0x0000559060faef0f in mono_exception_new_by_name (error=0x7fd11e2fd8b0, name=0x5590610f7aa0 "ExecutionEngineException", name_space=0x559061122dea "System", image=0x5590618912f0) at exception.c:58
#13 mono_exception_new_by_name_msg (image=0x5590618912f0, name_space=0x559061122dea "System", name=0x5590610f7aa0 "ExecutionEngineException", msg=0x7fd0fc002850 "MonoError reused after mono_error_cleanup", error=0x7fd11e2fd8b0) at exception.c:285
#14 0x00005590610db542 in mono_error_prepare_exception (oerror=oerror@entry=0x7fd11e2fd840, error_out=error_out@entry=0x7fd11e2fd8b0) at mono-error.c:693
#15 0x00005590610dba38 in mono_error_convert_to_exception (target_error=target_error@entry=0x7fd11e2fd9d0) at mono-error.c:738
#16 0x0000559060fb15a8 in mono_error_convert_to_exception_handle (error=0x7fd11e2fd9d0) at exception.c:1491
#17 0x0000559060fb160a in mono_error_set_pending_exception (error=0x7fd11e2fd9d0) at exception.c:1229
#18 0x0000000040ed89eb in ?? ()
#19 0x00007fd121c0b1b8 in ?? ()
#20 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fd11f40b700 (LWP 22605)):
#0  0x00007fd1225fa536 in do_futex_wait.constprop () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd1225fa5e4 in __new_sem_wait_slow.constprop.0 () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x000055906106be8e in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x5590614348a0 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:209
#3  mono_coop_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x5590614348a0 <finalizer_sem>) at ../../mono/utils/mono-coop-semaphore.h:43
#4  finalizer_thread (unused=unused@entry=0x0) at gc.c:918
#5  0x0000559061022f72 in start_wrapper_internal (stack_ptr=<optimized out>, start_info=0x0) at threads.c:1141
#6  start_wrapper (data=0x5590618d95f0) at threads.c:1201
#7  0x00007fd1225f2494 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007fd12211dacf in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7fd121bff700 (LWP 22603)):
#0  0x00007fd1225f815f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00005590610caf7b in mono_os_cond_wait (mutex=0x5590614436e0 <lock>, cond=0x5590614436a0 <work_cond>) at ../../mono/utils/mono-os-mutex.h:173
#2  get_work (job=<synthetic pointer>, do_idle=<synthetic pointer>, work_context=<synthetic pointer>, worker_index=0) at sgen-thread-pool.c:165
#3  thread_func (data=<optimized out>) at sgen-thread-pool.c:196
#4  0x00007fd1225f2494 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#5  0x00007fd12211dacf in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7fd12312d740 (LWP 22550)):
#0  0x00007fd1225f815f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00005590610cde1f in mono_os_cond_wait (mutex=0x5590614438a0 <signal_mutex>, cond=0x7ffd1fb53a50) at mono-os-mutex.h:173
#2  mono_os_event_wait_multiple (events=events@entry=0x7ffd1fb53ac0, nevents=nevents@entry=10, waitall=waitall@entry=1, timeout=4294967295, alertable=1) at os-event-unix.c:190
#3  0x00005590610e1ec7 in mono_thread_info_wait_multiple_handle (thread_handles=thread_handles@entry=0x7ffd1fb53d40, nhandles=10, background_change_event=background_change_event@entry=0x0, waitall=waitall@entry=1, timeout=<optimized out>, alertable=<optimized out>) at mono-threads.c:1863
#4  0x000055906101a377 in wait_for_tids (wait=wait@entry=0x7ffd1fb53d40, timeout=timeout@entry=4294967295, check_state_change=check_state_change@entry=0) at threads.c:3353
#5  0x000055906101e41f in mono_thread_manage () at threads.c:3574
#6  0x0000559060e7d870 in mono_main (argc=<optimized out>, argv=<optimized out>) at driver.c:2438
#7  0x0000559060e2a847 in mono_main_with_options (argv=<optimized out>, argc=<optimized out>) at main.c:50
#8  main (argc=<optimized out>, argv=<optimized out>) at main.c:405

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Expected Behavior

No failure.

On which platforms did you notice this

[ ] macOS
[ X ] Linux
[ ] Windows

Version Used: master

@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Aug 7, 2018

@lambdageek this looks like a regression, could you confirm

@lambdageek lambdageek self-assigned this Aug 7, 2018
@lambdageek

This comment has been minimized.

Copy link
Member

@lambdageek lambdageek commented Aug 7, 2018

Thanks, I'll take a look

lambdageek added a commit to lambdageek/mono that referenced this issue Aug 7, 2018
…eption

The icall was converted to use HANDLES(), so the icall wrapper will set the
pending exception from the MonoError.  If the icall does it, too, the second
use (in the wrapper) will assert that the MonoError is being reused after
cleanup without being reinitialized.

Also add an assertion in mono_error_get_message that we're not trying to get a
message from a cleaned up MonoError.

Fixes mono#9935
monojenkins added a commit to monojenkins/mono that referenced this issue Aug 8, 2018
…eption

The icall was converted to use HANDLES(), so the icall wrapper will set the
pending exception from the MonoError.  If the icall does it, too, the second
use (in the wrapper) will assert that the MonoError is being reused after
cleanup without being reinitialized.

Also add an assertion in mono_error_get_message that we're not trying to get a
message from a cleaned up MonoError.

Fixes mono#9935
monojenkins added a commit to monojenkins/mono that referenced this issue Aug 8, 2018
…eption

The icall was converted to use HANDLES(), so the icall wrapper will set the
pending exception from the MonoError.  If the icall does it, too, the second
use (in the wrapper) will assert that the MonoError is being reused after
cleanup without being reinitialized.

Also add an assertion in mono_error_get_message that we're not trying to get a
message from a cleaned up MonoError.

Fixes mono#9935
lambdageek added a commit that referenced this issue Aug 8, 2018
…eption (#9948)

The icall was converted to use HANDLES(), so the icall wrapper will set the
pending exception from the MonoError.  If the icall does it, too, the second
use (in the wrapper) will assert that the MonoError is being reused after
cleanup without being reinitialized.

Also add an assertion in mono_error_get_message that we're not trying to get a
message from a cleaned up MonoError.

Fixes #9935
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.