gnetlist drc2 crash emitting to stdout when found errors

Bug #1004757 reported by Jeff Mallatt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
High
Peter TB Brett

Bug Description

When running "gnetlist -g drc2 -o - my.sch" (note the '-o -' saying to emit to stdout), if it finds any errors/warnings then it crashes trying to emit the final "... See output file." message.

This is because if the '-o -' argument is given, the drc2 function sets port to (current-output-port), and then after all the checks are done it does a (close-output-port port) -- hence closing stdout -- before determining to emit the final message. Thus, since stdout has been closed, trying to write to it crashes.

Since the "... See output file." message is inappropriate when emitting to stdout, the attached patch tests for the '-o -' argument, and skips emitting the final message if it was specified.

Tags: gnetlist
Revision history for this message
Jeff Mallatt (jjm-j) wrote :
Peter TB Brett (peter-b)
Changed in geda:
assignee: nobody → Peter TB Brett (peter-b)
milestone: none → 1.8.0
tags: added: gnetlist
Peter TB Brett (peter-b)
Changed in geda:
importance: Undecided → High
status: New → In Progress
Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

Bug was fixed by a commit
git stable-1.8 commit 67c6022ba512e33b242aa62d0448385893471554
http://git.geda-project.org/geda-gaf/commit/?id=67c6022ba512e33b242aa62d0448385893471554

commit 67c6022ba512e33b242aa62d0448385893471554
Author: Jeff Mallatt <email address hidden>
Commit: Peter TB Brett <email address hidden>

    gnetlist: Stop drc2 backend from crashing when output is to stdout.

    Fixes bug where emitting to stdout (-o -) and finding errors/warnings
    caused crash attempting to emit final 'See output file' message.

    Closes-bug: lp-1004757
    Reviewed-by: Peter TB Brett <email address hidden>

Changed in geda:
status: In Progress → Fix Committed
Peter TB Brett (peter-b)
Changed in geda:
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.