Handle Exceptions from CF built under Cygwin

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Afreet
Posts: 4
Joined: Mon Mar 19, 2007 9:54 am
Contact:

Handle Exceptions from CF built under Cygwin

Post by Afreet »

I built ContextFree under Cygwin so that I could have a CLI version, and script the invocation (see my feature request post re parameterized animations)

Most of the time, it hums along quite happily, but sometimes, I get the following error:

Code: Select all

      5 [main] cfdg 500 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
  28319 [main] cfdg 500 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
and it usually fails to generate the frame at this point, and either doesn't create an ouput file at all, or creates a 0 size output PNG. This seems to happen maybe a couple times per hundred frames.

Has anyone else run into this? Any ideas what might be happening?

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

I've never seen that, and we develop under Cygwin. Can you post the cfdg file and the command line?

Afreet
Posts: 4
Joined: Mon Mar 19, 2007 9:54 am
Contact:

Post by Afreet »

I'm invoking from a perl script. The line is:

Code: Select all

	print `$cfdg_exe -w 720 -h 480 wings.temp.cfdg wings_$frame_index.png &2>1`;
where $cfdg_exe is the path to cfdg.exe that I build, and $frame_index is just an incrementing number in the loop, so that the output frames are all numbered so they work when I pull them into After Effects.

the cfdg file looks like this:

Code: Select all

startshape START 
background {hue 0 sat 1.0 b -1.0}

rule START {
	WING { b 1.0 r 45}
	WING { b 1.0 flip 90 r -45 x 20 }
}

rule WING {
	LINE { r 80 }
	WING { s .93 y 6 r _ROTATION_}
}

rule LINE {
	FEATHER { r 45}
	FEATHER { r -45 }
	LINE { s .94 y 1 r 1}
}

rule FEATHER {
	SQUARE [ s .4 2 r 45 ]
	SQUARE [ r 45 s .1 10 r 45 x .45 y .45 ]
	SQUARE [ r -45 s .1 10 r 45 x .45 y .45 ]
	FEATHER { s .98 y 1 b -.02} 
}
where that "_ROTATION_" in the WING rule gets changed on each iteration through the loop, and written out to wings.temp.cfdg file before cfdg.exe gets called.

Right now, I have it starting at -180, and incrementing by 0.1 each time. Due to the way that floating point numbers work, though, it eventually becomes a number like 56.0999999999946 instead of 56.1. I wouldn't think CF would have a problem with that, but my next step (after this finishes rendering) is to change my perl script so it rounds after each calulation, and see if that makes any difference.

Afreet
Posts: 4
Joined: Mon Mar 19, 2007 9:54 am
Contact:

Post by Afreet »

Also, I forgot to mention that the numbers in that error message are not the same each time.

For instance,

6 [main] cfdg 3440 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
17723 [main] cfdg 3440 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)

and then,

4 [main] cfdg 2848 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
17824 [main] cfdg 2848 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)

etc.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Does it fail at different frames on each run even if the cfdg files are the same from run to run?

Post Reply