pcb

polygon editing crash

Bug #699336 reported by agaran6
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Undecided
Andrew Poelstra

Bug Description

PCB (from git) crashes when polygon vertex reduction invoked by mouse move causes to remove one of three remaining points (or at polygon delete itself).
Crash is repeatable, just draw rectangle copper area, move one of corners to get triangle, moved corner should be removed leaving triangle copper area with only three points, now move one of them to line connecting two remaining, pcb will crash.
pcb 1.99z compiled 7 dec 2010, from git tree.

Tags: sf-bugs
Revision history for this message
agaran6 (agaran6) wrote :

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6c016b0 (LWP 25693)]
poly_PreContour (C=0x0, optimize=1) at polygon1.c:1970
1970 for (c = (p = &C->head)->next; c != &C->head; c = (p = c)->next)
(gdb) p c
$1 = <value optimized out>
(gdb) p p
$2 = <value optimized out>
(gdb) p C->head
Cannot access memory at address 0x14
(gdb) p C
$3 = (PLINE *) 0x0
(gdb) bt
#0 poly_PreContour (C=0x0, optimize=1) at polygon1.c:1970
#1 0x080ab468 in original_poly (p=0x89bc800) at polygon.c:163
#2 0x080ac9fc in InitClip (Data=0x864f218, layer=0x864f264, p=0x89bc800) at polygon.c:959
#3 0x080a21f6 in MovePolygonPoint (Layer=0x864f264, Polygon=0x89bc800, Point=0x89c24f8) at move.c:426
#4 0x080a2836 in MoveObjectAndRubberband (Type=2048, Ptr1=0x864f264, Ptr2=0x89bc800, Ptr3=0x89c24f8, DX=100000, DY=-135000)
    at move.c:833
#5 0x08062250 in NotifyMode () at action.c:1575
#6 0x08063115 in ActionMode (argc=1, argv=0xbff5e194, x=0, y=0) at action.c:684
#7 0x080cfdd9 in hid_actionv (name=0x80fd0dd "Mode", argc=1, argv=0xbff5e194) at hid/common/actions.c:219
#8 0x080cfe28 in hid_actionl (name=0x80fd0dd "Mode") at hid/common/actions.c:197
#9 0x080e5184 in ghid_port_button_release_cb (drawing_area=0x88da4d0, ev=0x85d0650, ui=0x87526a0)
    at hid/gtk/gui-output-events.c:659
#10 0xb74f2816 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#11 0x088da4d0 in ?? ()
#12 0x085d0650 in ?? ()
#13 0x087526a0 in ?? ()
#14 0xb722d678 in ?? () from /usr/lib/libgobject-2.0.so.0
#15 0x088f0298 in ?? ()
#16 0x088d66a0 in ?? ()
#17 0xbff5e2c8 in ?? ()
#18 0xb71fc90b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
Backtrace stopped: frame did not save the PC

Revision history for this message
Andrew Poelstra (asp11) wrote :

This is a bug in 20100929, but not in git HEAD. I will find the exact commit that fixed it.

Changed in pcb:
assignee: nobody → Andrew Poelstra (asp11)
status: New → Confirmed
Revision history for this message
Andrew Poelstra (asp11) wrote :

The bug was fixed when Peter C converted board objects to use GLists. I cannot test the first few commits as my GTK library is too old (need to upgrade Fedora) but here is the first:

commit 2ce35292b9e96da38cb56878005aba20891689eb
Author: Peter Clifton <email address hidden>
Date: Sat Apr 30 15:20:39 2011 +0100

    Convert board objects to GLists of g_slice allocated memory

    This enables pointers for these objects to be immutable during their
    lifetime, which is a _huge_ benefit for some operations.

    Having otherwise was becoming VERY tiresome, and was a perenial source
    of bugs tripping up novice and experts of the codebase alike.

    Due to the risks associated with modifying the structure being iterated
    over, this patch makes the relevant *_LOOP macros iterate over a shallow
    copy of the underlying GList. This is slight overkill for many cases,
    but until we have identified which do not modify the data-structures it
    is wise to keep as we are.

Changed in pcb:
status: Confirmed → Fix Committed
Peter Clifton (pcjc2)
Changed in pcb:
status: Fix Committed → Fix Released
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.