[MonoTouch] SDK 5 issue
Jeff Stedfast
jeff at xamarin.com
Wed Oct 19 12:20:20 EDT 2011
Sergio,
The same GC is used in both MonoTouch 4.2 and MonoTouch 5.0... in
fact, the only difference between the 2 MonoTouch versions that I know
of is the new bindings for the iOS5 APIs.
As to why it is crashing on MonoTouch 5.0 but not 4.2? Perhaps it is a
side-effect of something else changing causing the GC to run earlier
than it did before? I don't know :-(
I've tried modifying your program to keep a reference to all of the
operations, buttons, and "pages" in managed lists and it's still
crashing (usually after the first button click as you noted).
The crash seems to be due to a bad memory access by the GC which I am
trying to track down (but I suspect I'll need to enlist the help of a
runtime hacker).
Jeff
On Wed, Oct 19, 2011 at 12:03 PM, Sergio Fadda
<sergio.fadda at logobject.ch> wrote:
> Oh, I've just added a simpler test-case in bugzilla... it is not necessary
> that background operation does anything... that is, the 'Main' method of
> NSOperation can be empty!
>
> The strange thing is that, compiled with SDK 5.0, the application works
> under iOS 4.3 but not under iOS 5.0! I mean: I understand that the new GC is
> more aggressive, but the execution of the same application differs from one
> OS to the other!!
>
> However, I've tried to create the same application in pure Objective-C (I
> even thought that was a iOS bug), but it works! Only a thing it is different
> from the managed application: to simplify the implementation I've used
> NSInvocationOperation instead of NSOperation.
>
> In any case, thank you for the support!
>
> Sergio
>
> Il 19/10/2011 17:51, Jeff Stedfast ha scritto:
>
> On Wed, Oct 19, 2011 at 3:22 AM, Sergio Fadda <sergio.fadda at logobject.ch>
> wrote:
>
> Hi Jeff,
>
> thanks for the reply.
>
> Unfortunately the issue is present even if I click the button once; I said
> "variable number of times" because sometimes it is needed one click, and
> sometimes more clicks to replicate the issue.
>
> Ah! I'm sorry, I had misunderstood...
>
> However, doesn't NSOperationQueue mantain a... queue? If so, every instance
> of NSOperation should be referenced during the execution and removed from
> the queue only when the operation finish... I guess!
>
> Yes, it does... but the problem is the it's the ObjectiveC code that
> holds a pointer to C# memory but the GC doesn't know that ObjectiveC
> is still using it, so it frees it.
>
> This is a source of a lot of confusion among MonoTouch users and one
> of our top runtime guys is working on figuring out a way to make this
> work more seamlessly.
>
> Anyway, I tried to maintain my own NSOperation list that I populate before
> adding the operation to the NSOperationQueue and the issue is still there!
>
> Okay, then it sounds like my original guess is wrong :-(
>
> I've created a new project and added your code to see if I can figure
> out what the real issue is, so far it has proven difficult.
>
> Jeff
>
>
> --
> ________________________________
>
> Ai sensi del Codice in materia di protezione dei dati personali (d.L.vo
> 196/03 e successive modifiche ed integrazioni), il contenuto di questa email
> e degli eventuali allegati sono riservati e ad uso esclusivo del
> destinatario. Chiunque riceva questo messaggio per errore è pregato di
> distruggerlo e di contattare il mittente. Si informa inoltre che la risposta
> alla presente compresi eventuali allegati potrebbero essere visionati, ai
> fini del disbrigo delle competenze lavorative, anche da altro personale
> addetto.
>
> This email and any files transmitted with it are confidential and solely for
> the use of the intended recipient. If you have received this email in error,
> please notify us immediately by email and permanently delete the email
> without reading, copying or disclosing its contents to any other person.
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
More information about the MonoTouch
mailing list