pcb

Segfault in edge_cost: e->mincost_target null

Bug #699255 reported by djwoolley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Medium
Unassigned

Bug Description

Trying to familiarise, I did a trivial autoroute using some fairly random rat lines between three 10 pin headers. Trying to route all resulted in it rejecting all the lines, claiming that it couldn't find the pins or they didn't overlap a pad. Trying to route selected on a rat line chained between the three connectors produced a segmentation fault in edge_cost:

Program terminated with signal 11, Segmentation fault.
#0 0x08066bb6 in edge_cost (e=0x8579098, too_big=0) at autoroute.c:1738

    case NORTH:
      if (e->mincost_target->box.Y1 >= e->rb->box.Y1)
        penalty += AutoRouteParameters.WrongWayPenalty;
      break;

e-> mincost_target was null:

(xxgdb) print *e
$1 = {
  rb = 0x857aa00,
  cost_point = {
    X = 111000,
    Y = 279500
  },
  cost_to_point = 0,
  cost = 0,
  mincost_target = 0x0,
  work = 0x0,
  expand_dir = NORTH,
  flags = {
    expand_all_sides = 0,
    is_via = 0,
    via_conflict_level = NO_CONFLICT,
    is_interior = 0,
    via_search = 0
  }
}

This is using the 20060202 version built from source, although I also had crashes in similar circumstances with the gEda source ISO, which uses an earlier version

Revision history for this message
djwoolley (djwoolley) wrote :
Revision history for this message
djwoolley (djwoolley) wrote :

Oops. There is a typo in the version. The version is 200*8*0202.

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

Reproduced in git HEAD with attached file. Open it and run "Autoroute selected rats" on the single selected rat.

Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

A commit was made which affects this bug
git master commit 644f8d9598bccae90de9d932818e46924abedec6
http://git.geda-project.org/pcb/commit/?id=644f8d9598bccae90de9d932818e46924abedec6

commit 644f8d9598bccae90de9d932818e46924abedec6
Author: Andrew Poelstra <email address hidden>
Commit: Andrew Poelstra <email address hidden>

    Fix segfault when routing to non-straight pads

    Since the autorouter does not handle non-manhattan lines, it will
    not route to non-straight pads. Therefore, when the autorouter
    searches for the pins/pads at the endpoints of a rat, it ignores
    any non-straght pads, returning NULL from the search.

    The autorouter then tries to dereference this pointer and crashes.

    The rest of the code, it seems, works to avoid ever giving such
    rats to the autorouter, but it can be done if the user explicitly
    selects such a rat and selects "Auto-route selected rats".

    This patch catches the NULL pointer and simply ignores the rat.

    It is possible that this is the cause of bug lp-699255, but this
    seems unlikely, since the backtrace on that report does not show
    the same NULL dereference, and the reporter was using "10-pin
    headers", which presumably have no pads that could be marked as
    non-straight.

    Affects-bug: lp-699255

Traumflug (mah-jump-ing)
Changed in geda-project:
importance: Undecided → Critical
Revision history for this message
Traumflug (mah-jump-ing) wrote :

Trying the test case as described above, nothing happens. No segfault, no autorouted track either. Looking at the discussion above the bug appears to be solved. In case it isn't, please open a new bug with a test case demonstrating it.

P.S.: Toporouter routes the selected track correctly :-)

Changed in geda-project:
status: New → Fix Released
Changed in pcb:
status: New → Fix Committed
milestone: none → next-feature-release
status: Fix Committed → Fix Released
milestone: next-feature-release → none
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.