Bug 28288 - SIGSEGV while using a MenuItem during some async network activity
Summary: SIGSEGV while using a MenuItem during some async network activity
Status: VERIFIED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: Master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-03-21 04:41 UTC by Adrian
Modified: 2015-05-07 08:06 UTC (History)
2 users (show)

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


Attachments
Repo Application (Xamarin.Mac) (18.86 KB, application/zip)
2015-03-21 04:41 UTC, Adrian
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 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:
VERIFIED FIXED

Description Adrian 2015-03-21 04:41:19 UTC
Created attachment 10438 [details]
Repo Application (Xamarin.Mac)

After upgrading to Xamarin.Mac 1.12 from 1.11, I get a strange error on using a MenuItem while having some async background network actvity. please see my sample application.

Stacktrace:

  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/1248/f2847d5f/source/xamcore/src/AppKit/NSApplication.cs:106
  at MenuTest.MainClass.Main (string[]) [0x00007] in /Users/Adrian/Desktop/MenuTest/MenuTest/Main.cs:12
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

Process 10414 stopped
* thread #1: tid = 0x421cb, 0x00007fff91e52902 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  thread #2: tid = 0x421e3, 0x00007fff91e53232 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
  thread #3: tid = 0x421e5, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #4: tid = 0x421e7, 0x00007fff91e4d51a libsystem_kernel.dylib`semaphore_wait_trap + 10
  thread #5: tid = 0x421e8, 0x00007fff91e5233a libsystem_kernel.dylib`__recvfrom + 10
  thread #6: tid = 0x421ea, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #7: tid = 0x421eb, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #8: tid = 0x421ec, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #9: tid = 0x42225, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #10: tid = 0x42226, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #11: tid = 0x42227, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #12: tid = 0x42228, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #13: tid = 0x42229, 0x00007fff91e5294a libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #14: tid = 0x42238, 0x00007fff91e52136 libsystem_kernel.dylib`__psynch_cvwait + 10
  thread #15: tid = 0x42239, 0x00007fff91e5248a libsystem_kernel.dylib`__semwait_signal + 10
  thread #16: tid = 0x4223a, 0x00007fff91e4d532 libsystem_kernel.dylib`semaphore_timedwait_trap + 10
  thread #17: tid = 0x4223f, 0x00007fff91e4d4de libsystem_kernel.dylib`mach_msg_trap + 10
  thread #18: tid = 0x42247, 0x00007fff91e523fa libsystem_kernel.dylib`__select + 10
  thread #19: tid = 0x42248, 0x00007fff91e4d532 libsystem_kernel.dylib`semaphore_timedwait_trap + 10
(lldb) thread backtrace all
* thread #1: tid = 0x421cb, 0x00007fff91e52902 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff91e52902 libsystem_kernel.dylib`__wait4 + 10
    frame #1: 0x00000001000dcda1 MenuTest`mono_handle_native_sigsegv(signal=<unavailable>, ctx=<unavailable>) + 433 at mini-exceptions.c:2323
    frame #2: 0x000000010005daf4 MenuTest`mono_arch_handle_altstack_exception(sigctx=0x0000000102565f48, fault_addr=<unavailable>, stack_ovf=0) + 84 at exceptions-amd64.c:861
    frame #3: 0x00000001000f4c1b MenuTest`mono_sigsegv_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 379 at mini.c:6858
    frame #4: 0x00007fff92311f1a libsystem_platform.dylib`_sigtramp + 26
    frame #5: 0x00007fff8864e0ea libobjc.A.dylib`objc_msgSend + 42
Comment 1 Adrian 2015-03-22 06:22:56 UTC
Repo Procedure:

- Start the App
- Wait 5 Seconds
- Press on the Menu Icon to open it
=> Will crash here


=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 6f73ee4f-f0f5-4e64-bdcf-69b668d6959f
Runtime:
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Xamarin.Android ===

Version: 4.20.0.37 (Business Edition)
Android SDK: /Users/Adrian/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.2 (API level 17)
		4.3 (API level 18)
		4.4 (API level 19)
		5.0 (API level 21)
Java SDK: /usr
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.0.2 (Business Edition)
Hash: ccfcd59
Branch: 
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Mac ===

Version: 1.12.0.15 (Business Edition)

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.10.3
Darwin MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Tue Mar 10 20:10:46 PDT 2015
    root:xnu-2782.20.44.1.1~1/RELEASE_X86_64 x86_64
Comment 2 Rajneesh Kumar 2015-03-24 14:17:34 UTC
I tried to reproduce this issue but not able to reproduce this. to reproduce this issue I have followed the steps provided in bug description.

Steps I followed:

1. Open attached test case in XS.
2. Build and run the application.
3. Wait for 5 seconds.
4. Press on the Menu Icon to open it.
5. Observed that it does't crash.

Screencast: http://www.screencast.com/t/VISPe0SgNxWO

I tried these steps many times but all were unsuccessful attempts. Could you please let me know that what steps I am missing to reproduce this issue ? That would very useful to reproduce this issue at our end.  Also if possible please attach your Ide logs here.

You can find Ide logs via Help=>Open Log directory=>Ide.logs(Choose Latest timestamp)

Thanks.

Ide Logs: https://gist.github.com/Rajneesh360Logica/3616465e64f7ce434519
Build Output: https://gist.github.com/Rajneesh360Logica/8f1edfcad524fc0ce053

Environment Info: 

=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.0.2 (Business Edition)
Hash: ccfcd59
Branch: 
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Android ===

Version: 4.20.0.37 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Adrian 2015-03-24 15:14:41 UTC
ciao rajneesh,

thanks for your effort.

I checked your screencast and you click the dock icon.
please try again using the icon in the status bar on the top (the black cloud icon). as soon as you click on that it should crash.

please make sure your computer has direct internet connection so that the http request is able to proceed (that's what happens during the 5 second pause)...

best, adrian
Comment 4 Adrian 2015-03-25 13:36:56 UTC
any news?
Comment 5 Rajneesh Kumar 2015-03-25 13:40:12 UTC
@ Adrian, Thanks a lot for the clarification of issue.

I have checked this issue again, and now I am able to reproduce this. 

Steps to reproduce:
1. Open attached test case in XS.
2. Build and run the application.
3. Wait for 5 seconds.
4. Click on icon in the status bar on the top (the black cloud icon).
5. Observed that the application goes crash.

Screencast:  http://www.screencast.com/t/5m2CVHma

Application Output: https://gist.github.com/Rajneesh360Logica/d8c615ab6f1904e5b497
Ide Logs: https://gist.github.com/Rajneesh360Logica/66550908b92eb0181e41

Environment Info:

=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.0.2 (Business Edition)
Hash: ccfcd59
Branch: 
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Android ===

Version: 4.20.0.37 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 6 Chris Hamons 2015-03-25 18:03:30 UTC
I believe this has to do with some issues with HttpClient that have been fixed recently.

If you comment out the http client stuff and just have sleeps the problem goes away.

Xamarin.Mac 2.0 (which should hit alpha in a week or two) is built against a new mono that has the fix.
Comment 7 Rajneesh Kumar 2015-05-07 08:06:11 UTC
I have checked this issue with the following builds:

Xamarin Studio Version 5.9.1 (build 2)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
Mono 4.0.1 ((detached/f802480)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400010028
Apple Developer Tools Xcode 6.2 (6776)
Build 6C131e
Xamarin.Mac Version: 2.0.1.36 (Business Edition)
=== Build Information ===
Release ID: 509010002
Git revision: 3bfa1ab29c4d59f0644c280932bdb2aa2322acff
Build date: 2015-05-06 19:50:24-04
Xamarin addins: f9e5cfcc2a63146ae9ecfe5dca6ee53246db3786
=== Operating System ===
Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

I observed that this issue does not exist. Now clicking on icon in the status bar on the top (the black cloud icon) that the application does not crash. 

Here is the screencast for the same: http://www.screencast.com/t/ARFJPCBeex

This issue has been fixes , hence I am closing this issue.

Thanks..!