We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › EXC_BAD_ACCESS (SIGBUS)
Page Index Toggle Pages: 1
EXC_BAD_ACCESS (SIGBUS) (Read 1418 times)
EXC_BAD_ACCESS (SIGBUS)
Dec 22nd, 2008, 9:47am
 
Hi there,

I am on 10.5.5 and the application I wrote seems to crash fairly often with EXC_BAD_ACCESS (SIGBUS)

I took two screenshots and uploaded them here
http://communitymetrics.net/errors/

Can anybody help me identify what is going on?

Thanks
Christian
Re: EXC_BAD_ACCESS (SIGBUS)
Reply #1 - Dec 23rd, 2008, 4:12pm
 
10.5.5? There is no Processing version like that (not yet!).
I suppose, and your screenshots confirm, that's a version of MacOS. (Well, the first screenshot tells it is 10.5.6 actually).

Beside, we lack a bit of information. What kind of application do you write? Pure graphics? Do it uses some library? Particularly an hardware library?

Such kind of low level system error is rare in Java, perhaps it is an issue with your version of Java (I know it is problematic on MacOS) or an interface to system (JNA/JNI) or something else.
Re: EXC_BAD_ACCESS (SIGBUS)
Reply #2 - Dec 23rd, 2008, 5:14pm
 
Hi PhiLho,

Yes my apologies if I was being vague.

I am using Processing 1.0.1 The software is written on OSX 10.5.5 but running on a remote machine with 10.5.6

I am using just the default graphics engine with just one external library the megamu.shapetween

the only unusual thing the software does is a lot of

requestImage(filename);

and a lot of

Runtime.gc();


Could running out of memory for the Java virtual engine crash it?

Thanks for any thoughts you might have

christian
Re: EXC_BAD_ACCESS (SIGBUS)
Reply #3 - Dec 24th, 2008, 9:41am
 
OK, indeed, it could be an out of memory error then. Something quite frequent in Processing, from what I see in the forum. Actually, I was just bitten by this one recently: I was doing a createGraphics() in the draw() routine, thinking of it as a way to "clear" the buffer, letting the GC taking care of the garbage... But maybe the frame rate is too high for the GC default settings...
I solved my problem by using background(), recycling the buffer!

There is at least another thread reporting issues with repeated requestImage calls. I suppose the problem is similar. If you cycle the images, it might be more efficient to use an array(list) (or hashmap) to store them once they are loaded, and re-use them instead of loading them repeatedly. Plus it is more efficient. Of course, if you are loading gigabytes of images, it might be problematic too. One can also use a queue (discarding older images).
Or change completely the strategy...
For example, if you display an animation out of a bunch of image files, maybe you can concatenate them (all or by groups of n)(can be done with ImageMagick or even Processing!): you load a group and display the images one by one, using image().
It depends on your goal.
Page Index Toggle Pages: 1