Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Monotouch 4.2 beta
I'm working on a PDF viewer. As soon as I add a CATiledLayer for PDF rendering as a sublayer the debugger hangs.
Not adding the sublayer allows debugging. I have seen this in two projects now, total different implementations; only thing in common: CATiledLayer.
I have a sample that use CATiledLayer and I can set breakpoints and continue execution with it - but it's used a the Layer property itself (thru [Export]), not adding it as a sublayer (e.g. AddSublayer). However the debugger should not be hanging...
* I assume it works correctly when not debugging ?
* Could you provide attach a case that hangs the debugger ?
* Also what version of MonoDevelop are you using ?
This sounds very much like a bug that has already been fixed: if managed code was executed on a thread that wasn't created by managed code (a helper thread created by CATiledLayer, which then calls into managed code somehow), and then that thread subsequently exits for any reason, the debugger would deadlock at any later breakpoint (the debugger tries to wait for the thread that had exited to stop, which never happens because it doesn't exist anymore).
The fix for this will be in the upcoming 4.2 release.
I'm using Monodevelop 2.6. The problem has been there since MT 3.2.6 and MD 2.1 (?). I can see if I can get a small example but maybe easier would be to check if the problem persists in the 4.2 release. Sounds like it's going to be available soon? Or could I just give the 4.9.2 a try which should already include the fix?
Oh, and yes: it works of course when not debugging!
It is not fixed in the current 4.2 beta, but a new beta will very soon be released which will include it.
René, can you still reproduce this issue now that you have 4.2.1 installed ?
Yes, still same issue. Put a breakpoint in CALayerDelegate DrawLayer and the whole app hangs.
In my sample I can set the breakpoint on DrawLayer without issue on the device (where zooming is easier) but I found out it gets hit only a single time on the simulator (using option to simulate the zoom). Note that, in both case, the debugger never hangs on me.
Can you duplicate your issue/hang on both the simulator and devices ?
I can replicate on the simulator. The breakpoint is hit and then the app does not react anymore.
It seems to work on the device though. iOS 4.3.5
Created attachment 492 [details]
Here's part of a Apple sample (ZoomingPdfViewer) I ported to MonoTouch that shows how I used CATiledLayer. You can try to compare if anything differs from your code. If not then we'll need a test case to debug this on our side.
Only difference I see:
public static Class LayerClass ()
// instruct that we want a CATileLayer (not the default CALayer) for the Layer property
return new Class (typeof (CATiledLayer));
I add my CATiledLayer as a sub layer to an existing UIView:
René, when it hangs in the simulator, can you do this:
* Get the pid of the app (printed to the application output).
* Open a terminal, and execute:
gdb program <pid>
<output from gdb>
(gdb) thread apply all bt
<more output from gdb>
<gdb wants confirmation, say yes>
* Save all the output to a text file and attach it here
This will hopefully make it possible to track the hang down.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.
Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.