gschem segfaults on recursive loop

Bug #732326 reported by KaiMartin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gEDA
Triaged
Critical
Unassigned

Bug Description

This bug was reported on gmane.comp.cad.geda.user by Vladimir Zhbanov:

gschem segfaults when confronted with a symbol that contains itself.
To reproduce:
1) copy a symbol foobar.sym to the current working directory
2) open the copied symbol in gschem
3) type [i] and choose the local symbol foobar.sym in the chooser
4) add foobar.sym to the canvas
5) save (as foobar. sym) and close gschem
6) open gschem on foobar.sym
--> immediate segfault.

Suggestion: gschem should check for recursive loops when opening a schematic.

Tags: gschem libgeda
Changed in geda:
status: New → Confirmed
summary: - gschem segfaults on recoursive loop
+ gschem segfaults on recursive loop
Peter TB Brett (peter-b)
Changed in geda:
importance: Undecided → High
tags: added: gschem
tags: added: libgeda
Revision history for this message
Peter TB Brett (peter-b) wrote :

Upgrading importance to "critical" because crashes are bad.

Changed in geda:
importance: High → Critical
Peter TB Brett (peter-b)
Changed in geda:
assignee: nobody → Peter TB Brett (peter-b)
milestone: none → 1.8.2
Peter TB Brett (peter-b)
Changed in geda:
status: Confirmed → Won't Fix
status: Won't Fix → In Progress
Revision history for this message
Peter TB Brett (peter-b) wrote :

Attached a testcase. To reproduce, run gschem broken.sym for an (almost) immediate crash.

Revision history for this message
Peter TB Brett (peter-b) wrote :

This bug needs to be fixed by loading schematic and symbol files in two passes. First, objects need to be parsed from the file while creating placeholder objects instead of complex objects, and *not* recursively loading symbols. Then, in a second pass, symbols need to be loaded from the library to convert the placeholders into "proper" symbols.

This approach would have three main benefits. Firstly, we can forbid symbols from containing symbols, fixing this bug. Secondly, applications would be able to more precisely report syntax errors etc. in symbols. Thirdly, it would provide an excuse to refactor and drastically simplify the libgeda file loading API.

Changed in geda:
status: In Progress → Triaged
Peter TB Brett (peter-b)
Changed in geda:
milestone: 1.8.2 → none
Peter TB Brett (peter-b)
Changed in geda:
assignee: Peter TB Brett (peter-b) → nobody
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.