Re: [Mono-dev] Patch to avoid some race conditions on the mono runtime
Hi, The first two modifications look ok, and are now in SVN. I'm not sure why the third is needed tough. Zoltan On 8/29/06, briaeros007 [EMAIL PROTECTED] wrote: Hello, I'm sorry to double post this message, but I just find out that my first post doesn't have a subject ! I'm really sorry if you have already seen the first message. In my work, i have to use mono with a specific thread library which permits us to see some race conditions when we use mono as a library in a threaded environnement . Mono with the use of this library show some race conditions that i've tried to fixed. In the patch we can see four modifications of the file mini.c. The first two are modifications which avoid to put two times the same fonction in a table. The last modification (which corresponds to the two last modifications on the patch) was done since we have plenty of bugs which aren't reproductibles, but all theses bugs have this fonction as a common point. In this way we have just extend the critical section. this modifications permits to run our tests program without any scratch. yours sincerely Ps : theses errors are also in the new release of mono 1.1.17. The patch work on this version too, even if there are a fuzz without any consequences. --- Subete ga wakatta toki…watashi ga anta wo korosu. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Patch to avoid some race conditions on the mono runtime
Hello,I'm sorry to double post this message, but I just find out that my first post doesn't have a subject !I'm really sorry if you have already seen the first message.In my work, i have to use mono with a specific thread library which permits us to see some race conditions when we use mono as a libraryin a threaded environnement . Mono with the use of this library showsome race conditions that i've tried to fixed. In the patch we can see four modifications of the file mini.c.The first two are modifications which avoid to put two times the samefonction in a table.The last modification (which corresponds to the two last modificationson the patch) was done since we have plenty of bugs which aren't reproductibles, but all theses bugs have this fonction as a commonpoint. In this way we have just extend the critical section. thismodifications permits to run our tests program without any scratch.yours sincerely Ps : theses errors are also in the new release of mono 1.1.17.The patch work on this version too, even if there are a fuzzwithout any consequences.--- Subete ga wakatta toki…watashi ga anta wo korosu. diff -abur mono-1.1.16.1/mono/mini/mini.c mono-1.1.16.1.1/mono/mini/mini.c --- mono-1.1.16.1/mono/mini/mini.c 2006-07-05 23:55:50.0 +0200 +++ mono-1.1.16.1.1/mono/mini/mini.c2006-08-04 09:22:11.418560308 +0200 @@ -2848,12 +2848,15 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock (); + info = mono_find_jit_icall_by_name (icall_name); + if (info == NULL) { esig = mono_get_array_new_va_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (mono_array_new_va, name, esig, FALSE); - mono_jit_lock (); g_hash_table_insert (jit_icall_name_hash, name, name); + } mono_jit_unlock (); } @@ -3052,13 +3055,18 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock(); + info = mono_find_jit_icall_by_name (icall_name); + if(info==NULL){ esig = mono_get_element_address_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (ves_array_element_address, name, esig, FALSE); - mono_jit_lock (); + /*mono_jit_lock ();*/ g_hash_table_insert (jit_icall_name_hash, name, name); - mono_jit_unlock (); + /*mono_jit_unlock ();*/ + } + mono_jit_unlock(); } temp = mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info-sig, sp, ip, FALSE, FALSE); @@ -10284,7 +10292,6 @@ } } - mono_domain_unlock (target_domain); p = mono_create_ftnptr (target_domain, mono_jit_compile_method_inner (method, target_domain, opt)); if (callinfo) { @@ -10296,7 +10303,7 @@ } mono_jit_unlock (); } - + mono_domain_unlock (target_domain); return p; } ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Patch to avoid some race conditions on the mono runtime
Hello, In my work, i have to use mono with a specific thread library. Mono with the use of this library show some race conditions that i've tried to fixed. In the patch we can see three modifications of the file mini.c. The first two are modifications which avoid to put two times the same fonction in a table. The last modification (which corresponds to the two last modifications on the patch) was done since we have plenty of bugs which aren't reproductibles, but all theses bugs have this fonction as a common point. In this way we have just extend the critical section. this modifications permits to run our tests program without any scratch. yours sincerely Ps: the version of mono i used is the 1.1.16.1 --- Subete ga wakatta toki…watashi ga anta wo korosu. diff -abur mono-1.1.16.1/mono/mini/mini.c mono-1.1.16.1.1/mono/mini/mini.c --- mono-1.1.16.1/mono/mini/mini.c 2006-07-05 23:55:50.0 +0200 +++ mono-1.1.16.1.1/mono/mini/mini.c 2006-08-04 09:22:11.418560308 +0200 @@ -2848,12 +2848,15 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock (); + info = mono_find_jit_icall_by_name (icall_name); + if (info == NULL) { esig = mono_get_array_new_va_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (mono_array_new_va, name, esig, FALSE); - mono_jit_lock (); g_hash_table_insert (jit_icall_name_hash, name, name); + } mono_jit_unlock (); } @@ -3052,13 +3055,18 @@ info = mono_find_jit_icall_by_name (icall_name); if (info == NULL) { + mono_jit_lock(); + info = mono_find_jit_icall_by_name (icall_name); + if(info==NULL){ esig = mono_get_element_address_signature (rank); name = g_strdup (icall_name); info = mono_register_jit_icall (ves_array_element_address, name, esig, FALSE); - mono_jit_lock (); + /*mono_jit_lock ();*/ g_hash_table_insert (jit_icall_name_hash, name, name); - mono_jit_unlock (); + /*mono_jit_unlock ();*/ + } + mono_jit_unlock(); } temp = mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info-sig, sp, ip, FALSE, FALSE); @@ -10284,7 +10292,6 @@ } } - mono_domain_unlock (target_domain); p = mono_create_ftnptr (target_domain, mono_jit_compile_method_inner (method, target_domain, opt)); if (callinfo) { @@ -10296,7 +10303,7 @@ } mono_jit_unlock (); } - + mono_domain_unlock (target_domain); return p; } ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list