GerbV: Crashing GerbV

We occasionally receive support tickets where the site is returning an ‘internal error’ message or continuing to process forever, and in a couple of cases that’s been due to one of a couple possible issues in the gerbers that causes GerbV to crash.

Change between LPC and LPD on Inverted Internal Planes

%LPD*% (Layer Polarity Dark) and %LPC*% (Layer Polarity Clear) are commands added to Extended Gerber RS-274X files that are used with IP (Image Polarity) to easily build up ground planes.

The problem happens when you call one but never explicitly call the other to return the file to normal.

Defining a Macro as a Giant List of Points

Defining a macro as a giant list of points when GerbV expects a smaller macro will cause a buffer overflow. The way to check for this one is to open the gerber layer in a text editor and see if the phrase ADD MACRO exists.

Forgotten Commas

If you call %ADDC17C,0.12% and you forget the comma, GerbV will crash. Go back and add the comma.

Doubling up Start and End Commands

Sometimes, the CAD package will generate bad polygons by doubling up the start and end commands. That’s not allowed in the gerber specs, so the fis is to go through and replace all instances of :

G36*
G36*
(coordinate data)
G37*
G37*

with the correct formatting,

G36*
(coordinate data)
G37*