Bug 31506 - App crashing on TLS handshake
Summary: App crashing on TLS handshake
Status: RESOLVED DUPLICATE of bug 32344
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 8.10
Hardware: PC Mac OS
: --- major
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-30 14:43 UTC by David Hathaway
Modified: 2015-08-03 08:08 UTC (History)
5 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 Developer Community or GitHub 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 DUPLICATE of bug 32344

Description David Hathaway 2015-06-30 14:43:25 UTC
Master build: 8.11.0.1131

Log output:

20150624
15:44:12.791 CustomerXPSCiOS[1672:543101] critical: Stacktrace:
20150624
15:44:12.792 CustomerXPSCiOS[1672:543101] critical: at <unknown>
<0xffffffff>
20150624
15:44:12.794 CustomerXPSCiOS[1672:543101] critical: at (wrapper
managedtonative)
System.Object.__icall_wrapper_mono_array_new_specific
(intptr,int) <0xffffffff>
20150624
15:44:12.796 CustomerXPSCiOS[1672:543101] critical: at
System.IO.MemoryStream.ToArray () [0x00018] in
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/
io/memorystream.cs:589
20150624
15:44:12.798 CustomerXPSCiOS[1672:543101] critical: at
Mono.Security.Protocol.Tls.TlsStream.ToArray () [0x00000] in
Xamarin Build Issues, 6/29/2015
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/mcs/class/Mono.Security/Mono.Security.Pro
tocol.Tls/TlsStream.cs:229
20150624
15:44:12.799 CustomerXPSCiOS[1672:543101] critical: at
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerFinished.ProcessAsTls1 ()
[0x0000e] in
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/mcs/class/Mono.Security/Mono.Security.Pro
tocol.Tls.Handshake.Client/TlsServerFinished.cs:84
20150624
15:44:12.800 CustomerXPSCiOS[1672:543101] critical: at
Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00037] in
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/mcs/class/Mono.Security/Mono.Security.Pro
tocol.Tls.Handshake/HandshakeMessage.cs:105
20150624
15:44:12.801 CustomerXPSCiOS[1672:543101] critical: at
Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage
(Mono.Security.Protocol.Tls.TlsStream) [0x00039] in
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/mcs/class/Mono.Security/Mono.Security.Pro
tocol.Tls/ClientRecordProtocol.cs:81
20150624
15:44:12.801 CustomerXPSCiOS[1672:543101] critical: at
Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback
(System.IAsyncResult) [0x00117] in
/Users/builder/data/lanes/1381/2913a74d/source/maccore/_build/Library/Frameworks/Xa
marin.iOS.framework/Versions/git/src/mono/mcs/class/Mono.Security/Mono.Security.Pro
tocol.Tls/RecordProtocol.cs:396
20150624
15:44:12.802 CustomerXPSCiOS[1672:543101] critical: at (wrapper
runtimeinvoke)
System.Object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr)
<0xffffffff>
20150624
15:44:12.803 CustomerXPSCiOS[1672:543101] critical:
Native stacktrace:
20150624
15:44:12.960 CustomerXPSCiOS[1672:543084] [INFO ]
[CommonReadSyncStrategy] Downloaded file
/var/mobile/Containers/Data/Application/9A45C2F3AD314FE791D2BBDACC1898D1/
Librar
y/Caches/com.customer.ccsoc/TempPath/UserData/80c765cb332041b0bf2184185c633cf7/
c
ommonRead/e3a07b0411744ec9bc9ecb1fe168de19/
epub_cover.jpg
20150624
15:44:13.057 CustomerXPSCiOS[1672:543101] critical: 0 CustomerXPSCiOS
0x02ddb8db mono_handle_native_sigsegv + 238
20150624
15:44:13.058 CustomerXPSCiOS[1672:543101] critical: 1 CustomerXPSCiOS
0x02de27e5 mono_sigsegv_signal_handler + 212
20150624
15:44:13.058 CustomerXPSCiOS[1672:543101] critical: 2
libsystem_platform.dylib 0x3462787b _sigtramp + 42
Xamarin Build Issues, 6/29/2015
20150624
15:44:13.058 CustomerXPSCiOS[1672:543101] critical: 3 CustomerXPSCiOS
0x02ea75cc _ZL21gc_toggleref_callbackP10MonoObject + 108
20150624
15:44:13.059 CustomerXPSCiOS[1672:543101] critical: 4 CustomerXPSCiOS
0x02e4dfc9 sgen_process_togglerefs + 88
20150624
15:44:13.059 CustomerXPSCiOS[1672:543101] critical: 5 CustomerXPSCiOS
0x02e4c2ad sgen_client_stop_world + 64
20150624
15:44:13.059 CustomerXPSCiOS[1672:543101] critical: 6 CustomerXPSCiOS
0x02e6429b sgen_stop_world + 74
20150624
15:44:13.059 CustomerXPSCiOS[1672:543101] critical: 7 CustomerXPSCiOS
0x02e63c8b sgen_perform_collection + 98
20150624
15:44:13.060 CustomerXPSCiOS[1672:543101] critical: 8 CustomerXPSCiOS
0x02e63c25 sgen_ensure_free_space + 156
20150624
15:44:13.060 CustomerXPSCiOS[1672:543101] critical: 9 CustomerXPSCiOS
0x02e5c33f sgen_alloc_obj_nolock + 714
20150624
15:44:13.060 CustomerXPSCiOS[1672:543101] critical: 10 CustomerXPSCiOS
0x02e465eb mono_gc_alloc_vector + 114
20150624
15:44:13.060 CustomerXPSCiOS[1672:543101] critical: 11 CustomerXPSCiOS
0x02e392c7 mono_array_new_specific + 66
20150624
15:44:13.060 CustomerXPSCiOS[1672:543101] critical: 12 CustomerXPSCiOS
0x009646b8
wrapper_managed_to_native_System_Object___icall_wrapper_mono_array_new_specific_int
ptr_int + 100
20150624
15:44:13.061 CustomerXPSCiOS[1672:543101] critical: 13 CustomerXPSCiOS
0x007768e0 System_IO_MemoryStream_ToArray + 100
20150624
15:44:13.061 CustomerXPSCiOS[1672:543101] critical: 14 CustomerXPSCiOS
0x00a608b4 Mono_Security_Protocol_Tls_TlsStream_ToArray + 44
20150624
15:44:13.061 CustomerXPSCiOS[1672:543101] critical: 15 CustomerXPSCiOS
0x00a49c90
Mono_Security_Protocol_Tls_Handshake_Client_TlsServerFinished_ProcessAsTls1 + 128
20150624
15:44:13.061 CustomerXPSCiOS[1672:543101] critical: 16 CustomerXPSCiOS
0x00a4d64c Mono_Security_Protocol_Tls_Handshake_HandshakeMessage_Process + 88
20150624
15:44:13.062 CustomerXPSCiOS[1672:543101] critical: 17 CustomerXPSCiOS
0x00a50498
Mono_Security_Protocol_Tls_ClientRecordProtocol_ProcessHandshakeMessage_Mono_Securi
ty_Protocol_Tls_TlsStream + 164
20150624
15:44:13.062 CustomerXPSCiOS[1672:543101] critical: 18 CustomerXPSCiOS
0x00a53a98
Mono_Security_Protocol_Tls_RecordProtocol_InternalReceiveRecordCallback_System_IAsy
ncResult + 724
20150624
15:44:13.062 CustomerXPSCiOS[1672:543101] critical: 19 CustomerXPSCiOS
0x0095dc7c
wrapper_runtime_invoke_System_Object_runtime_invoke_dynamic_intptr_intptr_intptr_in
tptr + 256
Xamarin Build Issues, 6/29/2015
20150624
15:44:13.062 CustomerXPSCiOS[1672:543101] critical: 20 CustomerXPSCiOS
0x02de4c95 mono_jit_runtime_invoke + 1236
20150624
15:44:13.063 CustomerXPSCiOS[1672:543101] critical: 21 CustomerXPSCiOS
0x02e34871 mono_runtime_invoke + 88
20150624
15:44:13.063 CustomerXPSCiOS[1672:543101] critical: 22 CustomerXPSCiOS
0x02e3786b mono_runtime_delegate_invoke + 62
20150624
15:44:13.063 CustomerXPSCiOS[1672:543101] critical: 23 CustomerXPSCiOS
0x02e39e47 mono_async_result_invoke + 162
20150624
15:44:13.063 CustomerXPSCiOS[1672:543101] critical: 24 CustomerXPSCiOS
0x02e550e1 async_invoke_thread + 1316
20150624
15:44:13.064 CustomerXPSCiOS[1672:543101] critical: 25 CustomerXPSCiOS
0x02e5ba93 start_wrapper + 298
20150624
15:44:13.064 CustomerXPSCiOS[1672:543101] critical: 26 CustomerXPSCiOS
0x02e915c5 inner_start_thread + 148
20150624
15:44:13.064 CustomerXPSCiOS[1672:543101] critical: 27
libsystem_pthread.dylib 0x3462ae23 <redacted> + 138
20150624
15:44:13.064 CustomerXPSCiOS[1672:543101] critical: 28
libsystem_pthread.dylib 0x3462ad97 _pthread_start + 118
20150624
15:44:13.064 CustomerXPSCiOS[1672:543101] critical: 29
libsystem_pthread.dylib 0x34628b20 thread_start + 8
20150624
15:44:13.065 CustomerXPSCiOS[1672:543101] critical:
=================================================================
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 Rodrigo Kumpera 2015-06-30 16:09:37 UTC
Hey David,

Any instruction on how to reproduce this? This report is a bit scary but not actionable. :(

Hey Rolf,

Few issues here:

https://github.com/xamarin/maccore/blob/360c71db9bd5034da8bf21476a065cb921a290d2/src/Foundation/NSObject.iOS.cs

That object is not marked with StructLayout(LayoutKind.Sequential

Which means the runtime will be free to reorganize the layout and the trick to expose the layout in native won't work.

Another thing, since runtime.m is now ObjC++ object layout now obeys the C++ rules, there's no guarantee they will match the C one without properly marking them as been C.

Hey Mark,

Could it be that we're passing tagged pointers to the callback?
Comment 2 Mark Probst 2015-06-30 19:07:18 UTC
I think you meant to ask Rolf.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-07-01 11:36:35 UTC
@David, that's a known issue we're working on.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-07-01 11:51:51 UTC
@David, but the crash report you showed is not related to the stack trace from the initial description (did the customer upgrade to a newer version of XI/master?)
Comment 7 Rodrigo Kumpera 2015-07-01 12:32:31 UTC
The second crash log points to a sgen segfault.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-08-03 08:08:15 UTC
(In reply to comment #1)
Hey Rodrigo,

> 
> Hey Rolf,
> 
> Few issues here:
> 
> https://github.com/xamarin/maccore/blob/360c71db9bd5034da8bf21476a065cb921a290d2/src/Foundation/NSObject.iOS.cs
> 
> That object is not marked with StructLayout(LayoutKind.Sequential
> 
> Which means the runtime will be free to reorganize the layout and the trick to
> expose the layout in native won't work.

Fixed: https://github.com/xamarin/maccore/commit/d9d8f1dfdc4f350e39b3bdd491e4a6cff083e7cd

> 
> Another thing, since runtime.m is now ObjC++ object layout now obeys the C++
> rules, there's no guarantee they will match the C one without properly marking
> them as been C.

Actually yes, the structures declared in runtime.m are POD structures, and guaranteed to have the same layout in C++ and C (http://stackoverflow.com/a/7189821/183422).

Additionally I believe this bug is a dup of bug #32344, so I'm closing it.

*** This bug has been marked as a duplicate of bug 32344 ***