[Mono-dev] SIGSEGV from bad generic type (bug 30085)
curylod at asme.org
Thu May 28 20:25:55 UTC 2015
Found the issue and created PR 1839: https://github.com/mono/mono/pull/1839
Please take a look and let me know if you have any concerns with the fix.
On May 28, 2015, at 3:51 PM, David Curylo <curylod at asme.org> wrote:
> I’m researching an issue reported by a colleague of mine. The error is rather serious as the use of a bad type name causes a native SIGSEGV and kills the runtime, when it really should just return a null because it can’t find the type. This code reproduces the issue:
> System.Type.GetType("System.Nullable`1[[System.Int32, mscorlibBAD]]")
> Since I see there is some work going on with System.Type, I was hopeful that mono master would no longer have this issue, but it still exists. This is what I’m getting in the thread dump when this occurs and the root cause appears to be somewhere in _mono_reflection_get_type_from_info. Any ideas what may be the root cause here?
> Thread 1 (Thread 0x7f28ae81f7c0 (LWP 76562)):
> #0 0x00007f28adcf7ee9 in __libc_waitpid (pid=pid at entry=76565, stat_loc=stat_loc at entry=0x7f28ae82919c, options=options at entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
> #1 0x00000000004a2015 in mono_handle_native_sigsegv (signal=signal at entry=11, ctx=ctx at entry=0x7f28ae829ac0, info=info at entry=0x7f28ae829bf0) at mini-exceptions.c:2226
> #2 0x00000000004f782e in mono_arch_handle_altstack_exception (sigctx=sigctx at entry=0x7f28ae829ac0, siginfo=siginfo at entry=0x7f28ae829bf0, fault_addr=<optimized out>, stack_ovf=stack_ovf at entry=0) at exceptions-amd64.c:858
> #3 0x0000000000422f28 in mono_sigsegv_signal_handler (_dummy=11, _info=0x7f28ae829bf0, context=0x7f28ae829ac0) at mini-runtime.c:2526
> #4 <signal handler called>
> #5 0x00000000005bcb91 in _mono_reflection_get_type_from_info (info=0x1efb270, image=image at entry=0x0, ignorecase=ignorecase at entry=0) at reflection.c:7450
> #6 0x00000000005bc750 in mono_reflection_get_type_internal (rootimage=rootimage at entry=0x0, image=<optimized out>, info=info at entry=0x7fff8b7388e0, ignorecase=ignorecase at entry=0) at reflection.c:7565
> #7 0x00000000005bc9b3 in mono_reflection_get_type_with_rootimage (rootimage=rootimage at entry=0x0, image=image at entry=0x0, info=info at entry=0x7fff8b7388e0, ignorecase=ignorecase at entry=0, type_resolve=type_resolve at entry=0x7fff8b7388d4) at reflection.c:7661
> #8 0x00000000005bcb00 in mono_reflection_get_type (image=image at entry=0x0, info=info at entry=0x7fff8b7388e0, ignorecase=ignorecase at entry=0, type_resolve=type_resolve at entry=0x7fff8b7388d4) at reflection.c:7613
> #9 0x000000000053456d in type_from_name (ignoreCase=<optimized out>, str=0x1ef44f0 "System.Nullable`1[[System.Int32, mscorlibBAD]]") at icall.c:1286
> #10 ves_icall_type_from_name (name=0x7f28ae7981b0, throwOnError=<optimized out>, ignoreCase=<optimized out>) at icall.c:1322
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list