Bug 29194 - Displaying an NSPrintPanel results in a SIGSEGV
Summary: Displaying an NSPrintPanel results in a SIGSEGV
Status: RESOLVED INVALID
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-04-17 10:06 UTC by Kevin Mullins
Modified: 2015-04-17 10:37 UTC (History)
1 user (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 INVALID

Description Kevin Mullins 2015-04-17 10:06:31 UTC
In Xamarin.Mac Version: 2.0.0.258 (Business Edition) using the following code now results in a SIGSEGV error:

var dlg = new NSPrintPanel();
if (dlg.RunModal () == 1) {
   ...
}

This code ran correctly in the previous release. Here is the application output:

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) ObjCRuntime.Messaging.nint_objc_msgSend (intptr,intptr) <IL 0x00012, 0xffffffff>
  at AppKit.NSPrintPanel.RunModal () [0x0001d] in /Users/builder/data/lanes/1503/c2c00129/source/maccore/src/build/mac/mobile/AppKit/NSPrintPanel.g.cs:174
  at MacWindows.MainWindow.ShowDocument (Foundation.NSObject) [0x00032] in /Users/kmullins/Projects/MacWindows/MacWindows/MainWindow.cs:102
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00062, 0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain (int,string[]) <IL 0x00093, 0xffffffff>
  at AppKit.NSApplication.Main (string[]) [0x00041] in /Users/builder/data/lanes/1503/c2c00129/source/maccore/src/AppKit/NSApplication.cs:94
  at MacWindows.MainClass.Main (string[]) [0x00007] in /Users/kmullins/Projects/MacWindows/MacWindows/Main.cs:12
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>

Native stacktrace:


Debug info from gdb:

Attaching to process 28276.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ...................................................warning: Could not find object file "/BinaryCache/corecrypto/corecrypto-233.1.2~26/Symbols/BuiltProducts/libcorecrypto_static.a(AES.o)" - no debug information available for "AES.s".

warning: Could not find object file "/BinaryCache/corecrypto/corecrypto-233.1.2~26/Symbols/BuiltProducts/libcorecrypto_static.a(FIPSPOST.o)" - no debug information available for "FIPSPOST.c".

...

..........bfd_mach_o_scan_read_symtab_symbol: symbol "_bzero" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memccpy" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memchr" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memcmp" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memcpy" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memmove" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_memset" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_strchr" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_strcmp" is unsupported 'indirect' reference: setting to undefined
bfd_mach_o_scan_read_symtab_symbol: symbol "_strncmp" is unsupported 'indirect' reference: setting to undefined
...warning: Could not find object file "/BinaryCache/coreTLS/coreTLS-35.20.2~10/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o" - no debug information available for "system_coretls_vers.c".

warning: Could not find object file "/BinaryCache/coreTLS/coreTLS-35.20.2~10/Symbols/BuiltProducts/libcoretls_ciphersuites.a(tls_ciphersuites.o)" - no debug information available for "tls_ciphersuites.c".

...

....................................................................................warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCObjects.o" - no debug information available for "XPCObjects.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCProxy.o" - no debug information available for "XPCProxy.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCCoder.o" - no debug information available for "XPCCoder.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCSafeDecoding.o" - no debug information available for "XPCSafeDecoding.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCListener.o" - no debug information available for "XPCListener.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCEndpoint.o" - no debug information available for "XPCEndpoint.m".

warning: Could not find object file "/BinaryCache/XPCObjects/XPCObjects-103~1438/Objects/XPCObjects.build/XPCObjects.build/Objects-normal/x86_64/XPCMachSendRight.o" - no debug information available for "XPCMachSendRight.m".

.................................................................WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
............ done
0x00007fff8a07f902 in __wait4 ()
  13 0x00007fff8a07a4de in mach_msg_trap ()
  12 0x00007fff8a07f94a in __workq_kernreturn ()
  11 0x00007fff8a07f94a in __workq_kernreturn ()
  10 0x00007fff8a07f94a in __workq_kernreturn ()
   9 0x00007fff8a07f94a in __workq_kernreturn ()
   8 0x00007fff8a07f94a in __workq_kernreturn ()
   7 0x00007fff8a07f94a in __workq_kernreturn ()
   6 0x00007fff8a07f94a in __workq_kernreturn ()
   5 0x00007fff8a07f33a in recvfrom ()
   4 0x00007fff8a07a51a in semaphore_wait_trap ()
   3 0x00007fff8a07f94a in __workq_kernreturn ()
   2 0x00007fff8a080232 in kevent64 ()
*  1 0x00007fff8a07f902 in __wait4 ()

Thread 13 (process 28276):
#0  0x00007fff8a07a4de in mach_msg_trap ()
#1  0x00007fff8a07964f in mach_msg ()
#2  0x00007fff953c4eb4 in __CFRunLoopServiceMachPort ()
#3  0x00007fff953c437b in __CFRunLoopRun ()
#4  0x00007fff953c3bd8 in CFRunLoopRunSpecific ()
#5  0x00007fff93bc366b in _NSEventThread ()
#6  0x00007fff8a005268 in _pthread_body ()
#7  0x00007fff8a0051e5 in _pthread_start ()
#8  0x00007fff8a00341d in thread_start ()

Thread 12 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 11 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 10 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 9 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 8 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 7 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 6 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 5 (process 28276):
#0  0x00007fff8a07f33a in recvfrom ()
#1  0x00000001000519a1 in socket_transport_recv (buf=0x104803e65, len=11) at ../../../../../mono/mono/mini/debugger-agent.c:1144
#2  0x000000010003f8a3 in debugger_thread (arg=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/mini/debugger-agent.c:1527
#3  0x000000010024943e in inner_start_thread (arg=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/utils/mono-threads-posix.c:92
#4  0x00007fff8a005268 in _pthread_body ()
#5  0x00007fff8a0051e5 in _pthread_start ()
#6  0x00007fff8a00341d in thread_start ()

Thread 4 (process 28276):
#0  0x00007fff8a07a51a in semaphore_wait_trap ()
#1  0x0000000100248967 in mono_sem_wait (sem=0x10035de08, alertable=1) at ../../../../../mono/mono/utils/mono-semaphore.c:103
#2  0x000000010014b9e2 in finalizer_thread (unused=0x2403) at ../../../../../mono/mono/metadata/gc.c:1074
#3  0x0000000100211d8b in start_wrapper (data=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/metadata/threads.c:664
#4  0x000000010024943e in inner_start_thread (arg=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/utils/mono-threads-posix.c:92
#5  0x00007fff8a005268 in _pthread_body ()
#6  0x00007fff8a0051e5 in _pthread_start ()
#7  0x00007fff8a00341d in thread_start ()

Thread 3 (process 28276):
#0  0x00007fff8a07f94a in __workq_kernreturn ()
#1  0x00007fff8a0056c3 in _pthread_wqthread ()
#2  0x00007fff8a00340d in start_wqthread ()

Thread 2 (process 28276):
#0  0x00007fff8a080232 in kevent64 ()
#1  0x00007fff956efd91 in _dispatch_mgr_invoke ()
#2  0x00007fff956efa6a in _dispatch_mgr_thread ()

Thread 1 (process 28276):
#0  0x00007fff8a07f902 in __wait4 ()
#1  0x00000001000ec791 in mono_handle_native_sigsegv (signal=<value temporarily unavailable, due to optimizations>, ctx=0x1021b715c, info=0x0) at ../../../../../mono/mono/mini/mini-exceptions.c:2347
#2  0x0000000100061c6a in mono_arch_handle_altstack_exception (sigctx=0x1021b7f48, siginfo=<value temporarily unavailable, due to optimizations>, fault_addr=0x0, stack_ovf=0) at ../../../../../mono/mono/mini/exceptions-amd64.c:851
#3  0x0000000100100154 in mono_sigsegv_signal_handler (_dummy=<value temporarily unavailable, due to optimizations>, _info=<value temporarily unavailable, due to optimizations>, context=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/mini/mini.c:6796
#4  <signal handler called>
#5  0x00007fff8945e1f5 in PJCSessionHasApplicationSetPrinter ()
#6  0x000000011012e48a in CreateDefaultFileName ()
#7  0x00007fff93c36947 in -[NSWindowController _windowDidLoad] ()
#8  0x00007fff93c1ec73 in -[NSWindowController window] ()
#9  0x00007fff940ea48f in -[NSPrintPanel runModalWithPrintInfo:] ()
#10 0x000000010fef3529 in ?? ()
#11 0x0000000100102719 in mono_jit_runtime_invoke (method=<value temporarily unavailable, due to optimizations>, obj=<value temporarily unavailable, due to optimizations>, params=0x7fff5fbfe260, exc=0x7fff9441bb88) at ../../../../../mono/mono/mini/mini.c:6669
#12 0x00000001001a0d7e in mono_runtime_invoke (method=0x10298d730, obj=0x109b1f5c0, params=0x7fff5fbfe260, exc=0x0) at ../../../../../mono/mono/metadata/object.c:2862
#13 0x00000001000088b5 in xamarin_invoke_trampoline (type=Tramp_Default, self=0x100639bc0, sel=0x610000005e50, iterator=0x100009080 <param_iter_next>, marshal_return_value=0x100009320 <marshal_return_value>, context=0x7fff5fbfe6c8) at trampolines-invoke.m:355
#14 0x0000000100009071 in xamarin_arch_trampoline (state=0x7fff5fbfe710) at trampolines-x86_64.m:540
#15 0x000000010000a53a in xamarin_x86_64_common_trampoline () at trampolines-x86_64-asm.s:54
#16 0x00007fff93dda1b1 in -[NSToolbarButton sendAction:to:] ()
#17 0x00007fff93ccaf5a in -[NSToolbarItemViewer mouseDown:] ()
#18 0x00007fff9423b2fc in -[NSWindow _reallySendEvent:isDelayedEvent:] ()
#19 0x00007fff93bcad76 in -[NSWindow sendEvent:] ()
#20 0x00007fff93bc7312 in -[NSApplication sendEvent:] ()
#21 0x00007fff93af0c68 in -[NSApplication run] ()
#22 0x00007fff93a6d354 in NSApplicationMain ()
#23 0x0000000106ed8da1 in ?? ()
#24 0x0000000106ed8a95 in ?? ()
#25 0x0000000100102719 in mono_jit_runtime_invoke (method=<value temporarily unavailable, due to optimizations>, obj=<value temporarily unavailable, due to optimizations>, params=0x7fff5fbff678, exc=0x7fff5fbff1f0) at ../../../../../mono/mono/mini/mini.c:6669
#26 0x00000001001a0d7e in mono_runtime_invoke (method=0x102200b80, obj=0x0, params=0x7fff5fbff678, exc=0x0) at ../../../../../mono/mono/metadata/object.c:2862
#27 0x00000001001a6588 in mono_runtime_exec_main (method=0x102200b80, args=<value temporarily unavailable, due to optimizations>, exc=0x0) at ../../../../../mono/mono/metadata/object.c:4119
#28 0x000000010005b877 in mono_main (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at ../../../../../mono/mono/mini/driver.g.c:1070
#29 0x000000010000a900 in main (argc=1, argv=0x7fff5fbff8a0) at launcher.m:539

=================================================================
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 Chris Hamons 2015-04-17 10:15:45 UTC
The same code is crashing in Xcode:

    NSPrintPanel * p = [[NSPrintPanel alloc] init];
    [p runModal];

with the same stack trace?
Comment 2 Chris Hamons 2015-04-17 10:37:02 UTC
Same code crashes terribly in xcode. Please reopen if you have an example that works in Xcode.