Bug 22978 - SIGSEV working with MonoTouch.CoreGraphics.CGPDFDocument.CGPDFDocumentRetain
Summary: SIGSEV working with MonoTouch.CoreGraphics.CGPDFDocument.CGPDFDocumentRetain
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.4.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-14 10:34 UTC by Neal
Modified: 2014-09-15 09:07 UTC (History)
2 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 NOT_ON_ROADMAP

Description Neal 2014-09-14 10:34:35 UTC
Hello,

I'm sorry but I don't have a sample app at this time to show this issue but maybe the error will help determine if this is a MonoTouch bug needing attention.  We take a PDF file from the bundle and interact with it to present data in a spreadsheet type format.  90% of the time it works fine, however, sometimes when accessing the PDF such as a new debug session in the Sim, I get a SIGSEV error as outlined below.  In addition, while I don't have the messages handy there is also intermittent reporting of Obsolete PDF interaction functionality showing in MT stack traces that may need to be updated.  Our min iOS right now is 7.1 for this project, working in all stables as of today.  One of the obsolete methods is GetMediaBox(1) and I can't recall the other, in case that helps point you in the right direction.

Thank you

---

Error message shows as:

2014-09-14 10:26:04.658 apdl[13834:70b] 09/14/2014 14:26:04	LogbookDetailViewController ms: 426
mono-rt: Stacktrace:


mono-rt:   at <unknown> <0xffffffff>

mono-rt:   at (wrapper managed-to-native) MonoTouch.CoreGraphics.CGPDFDocument.CGPDFDocumentRetain (intptr) <IL 0x00025, 0xffffffff>

mono-rt:   at MonoTouch.CoreGraphics.CGPDFDocument..ctor (intptr) [0x0000d] in /Developer/MonoTouch/Source/maccore/src/CoreGraphics/CGPDFDocument.cs:72

mono-rt:   at MonoTouch.CoreGraphics.CGPDFPage.get_Document () [0x00000] in /Developer/MonoTouch/Source/maccore/src/CoreGraphics/CGPDFPage-2.cs:61

mono-rt:   at apdl.LogbookPageViewController/LogbookView.Draw (System.Drawing.RectangleF) [0x0000e] in /Users/Neal/Dev/ncsoftware/apdlCustomContainerModel/apdl/DataViews/LogbookView/LogbookPageViewController.cs:517

mono-rt:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___RectangleF (object,intptr,intptr,intptr) <IL 0x0005c, 0xffffffff>

mono-rt:   at <unknown> <0xffffffff>

mono-rt:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000a6, 0xffffffff>

mono-rt:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:39

mono-rt:   at apdl.Application.Main (string[]) [0x00008] in /Users/Neal/Dev/ncsoftware/apdlCustomContainerModel/apdl/Application.cs:16

mono-rt:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

mono-rt: 
Native stacktrace:


mono-rt: 
=================================================================
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.
=================================================================

The method where this appears to start as a problem is:

            public override void Draw(RectangleF rect)
            {
                base.Draw(rect);

                //Console.WriteLine("LogbookView Draw called (Check to make sure we have a real need)");

                RectangleF mediaRect = page.Document.GetMediaBox(1);

                float Scale = rect.Width / mediaRect.Width;
                CGContext context = UIGraphics.GetCurrentContext();
                // First fill the background with white.
                //context.SetFillColor(1.0f,1.0f,1.0f,1.0f);
                //context.FillRect(rect);

                context.SaveState();
                // Flip the context so that the PDF page is rendered right side up.
                context.TranslateCTM(0.0f, mediaRect.Height * Scale);
                context.ScaleCTM(1.0f, -1.0f);

                // Scale the context so that the PDF page is rendered at the correct size for the zoom level.
                context.ScaleCTM(Scale, Scale);    
                context.DrawPDFPage(page);
                context.RestoreState();
            }
Comment 1 Prashant manu 2014-09-15 02:29:58 UTC
Could you please provide us the exact test steps you followed. Also now, if you have a sample app that demonstrates this behavior please attach it to bug.

Can you please add the logs from the following places as well?:
On XS IDE Log  Location: XS>Help> Open Log Directory> IDE.log file (with latest
timestamp)
Comment 2 Neal 2014-09-15 09:07:05 UTC
I'll report back another time, thx