Bug 60678 - UdpClient.JoinMulticastGroup SIGABRT while executing native code - in Release mode on Linux
Summary: UdpClient.JoinMulticastGroup SIGABRT while executing native code - in Release...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer ()
Version: 5.4 (2017-06)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-14 18:26 UTC by Michal Dobrodenka
Modified: 2017-11-16 10:57 UTC (History)
3 users (show)

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


Attachments
Sample project to demonstrate bug. (3.74 KB, application/x-zip-compressed)
2017-11-14 18:26 UTC, Michal Dobrodenka
Details


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 for Bug 60678 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Michal Dobrodenka 2017-11-14 18:26:01 UTC
Created attachment 25705 [details]
Sample project to demonstrate bug.

I can reproduce this bug on Mono 5.4 (tested on Raspberry Pi 1):

Attaching sample project which can crash on start, probability like 40-50%.
Crashing only in Release. It crashes on JoinMulticastGroup when some other UDP socket operation is in progress or something like that. To reproduce it must be Release mode and without --trace or --debug options. I made workaround in my code not to make any other socket operation while JoinMulticastGroup. I didn't encounter this bug on Mono 3.2.8.

Mono JIT compiler version 5.4.0.201 (tarball Fri Oct 13 23:06:45 UTC 2017):
* Assertion at w32socket.c:2234, condition `field' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Net.Sockets.Socket.SetSocketOption_internal (intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&) <0x0005b>
  at System.Net.Sockets.Socket.SetSocketOption_internal (System.Net.Sockets.SafeSocketHandle,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&) [0x00010] in <8a8abae728c244359683ef777047ab9e>:0
  at System.Net.Sockets.Socket.SetSocketOption (System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object) [0x0007c] in <8a8abae728c244359683ef777047ab9e>:0
  at System.Net.Sockets.UdpClient.JoinMulticastGroup (System.Net.IPAddress) [0x0006e] in <8a8abae728c244359683ef777047ab9e>:0
  at Multicast.DiscoveryServer.MulticastListenerJob () [0x0004d] in <c50f17768c824676a9a8c0b4c1a35028>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00014] in <52f79f713f22467ab348e590c85015fb>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in <52f79f713f22467ab348e590c85015fb>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in <52f79f713f22467ab348e590c85015fb>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in <52f79f713f22467ab348e590c85015fb>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <52f79f713f22467ab348e590c85015fb>:0
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004d] in <52f79f713f22467ab348e590c85015fb>:0
/proc/self/maps:
00010000-00339000 r-xp 00000000 b3:02 18132      /usr/bin/mono-sgen
00349000-0034a000 r--p 00329000 b3:02 18132      /usr/bin/mono-sgen
0034a000-0034c000 rw-p 0032a000 b3:02 18132      /usr/bin/mono-sgen
0034c000-00378000 rw-p 00000000 00:00 0
0197d000-01ab1000 rw-p 00000000 00:00 0          [heap]
b3f00000-b3f01000 ---p 00000000 00:00 0
b3f01000-b4100000 rw-p 00000000 00:00 0          [stack:9028]
b4162000-b4400000 r--p 00000000 b3:02 18461      /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
b4400000-b4401000 ---p 00000000 00:00 0
b4401000-b4500000 rw-p 00000000 00:00 0          [stack:9027]
b4500000-b4501000 ---p 00000000 00:00 0
b4501000-b4600000 rw-p 00000000 00:00 0          [stack:9026]
b4600000-b4601000 ---p 00000000 00:00 0
b4601000-b4700000 rw-p 00000000 00:00 0          [stack:9025]
b4700000-b475f000 rw-p 00000000 00:00 0
b475f000-b4800000 ---p 00000000 00:00 0
b4809000-b4813000 r-xp 00000000 b3:02 1945       /lib/arm-linux-gnueabihf/libnss_files-2.19.so
b4813000-b4822000 ---p 0000a000 b3:02 1945       /lib/arm-linux-gnueabihf/libnss_files-2.19.so
b4822000-b4823000 r--p 00009000 b3:02 1945       /lib/arm-linux-gnueabihf/libnss_files-2.19.so
b4823000-b4824000 rw-p 0000a000 b3:02 1945       /lib/arm-linux-gnueabihf/libnss_files-2.19.so
b4828000-b482a000 rw-p 00000000 00:00 0
b482a000-b484a000 rwxp 00000000 00:00 0
b484a000-b4c00000 r--p 00000000 b3:02 18367      /usr/lib/mono/4.5/mscorlib.dll
b4c00000-b5400000 rw-p 00000000 00:00 0
b5400000-b5401000 ---p 00000000 00:00 0
b5401000-b6000000 rw-p 00000000 00:00 0          [stack:9022]
b6000000-b6001000 ---p 00000000 00:00 0
b6001000-b6100000 rw-p 00000000 00:00 0          [stack:9024]
b6100000-b612c000 rw-p 00000000 00:00 0
b612c000-b6200000 ---p 00000000 00:00 0
b6200000-b6220000 rwxp 00000000 00:00 0
b6220000-b6221000 ---p 00000000 00:00 0
b6221000-b63a1000 rw-p 00000000 00:00 0          [stack:9023]
b63a1000-b63a2000 rw-p 00000000 00:00 0
b63a2000-b63b2000 rwxp 00000000 00:00 0
b63b2000-b63b3000 ---p 00000000 00:00 0
b63b3000-b6bb3000 rw-p 00000000 00:00 0          [stack:9021]
b6bb3000-b6be2000 ---p 00000000 00:00 0
b6be2000-b6bf2000 rwxp 00000000 00:00 0
b6bf2000-b6d7b000 r--p 00000000 b3:02 6122       /usr/lib/locale/locale-archive
b6d7b000-b6ea3000 r-xp 00000000 b3:02 1910       /lib/arm-linux-gnueabihf/libc-2.19.so
b6ea3000-b6eb2000 ---p 00128000 b3:02 1910       /lib/arm-linux-gnueabihf/libc-2.19.so
b6eb2000-b6eb4000 r--p 00127000 b3:02 1910       /lib/arm-linux-gnueabihf/libc-2.19.so
b6eb4000-b6eb5000 rw-p 00129000 b3:02 1910       /lib/arm-linux-gnueabihf/libc-2.19.so
b6eb5000-b6eb8000 rw-p 00000000 00:00 0
b6eb8000-b6ed5000 r-xp 00000000 b3:02 1923       /lib/arm-linux-gnueabihf/libgcc_s.so.1
b6ed5000-b6ee4000 ---p 0001d000 b3:02 1923       /lib/arm-linux-gnueabihf/libgcc_s.so.1
b6ee4000-b6ee5000 rw-p 0001c000 b3:02 1923       /lib/arm-linux-gnueabihf/libgcc_s.so.1
b6ee5000-b6ef9000 r-xp 00000000 b3:02 1957       /lib/arm-linux-gnueabihf/libpthread-2.19.so
b6ef9000-b6f09000 ---p 00014000 b3:02 1957       /lib/arm-linux-gnueabihf/libpthread-2.19.so
b6f09000-b6f0a000 r--p 00014000 b3:02 1957       /lib/arm-linux-gnueabihf/libpthread-2.19.so
b6f0a000-b6f0b000 rw-p 00015000 b3:02 1957       /lib/arm-linux-gnueabihf/libpthread-2.19.so
b6f0b000-b6f0d000 rw-p 00000000 00:00 0
b6f0d000-b6f0f000 r-xp 00000000 b3:02 1918       /lib/arm-linux-gnueabihf/libdl-2.19.so
b6f0f000-b6f1e000 ---p 00002000 b3:02 1918       /lib/arm-linux-gnueabihf/libdl-2.19.so
b6f1e000-b6f1f000 r--p 00001000 b3:02 1918       /lib/arm-linux-gnueabihf/libdl-2.19.so
b6f1f000-b6f20000 rw-p 00002000 b3:02 1918       /lib/arm-linux-gnueabihf/libdl-2.19.so
b6f20000-b6f26000 r-xp 00000000 b3:02 1960       /lib/arm-linux-gnueabihf/librt-2.19.so
b6f26000-b6f35000 ---p 00006000 b3:02 1960       /lib/arm-linux-gnueabihf/librt-2.19.so
b6f35000-b6f36000 r--p 00005000 b3:02 1960       /lib/arm-linux-gnueabihf/librt-2.19.so
b6f36000-b6f37000 rw-p 00006000 b3:02 1960       /lib/arm-linux-gnueabihf/librt-2.19.so
b6f37000-b6fa0000 r-xp 00000000 b3:02 1935       /lib/arm-linux-gnueabihf/libm-2.19.so
b6fa0000-b6fb0000 ---p 00069000 b3:02 1935       /lib/arm-linux-gnueabihf/libm-2.19.so
b6fb0000-b6fb1000 r--p 00069000 b3:02 1935       /lib/arm-linux-gnueabihf/libm-2.19.so
b6fb1000-b6fb2000 rw-p 0006a000 b3:02 1935       /lib/arm-linux-gnueabihf/libm-2.19.so
b6fb2000-b6fd2000 r-xp 00000000 b3:02 1900       /lib/arm-linux-gnueabihf/ld-2.19.so
b6fd2000-b6fd4000 r--p 00000000 00:15 202632     /tmp/mixal/Multicast.exe
b6fd4000-b6fda000 rw-p 00000000 00:00 0
b6fda000-b6fdc000 rw-p 00000000 00:00 0
b6fdc000-b6fdd000 rw-s 00000000 00:13 203039     /run/shm/mono.9020
b6fdd000-b6fde000 ---p 00000000 00:00 0
b6fde000-b6fdf000 r--p 00000000 00:00 0
b6fdf000-b6fe1000 rw-p 00000000 00:00 0
b6fe1000-b6fe2000 r--p 0001f000 b3:02 1900       /lib/arm-linux-gnueabihf/ld-2.19.so
b6fe2000-b6fe3000 rw-p 00020000 b3:02 1900       /lib/arm-linux-gnueabihf/ld-2.19.so
beca4000-becc5000 rw-p 00000000 00:00 0          [stack]
bedcc000-bedcd000 r-xp 00000000 00:00 0          [sigpage]
ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]

Native stacktrace:


Debug info from gdb:

mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted