Bug 26141 - System.Type.GetInterfaceMapData NullReferenceException /SIGSEGV in native code (reflection)
Summary: System.Type.GetInterfaceMapData NullReferenceException /SIGSEGV in native cod...
Status: RESOLVED NORESPONSE
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 3.12.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-17 20:30 UTC by leonard.kleinhans42+xamarin
Modified: 2015-04-10 12:54 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED NORESPONSE

Description leonard.kleinhans42+xamarin 2015-01-17 20:30:24 UTC
I'm getting an SIGSEGV: 

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Type.GetInterfaceMapData (System.Type,System.Type,System.Reflection.MethodInfo[]&,System.Reflection.MethodInfo[]&) <IL 0x00010, 0xffffffff>
  at System.Type.GetInterfaceMap (System.Type) [0x0008e] in /build/mono/src/mono-3.12.0/mcs/class/corlib/System/Type.cs:928
  at Acme.Base.Utils.ReflectionExtension.GetImplementationInfo (System.Reflection.MethodInfo,System.Type) [0x00020] in /home/acme/prod/Base/Utils/ReflectionExtension.cs:48
  at Acme.Base.Utils.ReflectionExtension.GetImplementationInfo (System.Reflection.PropertyInfo,System.Type) [0x0001e] in /home/acme/prod/Base/Utils/ReflectionExtension.cs:23
  at Acme.Data.SQL.Expressions.SQLBuilder.VisitMember (System.Linq.Expressions.MemberExpression) [0x00082] in /home/acme/prod/Data/SQL/Expressions/SQLBuilder.cs:293
  at System.Linq.Expressions.MemberExpression.Accept (System.Linq.Expressions.ExpressionVisitor) [0x00000] in /build/mono/src/mono-3.12.0/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs:80
  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression) [0x00006] in /build/mono/src/mono-3.12.0/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs:53


Native stacktrace:

	/usr/lib/libmonosgen-2.0.so.1(+0xcf1da) [0x7f7f04d5e1da]
	/usr/lib/libmonosgen-2.0.so.1(+0x12cd7b) [0x7f7f04dbbd7b]
	/usr/lib/libmonosgen-2.0.so.1(+0x48016) [0x7f7f04cd7016]
	/usr/lib/libpthread.so.0(+0x10210) [0x7f7f04a83210]
	/usr/lib/libmonosgen-2.0.so.1(mono_method_get_object+0x24) [0x7f7f04e79764]
	/usr/lib/libmonosgen-2.0.so.1(+0x1677f6) [0x7f7f04df67f6]
	[0x41a49da4]

Debug info from gdb:

Mono support loaded.
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 8849]
[New LWP 8791]
[New LWP 8543]
[New LWP 8542]
[New LWP 8540]
[New LWP 8537]
[New LWP 8536]
[New LWP 8535]
[New LWP 8484]
[New LWP 8483]
[New LWP 8482]
[New LWP 8481]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007f7f04a7f8cf in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  Id   Target Id         Frame 
  13   Thread 0x7f7f0230e700 (LWP 8481) "Finalizer" 0x00007f7f04a81920 in sem_wait () from /usr/lib/libpthread.so.0
  12   Thread 0x7f7f017a1700 (LWP 8482) "mono" 0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
  11   Thread 0x7f7f015a0700 (LWP 8483) "mono" 0x00007f7f047b8853 in epoll_wait () from /usr/lib/libc.so.6
  10   Thread 0x7f7f0155f700 (LWP 8484) "IO Threadpool w" 0x00007f7f04a81a00 in sem_timedwait () from /usr/lib/libpthread.so.0
  9    Thread 0x7f7f0151e700 (LWP 8535) "Threadpool moni" 0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
  8    Thread 0x7f7f014d9700 (LWP 8536) "Threadpool work" 0x00007f7f04a82dfb in waitpid () from /usr/lib/libpthread.so.0
  7    Thread 0x7f7f012d4700 (LWP 8537) "Threadpool work" 0x00007f7f047ab42d in read () from /usr/lib/libc.so.6
  6    Thread 0x7f7ee36fb700 (LWP 8540) "Threadpool work" 0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  5    Thread 0x7f7ee32ed700 (LWP 8542) "Timer-Scheduler" 0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  4    Thread 0x7f7ee2dff700 (LWP 8543) "Threadpool work" 0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
  3    Thread 0x7f7ecab53700 (LWP 8791) "Threadpool work" 0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  2    Thread 0x7f7ee275b700 (LWP 8849) "Threadpool work" 0x00007f7f04a81a00 in sem_timedwait () from /usr/lib/libpthread.so.0
* 1    Thread 0x7f7f0544f780 (LWP 8480) "mono" 0x00007f7f04a7f8cf in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0

Thread 13 (Thread 0x7f7f0230e700 (LWP 8481)):
#0  0x00007f7f04a81920 in sem_wait () from /usr/lib/libpthread.so.0
#1  0x00007f7f04edd766 in mono_sem_wait () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e63ab9 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e46d07 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04ee3195 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00007f7f04a7a314 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007f7f047b824d in clone () from /usr/lib/libc.so.6

Thread 12 (Thread 0x7f7f017a1700 (LWP 8482)):
#0  0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
#1  0x00007f7f04ed0028 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e477aa in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x000000004194ec42 in ?? ()
#4  0x00007f7ef4002650 in ?? ()
#5  0x00007f7f017a0e30 in ?? ()
#6  0x00007f7f03b6fcb8 in ?? ()
#7  0x00007f7f03b6fcb8 in ?? ()
#8  0x00000000000f4240 in ?? ()
#9  0x00007f7ef40025f0 in ?? ()
#10 0x000000004194ebc8 in ?? ()
#11 0x00007f7f017a0c40 in ?? ()
#12 0x00007f7f017a0b20 in ?? ()
#13 0x000000004194eb80 in ?? ()
#14 0x00007f7f03b5ee18 in ?? ()
#15 0x000000004194eb60 in ?? ()
#16 0x00007f7f017a0c40 in ?? ()
#17 0x000000004194cb48 in ?? ()
#18 0x00007f7f03b6fcb8 in ?? ()
#19 0x00007f7f03b70248 in ?? ()
#20 0x00007f7f03b70248 in ?? ()
#21 0x00007f7f03b70248 in ?? ()
#22 0x00007f7f017a0c40 in ?? ()
#23 0x000000004194c929 in ?? ()
#24 0x0000000041892000 in ?? ()
#25 0x00007f7f03b6fd70 in ?? ()
#26 0x000000004194c830 in ?? ()
#27 0x00000000418920c0 in ?? ()
#28 0x00000000000001ff in ?? ()
#29 0x00007f7ef4002650 in ?? ()
#30 0x0000000000000000 in ?? ()

Thread 11 (Thread 0x7f7f015a0700 (LWP 8483)):
#0  0x00007f7f047b8853 in epoll_wait () from /usr/lib/libc.so.6
#1  0x00007f7f04e4a8c9 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e46d07 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04ee3195 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04a7a314 in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f7f047b824d in clone () from /usr/lib/libc.so.6

Thread 10 (Thread 0x7f7f0155f700 (LWP 8484)):
#0  0x00007f7f04a81a00 in sem_timedwait () from /usr/lib/libpthread.so.0
#1  0x00007f7f04edd853 in mono_sem_timedwait () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e4cb5a in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e46d07 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04ee3195 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00007f7f04a7a314 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007f7f047b824d in clone () from /usr/lib/libc.so.6

Thread 9 (Thread 0x7f7f0151e700 (LWP 8535)):
#0  0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
#1  0x00007f7f04ed0028 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e49f36 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e46d07 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04ee3195 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00007f7f04a7a314 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007f7f047b824d in clone () from /usr/lib/libc.so.6

Thread 8 (Thread 0x7f7f014d9700 (LWP 8536)):
#0  0x00007f7f04a82dfb in waitpid () from /usr/lib/libpthread.so.0
#1  0x00007f7f04d5e270 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04dbbd7b in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04cd7016 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  <signal handler called>
#5  0x00007f7f04e79764 in mono_method_get_object () from /usr/lib/libmonosgen-2.0.so.1
#6  0x00007f7f04df67f6 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#7  0x0000000041a49da4 in ?? ()
#8  0x00007f7ee30eaf18 in ?? ()
#9  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f7f012d4700 (LWP 8537)):
#0  0x00007f7f047ab42d in read () from /usr/lib/libc.so.6
#1  0x000000004195dbd5 in ?? ()
#2  0x00007f7ef4002650 in ?? ()
#3  0x00007f7f012d3e30 in ?? ()
#4  0x00007f7f03b80e90 in ?? ()
#5  0x00007f7f03b7fd80 in ?? ()
#6  0x00007f7f03b7fcd8 in ?? ()
#7  0x00007f7ee80025f0 in ?? ()
#8  0x000000004195db40 in ?? ()
#9  0x00007f7f012d3bb0 in ?? ()
#10 0x00007f7f012d3af0 in ?? ()
#11 0x000000004195db40 in ?? ()
#12 0x00007f7f03b80eb0 in ?? ()
#13 0x000000004195da34 in ?? ()
#14 0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f7ee36fb700 (LWP 8540)):
#0  0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f7f04ebaade in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04ecea62 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e6704b in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x0000000041e4de9a in ?? ()
#5  0x00007f7edc2de7d0 in ?? ()
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f7ee32ed700 (LWP 8542)):
#0  0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f7f04ebaade in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04ecea62 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e4674f in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04e47bfc in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00000000419d0f5d in ?? ()
#6  0x0000000000000007 in ?? ()
#7  0x0000000000000001 in ?? ()
#8  0x00000000000003e8 in ?? ()
#9  0x00007f7f039d44e0 in ?? ()
#10 0x00000000000003e7 in ?? ()
#11 0x00007f7ed80025f0 in ?? ()
#12 0x00007f7ee32ecbb0 in ?? ()
#13 0x00007f7ee32ec9f0 in ?? ()
#14 0x00007f7ee32ec950 in ?? ()
#15 0x00000000419d0bf8 in ?? ()
#16 0x00007f7ee44292e0 in ?? ()
#17 0x00007f7f039d44e0 in ?? ()
#18 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f7ee2dff700 (LWP 8543)):
#0  0x00007f7f047c515a in clock_nanosleep () from /usr/lib/libc.so.6
#1  0x00007f7f04ed0028 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e477aa in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x000000004194ec42 in ?? ()
#4  0x00007f7ef4002650 in ?? ()
#5  0x00007f7ee2dfee30 in ?? ()
#6  0x00007f7ee2becd30 in ?? ()
#7  0x00007f7ee2becd30 in ?? ()
#8  0x000000000000000a in ?? ()
#9  0x00007f7ecc0025f0 in ?? ()
#10 0x00007f7ee2dfe828 in ?? ()
#11 0x00007f7ee2dfebb0 in ?? ()
#12 0x00007f7ee2dfe7d0 in ?? ()
#13 0x000000004194eb80 in ?? ()
#14 0x00007f7ee2becd30 in ?? ()
#15 0x48d200d35ef30842 in ?? ()
#16 0x00007f7ee2dfebb0 in ?? ()
#17 0x0000000041a43514 in ?? ()
#18 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f7ecab53700 (LWP 8791)):
#0  0x00007f7f04a7fc78 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f7f04ebaade in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04ecea62 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e4674f in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04e47bfc in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00000000419d0f5d in ?? ()
#6  0xffffffff8000003b in ?? ()
#7  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f7ee275b700 (LWP 8849)):
#0  0x00007f7f04a81a00 in sem_timedwait () from /usr/lib/libpthread.so.0
#1  0x00007f7f04edd853 in mono_sem_timedwait () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04e4cb5a in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e46d07 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04ee3195 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00007f7f04a7a314 in start_thread () from /usr/lib/libpthread.so.0
#6  0x00007f7f047b824d in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f7f0544f780 (LWP 8480)):
#0  0x00007f7f04a7f8cf in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f7f04ebacfb in ?? () from /usr/lib/libmonosgen-2.0.so.1
#2  0x00007f7f04ecf6f9 in ?? () from /usr/lib/libmonosgen-2.0.so.1
#3  0x00007f7f04e49a2a in mono_thread_manage () from /usr/lib/libmonosgen-2.0.so.1
#4  0x00007f7f04d346cf in mono_main () from /usr/lib/libmonosgen-2.0.so.1
#5  0x00007f7f046f0040 in __libc_start_main () from /usr/lib/libc.so.6
#6  0x00000000004015bd in ?? ()
[0x7f7ee36fb700: 24,49100 0] ENTER: Acme.Global:get_IsShuttingdown ()()
[0x7f7ee36fb700: 24,49105 0] LEAVE: Acme.Global:get_IsShuttingdown ()FALSE

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Marek Safar 2015-01-19 06:06:39 UTC
Could you attach some repro for the issue
Comment 2 leonard.kleinhans42+xamarin 2015-01-19 19:31:43 UTC
I've tried to reproduce the issue with non-company code, but I wasn't able to do so. In some way this is weird, because the SIGSEGV occurs when I try to call GetInterfaceMap() for a property-getter of type DateTime?. But in my example (see http://pastebin.com/StzQ9EaR) everything works fine. Do you have any idea what else I could try?
Comment 3 Marek Safar 2015-01-20 11:22:08 UTC
You are probably not hitting the right case. Calling it on nullable type is easy and should not fail (it never return anything either). Try to add more logging to original code or attach (send me) privately whole project
Comment 4 Marek Safar 2015-03-30 10:00:11 UTC
no response
Comment 5 leonard.kleinhans42+xamarin 2015-04-10 12:54:45 UTC
I cannot send you the whole project, and because I couldn't reproduce the issue, I don#t see anything I can do.