harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Rebriy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4042) [drlvm][thread][tc] Race condition at thread_java_monitors.c":327 and thread_native_suspend.c":301
Date Wed, 19 Dec 2007 10:59:43 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12553302
] 

Pavel Rebriy commented on HARMONY-4042:
---------------------------------------

Regarding revision 603614 code of jthread_monitor_timed_wait() was re-developed and described
race condition was remove.
That why I think the bug could be closed.

> [drlvm][thread][tc] Race condition at thread_java_monitors.c":327 and thread_native_suspend.c":301

> ---------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4042
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4042
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Ilya Leviev
>         Attachments: SourceViewScreenshot-1.jpg
>
>
> Race condition at thread_java_monitors.c":327 and thread_native_suspend.c":301 
> TC report on thread unsafe access to "state" field that result in race condition that
occur during concurrent execution of hythread_resume and jthread_monitor_timed_wait functions.

> Write -> Write data-race	
> Memory write at "thread_java_monitors.c":327 conflicts with a prior memory write at "thread_native_suspend.c":301
> Stack Trace: 
> Context
> 	Function m2n_free_local_handles "m2n_ia32.cpp":268
> 	Function hythread_self "hythread.h":465
> 	Function int Jitrino::Jet::rt_h_i32_2_i16(int) "arith_rt.cpp":263
> 	Function hythread_self "hythread.h":465
> 	Function __int64 Jitrino::Jet::rt_h_i32_2_i64(int) "arith_rt.cpp":265
> 	Function hythread_thin_monitor_try_enter "thread_native_thin_monitor.c":361
> 	Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138
> 	Function hythread_suspend_enable "hythread_ext.h":373
> 	Function Java_java_lang_VMThreadManager_wait "java_lang_vmthreadmanager.cpp":202
> 	Function jthread_monitor_timed_wait "thread_java_monitors.c":291
> 1st Access
> 	Function vm_get_gc_thread_local "c_interface.cpp":2414
> 	Function gc_alloc_fast "mutator_alloc.cpp":120
> 	Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138
> 	Function m2n_free_local_handles "m2n_ia32.cpp":268
> 	Function hythread_self "hythread.h":465
> 	Function rth_get_interface_vtable "jit_runtime_support.cpp":651
> 	Function rth_update_checkcast_stats "jit_runtime_support.cpp":377
> 	Function hythread_thin_monitor_try_enter "thread_native_thin_monitor.c":343
> 	Function unreserve_lock "thread_native_thin_monitor.c":210
> 	Function hythread_resume "thread_native_suspend.c":301
> 	"300"	""	"     hymutex_lock(&thread->mutex);"
> 	"301"	"*"	"     thread->state &= ~TM_THREAD_STATE_SUSPENDED;"
> 	"302"	""	"     hymutex_unlock(&thread->mutex);"
> 2nd Access
> 	Function m2n_free_local_handles "m2n_ia32.cpp":268
> 	Function hythread_self "hythread.h":465
> 	Function int Jitrino::Jet::rt_h_i32_2_i16(int) "arith_rt.cpp":263
> 	Function hythread_self "hythread.h":465
> 	Function __int64 Jitrino::Jet::rt_h_i32_2_i64(int) "arith_rt.cpp":265
> 	Function hythread_thin_monitor_try_enter "thread_native_thin_monitor.c":361
> 	Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138
> 	Function hythread_suspend_enable "hythread_ext.h":373
> 	Function Java_java_lang_VMThreadManager_wait "java_lang_vmthreadmanager.cpp":202
> 	Function jthread_monitor_timed_wait "thread_java_monitors.c":327
> 	"326"	""	"     tm_native_thread = hythread_self();"
> 	"327"	"*"	"     tm_native_thread->state &= ~TM_THREAD_STATE_RUNNABLE;"
> 	"328"	""	"     tm_native_thread->state |= TM_THREAD_STATE_WAITING |"
> 	"329"	""	"             TM_THREAD_STATE_IN_MONITOR_WAIT;"
> See also Source View screenshot
> If it not affect correctness of execution I will mark it by special API for prevention
of further alarms on this race. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message