Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I see the following error when running my app against master:
Invalid IL code in (wrapper dynamic-method) System.Text.RegularExpressions.CompiledRegexRunner:Go6 (System.Text.RegularExpressions.RegexRunner): IL_0419: dup
at (wrapper managed-to-native) System.Delegate:CreateDelegate_internal (System.Type,object,System.Reflection.MethodInfo,bool)
at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure, Boolean allowClosed) [0x00000] in <filename unknown>:0
at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0
at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0
at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.CompiledRegexRunnerFactory.CreateInstance () [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex.Run (Boolean quick, Int32 prevlen, System.String input, Int32 beginning, Int32 length, Int32 startat) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.MatchCollection.GetMatch (Int32 i) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.MatchEnumerator.MoveNext () [0x00000] in <filename unknown>:0
The app runs without this error under 3.8/tar.
Do you have sample code we can run to reproduce the issue
This is highly repeatable - when it wants to be - but not in test code yet. The invalid IL reported can be almost anything - nop, bre, etc. - so something is very broken here.
The obvious change is the switch from mcs/class/System/System.Text.RegularExpressions to the referencesource impl for regex handling.
The observed scenarios are:
* app starts and always fails on regex execution
* app starts, fails a few regexs and then seems to work
* app starts, fails a few regexs and then SIGSEGVs
Looks like a threading issue to me. I reckon the MS code gets poked by the MS runtime before the first call, consider this working scenario:
1) start app
2) call regex for the first time on only one thread
3) call regex on any number of threads
and all is good, however:
1) start app
2) call regex on any number of threads - BANG!
Can you share the code that causes this?
Alternatively, can you turn off the IL code generation? In Mono's previous incarnation, that was a no-op, now it actually does something.
This is most likely cause by our SRE implementation not being thread-safe at all compared to .net SRE which is.
I disabled the IL generator for now.
I wonder if it's still an issue in mono 5.7 - do we have a repro?
I am closing the issue as we disabled the IL generator a long time ago. We are going to import CoreFX tests for RegularExpressions which hopefully will help us to reproduce the issue