pcb

Crash loading layout: original_poly: Assertion `poly_Valid (np)' failed

Bug #722785 reported by Colin D Bennett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Invalid
Undecided
Unassigned

Bug Description

When loading a particular pcb layout I recently created, current pcb git HEAD crashes with an assertion failure. The pcb+gl branch crashes in a different way.

The error message displayed when pcb crashes is:
pcb: polygon.c:320: original_poly: Assertion `poly_Valid (np)' failed.

The full output of pcb and the backtrace from gdb is:

$ gdb --args ./pcb ~/Projects/Play\ Kitchen/Refrigerator/Distributor/Layout/Board.pcb
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/cdb/Code/pcb/work-head/src/pcb...done.
(gdb) run
Starting program: /home/cdb/Code/pcb/work-head/src/pcb /home/cdb/Projects/Play\ Kitchen/Refrigerator/Distributor/Layout/Board.pcb
[Thread debugging using libthread_db enabled]
Line [90189 285028 88057 284789 100 100 ""]
Line [88057 284789 86478 284094 100 100 ""]
Line [86478 284094 85502 283004 100 100 ""]
Line [85502 283004 85176 281555 100 100 ""]
Line [85176 281555 85523 280101 100 100 ""]
Line [85523 280101 86500 279016 100 100 ""]
Line [86500 279016 88062 278322 100 100 ""]
Line [88062 278322 90189 278083 100 100 ""]
Line [90189 278083 92338 278311 100 100 ""]
Line [92338 278311 93922 278994 100 100 ""]
Line [93922 278994 94898 280096 100 100 ""]
Line [94898 280096 95224 281555 100 100 ""]
Line [95224 281555 93444 281555 100 100 ""]
Line [93444 281555 93206 280904 100 100 ""]
Line [93206 280904 92554 280471 100 100 ""]
Line [92554 280471 91535 280253 100 100 ""]
Line [91535 280253 90189 280187 100 100 ""]
Line [90189 280187 88887 280253 100 100 ""]
Line [88887 280253 87867 280471 100 100 ""]
Line [87867 280471 87194 280904 100 100 ""]
Line [87194 280904 86956 281555 100 100 ""]
Line [86956 281555 87194 282207 100 100 ""]
Line [87194 282207 87867 282618 100 100 ""]
Line [87867 282618 88887 282836 100 100 ""]
Line [88887 282836 90189 282901 100 100 ""]
Line [90189 282901 91535 282836 100 100 ""]
Line [91535 282836 92554 282618 100 100 ""]
Line [92554 282618 93206 282207 100 100 ""]
Line [93206 282207 93444 281555 100 100 ""]
Line [93444 281555 95224 281555 100 100 ""]
Line [95224 281555 94898 283004 100 100 ""]
Line [94898 283004 93922 284094 100 100 ""]
Line [93922 284094 92338 284789 100 100 ""]
Line [92338 284789 90189 285028 100 100 ""]
pcb: polygon.c:320: original_poly: Assertion `poly_Valid (np)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff38fca75 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007ffff38fca75 in raise () from /lib/libc.so.6
#1 0x00007ffff39005c0 in abort () from /lib/libc.so.6
#2 0x00007ffff38f5941 in __assert_fail () from /lib/libc.so.6
#3 0x000000000047bbf7 in original_poly (p=0x89fd90) at polygon.c:320
#4 0x000000000047eb5d in InitClip (Data=0x84a9b0, layer=0x84aeb0, p=0x89fd90) at polygon.c:1220
#5 0x0000000000479ca3 in yyparse () at parse_y.y:191
#6 0x0000000000477760 in Parse (Executable=0x82a210 "nameonpcb,uniquename,clearnew,snappin", Path=<value optimized out>,
    Filename=0x7fffffffe528 "/home/cdb/Projects/Play Kitchen/Refrigerator/Distributor/Layout/Board.pcb", Parameter=<value optimized out>) at parse_l.l:285
#7 0x000000000045aa5a in LoadPCB (Filename=0x7fffffffe528 "/home/cdb/Projects/Play Kitchen/Refrigerator/Distributor/Layout/Board.pcb") at file.c:367
#8 0x000000000046a9f5 in main (argc=2, argv=0x7fffffffe258) at main.c:1019
(gdb)

Revision history for this message
Colin D Bennett (colinb) wrote :
Revision history for this message
Colin D Bennett (colinb) wrote :

I have discovered, with Peter Clifton's help, the cause of the crash. It is due to some polygons that I have imported using Inkscape (EPS export) -> pstoedit (convert using pcbfill driver) -> pcb. Apparently there is some geometry in the polygon that pcb considers invalid. I have been able to work with it using Peter Clifton's pcb+gl branch since (as long as debug is disabled so the assertion doesn't get triggered) the files work fine, so I didn't notice the problem right away.

Peter Clifton told me, “They used a keyholing technique to make polygons with holes in them -
which PCB doesn't really like very much. It trips the assert (perhaps unreasonably).” He also said something about the error being due to “Invalid Outer PLINE failed self-intersection”.

I'm going to mark this as Invalid since it's not really pcb's fault that I imported invalid polygon data. Hopefully pstoedit gets fixed to generate valid polygons since I really like having the beautiful text and graphics on my PCB that it allows.

Changed in pcb:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.