Segfaults

Hi,

I was wondering whether anyone else was having problems with this: I can pretty consistently get the simulator to segfault by using an effect that relies on rendering a group which contains a container to a snapshot so I can do some doublebuffering on the image during a transition.

It’s a lot of potential variables, usually I’d try to create a bug report and some demo code, but I wanted see whether someone could give me a hint as to where to start?

Trim it down the best that you can, but please file a bug report.

And please let me know the bug number. Thanks!

Hi,

Just a quick update: it’s proving to be a real nightmare to track down. I think my original analysis is wrong: the segfault is happening between a simple transition starting and completing, though when ever I isolate the code I get no issues! 

Can you send us the simple transition? 

I’m not sure… so far all my attempts to isolate the code have failed, so I might be barking up the wrong tree. Using a painful mixture of printline debugging and bloodymindedness I’ve narrowed it down to one particular transitions. However I’ve tried recreating an isolated version of the transition and it works fine in its own codebase.

It seems to be a probabilistic bug, and I think it’s dependent on the frame rate and more likely to happen if something intense is going on. So when I used to transition into a huge blur effect the simulator would segfault 50% - 30% of the time. Originally I just assumed that the blur effect was WIP and had issues, but removing the blur effect and going for something less ridiculous reduced the chance of the segfault happening, but didn’t eliminate it. 

Again I had a bloom effect, I think removing that had an effect too.

It seems to happen when I’m running two transitions in sync. But I can’t work out whether it’s happening during the transition or when the transition completes. 

As it’s a segfault and I can’t make any sense of the reports this is all my best guess - maybe I’m just doing something intensely stupid. I’m happy to send you the entire project if that’s helpful, or if there’s someway of using the crash reports to narrow things down I could look into that.

Also I’ve not tried it in the last week on any of the new Graphics 2 builds, so I’ll give that a go too.

We fixed several issues, so try the latest build (e.g. 2063)

I’ve transitioned to 2.0 and had some segfaults along the way. Updating to the newest builds has helped get rid of a lot (had a lot related to tableviews at first).

But I recall one segfault thrown by a touch handler that I needed to change a little code to get around, removing a reference to something in the event structure that was passed to another routine after a timer.performWithDelay… (I think it was along those lines)…

My guess was that the 2.0 engine is generally a lot quicker at releasing /deleting resources (and maybe has some autorelease bugs here or there still). On the other hand, it was some bug I never actually pinned the cause down… Changing my reference that used to work in 1.0 to something outside the system event struct (in my case) working could just be an artifact of something else entirely in 2.0, such as some other facet of how event structures, timers, or something else is handled… I’ll never really know for sure since after I tried my workaround, I had too much else to do than to try and pin down something pretty flaky/intermittent like that was (some transitions worked, others crapped out in my case - actually closing my mac simulator)…

My lesson was if a routine starts (by delay) after the system is done with some object, the object might not be there…

Trim it down the best that you can, but please file a bug report.

And please let me know the bug number. Thanks!

Hi,

Just a quick update: it’s proving to be a real nightmare to track down. I think my original analysis is wrong: the segfault is happening between a simple transition starting and completing, though when ever I isolate the code I get no issues! 

Can you send us the simple transition? 

I’m not sure… so far all my attempts to isolate the code have failed, so I might be barking up the wrong tree. Using a painful mixture of printline debugging and bloodymindedness I’ve narrowed it down to one particular transitions. However I’ve tried recreating an isolated version of the transition and it works fine in its own codebase.

It seems to be a probabilistic bug, and I think it’s dependent on the frame rate and more likely to happen if something intense is going on. So when I used to transition into a huge blur effect the simulator would segfault 50% - 30% of the time. Originally I just assumed that the blur effect was WIP and had issues, but removing the blur effect and going for something less ridiculous reduced the chance of the segfault happening, but didn’t eliminate it. 

Again I had a bloom effect, I think removing that had an effect too.

It seems to happen when I’m running two transitions in sync. But I can’t work out whether it’s happening during the transition or when the transition completes. 

As it’s a segfault and I can’t make any sense of the reports this is all my best guess - maybe I’m just doing something intensely stupid. I’m happy to send you the entire project if that’s helpful, or if there’s someway of using the crash reports to narrow things down I could look into that.

Also I’ve not tried it in the last week on any of the new Graphics 2 builds, so I’ll give that a go too.

We fixed several issues, so try the latest build (e.g. 2063)

I’ve transitioned to 2.0 and had some segfaults along the way. Updating to the newest builds has helped get rid of a lot (had a lot related to tableviews at first).

But I recall one segfault thrown by a touch handler that I needed to change a little code to get around, removing a reference to something in the event structure that was passed to another routine after a timer.performWithDelay… (I think it was along those lines)…

My guess was that the 2.0 engine is generally a lot quicker at releasing /deleting resources (and maybe has some autorelease bugs here or there still). On the other hand, it was some bug I never actually pinned the cause down… Changing my reference that used to work in 1.0 to something outside the system event struct (in my case) working could just be an artifact of something else entirely in 2.0, such as some other facet of how event structures, timers, or something else is handled… I’ll never really know for sure since after I tried my workaround, I had too much else to do than to try and pin down something pretty flaky/intermittent like that was (some transitions worked, others crapped out in my case - actually closing my mac simulator)…

My lesson was if a routine starts (by delay) after the system is done with some object, the object might not be there…