Bug 3273 - Segmentation Fault: 11 with [Export("windowWillUseStandardFrame:defaultFrame:")] on Lion
Summary: Segmentation Fault: 11 with [Export("windowWillUseStandardFrame:defaultFrame:...
Status: RESOLVED ANSWERED
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-08 11:56 UTC by Frank A. Krueger
Modified: 2015-02-17 15:25 UTC (History)
3 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 ANSWERED

Description Frank A. Krueger 2012-02-08 11:56:26 UTC
This is a new bug that only manifests on Lion (Snow Leopard works fine).

If I implement the function:

[Export("windowWillUseStandardFrame:defaultFrame:")]
RectangleF WillUseStandardFrame (NSWindow window, RectangleF newFrame) ...

On my DocumentController which is acting as the NSWindow's Delegate, then Lion crashes with a Segmentation Fault: 11. That code is called when the user presses the green zoom button on the window (specifically, it's called from @selector(_setNeedsZoom:).

The code within the method doesn't seem to matter, it just always crashes. Again, it works fine on Snow Leopard.


Process:         mono [487]
Path:            /Users/USER/*/iCircuit.app/iCircuit
Identifier:      com.kruegersystems.circuitmac
Version:         1.3.2 (1.3.2)
Code Type:       X86 (Native)
Parent Process:  launchd [197]

Date/Time:       2012-02-08 08:43:58.492 -0800
OS Version:      Mac OS X 10.7.2 (11C74)
Report Version:  9

Interval Since Last Report:          1152616 sec
Crashes Since Last Report:           23
Per-App Interval Since Last Report:  3864 sec
Per-App Crashes Since Last Report:   5
Anonymous UUID:                      B92974A9-37B8-4E17-A3B2-24AAE93CD0E5

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000bfffebd8

VM Regions Near 0xbfffebd8:
    Stack                  00000000bc000000-00000000bf800000 [ 56.0M] ---/rwx SM=NUL  
--> Stack                  00000000bf800000-00000000c0000000 [ 8192K] rw-/rwx SM=COW  
    CG shared images       00000000c0003000-00000000c000b000 [   32K] r--/r-- SM=SHM  

Application Specific Information:
objc[487]: garbage collection is OFF
Performing @selector(_setNeedsZoom:) from sender _NSThemeWidget 0x7a4e670

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ???                           	0xbfffebd8 0 + 3221220312

Thread 1:
0   libsystem_kernel.dylib        	0x979f0c22 mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x979f01f6 mach_msg + 70
2   iCircuit                      	0x000d9b7a mach_exception_thread + 90 (mini-darwin.c:129)
3   iCircuit                      	0x00268168 GC_start_routine + 120 (pthread_support.c:1468)
4   libsystem_c.dylib             	0x9840eed9 _pthread_start + 335
5   libsystem_c.dylib             	0x984126de thread_start + 34

Thread 2:
0   libsystem_kernel.dylib        	0x979f0c5e semaphore_wait_trap + 10
1   iCircuit                      	0x0023d6d2 mono_sem_wait + 50 (mono-semaphore.c:115)
2   iCircuit                      	0x00123382 finalizer_thread + 114 (gc.c:1071)
3   iCircuit                      	0x001e9251 start_wrapper_internal + 641 (threads.c:784)
4   iCircuit                      	0x001e9347 start_wrapper + 23 (threads.c:832)
5   iCircuit                      	0x0022e74e thread_start_routine + 206 (wthreads.c:287)
6   iCircuit                      	0x00268168 GC_start_routine + 120 (pthread_support.c:1468)
7   libsystem_c.dylib             	0x9840eed9 _pthread_start + 335
8   libsystem_c.dylib             	0x984126de thread_start + 34

Thread 3:
0   libsystem_kernel.dylib        	0x979f2a9a __recvfrom + 10
1   libsystem_c.dylib             	0x983c34a2 recv$UNIX2003 + 54
2   iCircuit                      	0x000abc78 debugger_thread + 232 (debugger-agent.c:997)
3   iCircuit                      	0x0022e74e thread_start_routine + 206 (wthreads.c:287)
4   iCircuit                      	0x00268168 GC_start_routine + 120 (pthread_support.c:1468)
5   libsystem_c.dylib             	0x9840eed9 _pthread_start + 335
6   libsystem_c.dylib             	0x984126de thread_start + 34

Thread 4:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        	0x979f390a kevent + 10
1   libdispatch.dylib             	0x917d3c58 _dispatch_mgr_invoke + 969
2   libdispatch.dylib             	0x917d26a7 _dispatch_mgr_thread + 53

Thread 5:
0   libsystem_kernel.dylib        	0x979f302e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x98410ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x984126fe start_wqthread + 30

Thread 6:
0   libsystem_kernel.dylib        	0x979f302e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x98410ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x984126fe start_wqthread + 30

Thread 7:
0   libsystem_kernel.dylib        	0x979f302e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x98410ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x984126fe start_wqthread + 30

Thread 8:
0   libsystem_kernel.dylib        	0x979f302e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x98410ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x984126fe start_wqthread + 30

Thread 9:
0   libsystem_kernel.dylib        	0x979f2bb2 __semwait_signal + 10
1   libsystem_c.dylib             	0x983c37b9 nanosleep$UNIX2003 + 187
2   iCircuit                      	0x0022f83e SleepEx + 222 (wthreads.c:1027)
3   iCircuit                      	0x001ea7ff ves_icall_System_Threading_Thread_Sleep_internal + 63 (threads.c:1320)
4   ???                           	0x079d222e 0 + 127738414
5   ???                           	0x079d21cc 0 + 127738316
6   ???                           	0x056772f8 0 + 90665720
7   ???                           	0x0567703e 0 + 90665022
8   ???                           	0x01cf6768 0 + 30369640
9   iCircuit                      	0x0000d272 mono_jit_runtime_invoke + 722 (mini.c:5791)
10  iCircuit                      	0x001a435a mono_runtime_invoke + 170 (object.c:2755)
11  iCircuit                      	0x001a5bf7 mono_runtime_delegate_invoke + 135 (object.c:3420)
12  iCircuit                      	0x001e92a6 start_wrapper_internal + 726 (threads.c:800)
13  iCircuit                      	0x001e9347 start_wrapper + 23 (threads.c:832)
14  iCircuit                      	0x0022e74e thread_start_routine + 206 (wthreads.c:287)
15  iCircuit                      	0x00268168 GC_start_routine + 120 (pthread_support.c:1468)
16  libsystem_c.dylib             	0x9840eed9 _pthread_start + 335
17  libsystem_c.dylib             	0x984126de thread_start + 34

Thread 10:
0   libsystem_kernel.dylib        	0x979f302e __workq_kernreturn + 10
1   libsystem_c.dylib             	0x98410ccf _pthread_wqthread + 773
2   libsystem_c.dylib             	0x984126fe start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0xbfffebb8  ebx: 0x07a4d6d0  ecx: 0x916100c4  edx: 0x00000000
  edi: 0x913fc4ee  esi: 0xbfffebd8  ebp: 0x07a4e670  esp: 0xbfffeb80
   ss: 0x00000023  efl: 0x00210292  eip: 0xbfffebd8   cs: 0x0000001b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0xbfffebd8
Logical CPU: 2
Comment 1 Chris Hamons 2015-02-17 13:45:15 UTC
Frank,

Apologies in the delay in response in this bug. It was misfiled and thus overlooked.

From what I can tell in 2015, we have support for this in Xamarin.Mac via NSWindowDelegate.WillUseStandardFrame, so no explicit Exports are now needed. Since there was no repro case attached to the bug, I'm having trouble exactly figuring out what you were doing, and if it is still an issue. Please file a new bug if this is still an issue.

Sorry again about the long delay in response.
Comment 2 Frank A. Krueger 2015-02-17 15:11:31 UTC
Given that it's been 3 years and nine days since I filed this, I have no idea either.
Comment 3 Chris Hamons 2015-02-17 15:25:41 UTC
Yep. Yeah, it was unacceptably long delay in somebody looking at it. No doubt about it.

We've been going through our backlog and I've been reorganizing things to prevent a mess like this from happening again.

Apologies again.