[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: PCB: Polygon segfault



Hi,

While designing a board I got a segfault in PCB. I have a design with a polygon connected to GND on the component layer and among others the QFN20_4_EP footprint on it. This particular footprint has a very small clearance which I noted only after I drew the polygon on top of it. 
If I now press F2 and start to pan the board I get a segfault. I think the polygon clipping code goes a bit wrong, I see also constant flashing in the polygon area.

I attached a small patch which at least fixes the segfault for me for now. I have a testfile which gives the segfault, but I don't want to send it to the list. Attached is also the backtrace. If one of the developers needs the testfile, please let me know, I can send it off-list.

I use the CVS version of PCB from early January.

Thanks,

Hans

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912542616624 (LWP 10989)]
0x000000000045d2b4 in M_POLYAREA_intersect (e=0x7fffffb45750,
afst=0x17a5c40, bfst=0x10c03d0, add=1) at polygon1.c:848
848               if (a->contours->xmax >= b->contours->xmin &&
(gdb) bt
#0  0x000000000045d2b4 in M_POLYAREA_intersect (e=0x7fffffb45750, 
    afst=0x17a5c40, bfst=0x10c03d0, add=1) at polygon1.c:848
#1  0x000000000045f1dd in poly_AndSubtract_free (ai=Variable "ai" is not available.
) at polygon1.c:1798
#2  0x000000000045bffb in r_NoHolesPolygonDicer (p=0x1a9c1e0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1312
#3  0x000000000045c04c in r_NoHolesPolygonDicer (p=0x17a5c40, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1334
#4  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x1a5c7a0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#5  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x1a4dad0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#6  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x19ba240, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#7  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x1a4dad0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#8  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x1a6a8c0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#9  0x000000000045c014 in r_NoHolesPolygonDicer (p=0x1aa2cb0, 
    emit=0x43b380 <DrawPolygonLowLevel>) at polygon.c:1320
#10 0x000000000045c1b6 in NoHolesPolygonDicer (p=0x7471f0, 
    emit=0x43b380 <DrawPolygonLowLevel>, clip=0x7fffffb46200) at
polygon.c:1370
#11 0x000000000043bd81 in poly_callback (b=0x7471f0, cl=Variable "cl" is not available.
) at draw.c:2046
#12 0x0000000000467ccb in __r_search (node=0x7474a0, query=0x7fffffb46200, 
---Type <return> to continue, or q <return> to quit---
    arg=0x7fffffb46020) at rtree.c:540
#13 0x0000000000467d46 in r_search (rtree=Variable "rtree" is not available.
) at rtree.c:626
#14 0x0000000000439c81 in DrawLayerGroup (group=Variable "group" is not availabl
e.
) at draw.c:905
#15 0x000000000043cad0 in hid_expose_callback (hid=0x5ccb00, 
    region=0x7fffffb46200, item=Variable "item" is not available.
) at draw.c:500
#16 0x00000000004780db in ghid_invalidate_all () at hid/gtk/gtkhid-main.c:260
#17 0x00002aaaac43f3c0 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#18 0x00002aaaac44df2c in g_signal_stop_emission ()
   from /usr/lib/libgobject-2.0.so.0
#19 0x00002aaaac44f3ec in g_signal_emit_valist ()
   from /usr/lib/libgobject-2.0.so.0
#20 0x00002aaaac44f7a3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#21 0x00002aaaaaebaffc in gtk_adjustment_value_changed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#22 0x0000000000481684 in ghid_port_ranges_pan (x=748.27021883920111, y=0, 
    relative=1) at hid/gtk/gui-output-events.c:114
#23 0x00002aaaac69f4bd in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#24 0x00002aaaac6a265f in g_main_context_check ()
   from /usr/lib/libglib-2.0.so.0
#25 0x00002aaaac6a290a in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#26 0x00002aaaaaf7a360 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#27 0x0000000000489941 in ghid_do_export (options=Variable "options" is not available.
)
---Type <return> to continue, or q <return> to quit---
    at hid/gtk/gui-top-window.c:3850
#28 0x000000000044bedb in main (argc=2, argv=0x7fffffb46b18) at main.c:777
(gdb) cont
Continuing.
Cannot find user-level thread for LWP 10989: generic error
(gdb) quit
The program is running.  Exit anyway? (y or n) y
Quitting: thread_db_get_info: cannot get thread info: generic error

 

-- 

$ cat .sig /dev/null
--- pcb/src/polygon1.c	2007-01-10 01:41:22.000000000 +0100
+++ pcb-mod2/src/polygon1.c	2007-02-01 23:57:50.000000000 +0100
@@ -841,6 +841,10 @@
 
   if (a == NULL || b == NULL)
     error (err_bad_parm);
+
+  if (a->contours == NULL || b->contours == NULL) 
+    error (err_bad_parm); 
+
   do
     {
       do

_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user