Runtime: Null ref thrown in System.Text RegEx

Created on 26 Jul 2017  路  12Comments  路  Source: dotnet/runtime

The user posted an image with issue here:

https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/649

@krwq: wrote regex stack trace by hand from the picture for easier grep

System.Text.RegularExpressions.Regex.Lookup.LookupCachedAndUpdate(CachedCodeEntryKey key)
System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan ...
... (irrelevant)
area-System.Text.RegularExpressions

All 12 comments

@nicksav can you give a repro case, or more detailed callstack?

Guys, the issue might be related to me running .net core 2.o prev 1 with libs from 1.2. I have moved all code to 2 prev 2 Haven't seen this for 6 days. Before was quite often.

@nicksav thanks for trying out 2.0! I'll close this for now then since I can't see anything wrong with that code, please reopen if you see this again.

Also, if it repros could you try also adding this to you App.Config?

<runtime>
聽聽聽 <useLegacyJit聽enabled="1"聽/>
</runtime> 

or setting environmental variable on the server: COMPlus_TailCallLoopOpt=0 - we recently have seen a JIT bug which was producing random NREs - this is a workaround

Thanks guys, I was starting to not trust my eyes.

Do you think the JIT bug is also responsible for VS refusing to close and giving me a message box with the text of the NRE message? https://developercommunity.visualstudio.com/content/problem/61470/visual-studio-2017-object-reference-exception-when.html?childToView=85733#comment-85733

@jnm2 - I do not know about that (I doubt it though) but you can definitely try if you got consistent repro - I think the JIT bug is already fixed in new versions of clr but it might take a while until fix is being consumed everywhere.

Usually if you provide a step by step instruction how to recreate a bug it is being fixed fairly quickly. If you do not have a consistent repro then when it happens do not click anything in that instance of VS - open second instance of VS, click feedback and in the second or third tab during filing issue you should be able to choose the instance with the error (you might need to click record or something like that - I do not remember from the top of my head) - that should make it so that dump file will be created on the failing instance and attached to a bug - that should make it much easier to diagnose and fix.

I don't have a consistent repro, so I will do that.

@jnm2 nice - thank you for reporting this! Hopefully someone will take a look at it soon!

@jnm2 - in case you've missed - you just got response in the issue - they suspect this is coming from some extension you might have installed since they couldn't find symbols and gave you instructions on how to create better (?) dump

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iCodeWebApps picture iCodeWebApps  路  3Comments

omariom picture omariom  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

v0l picture v0l  路  3Comments

aggieben picture aggieben  路  3Comments