auto-uref.scm fails if default uref is "?"

Bug #804898 reported by KaiMartin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
Medium
Unassigned

Bug Description

auto-uref.scm fails if the default uref of the symbol is "?".

To reproduce:

1) activate auto-uref with the following lines in gnetlistrc:
(load-from-path "auto-uref.scm")
(add-hook! add-component-hook auto-uref)

2) put a symbol with refdes=? to some place where gschem finds it. E.g. the symbol attached to this report.

3) open gschem

4) add the symbol to the canvas
The auto-uref script when as the symbol is pasted to the schematic. The failure pulls down gschem, too. The application dies with this backtrace on the stdout:

/---------------------------
Backtrace:
In unknown file:
   ?: 0* [auto-uref (# # # # ...)]
   ?: {1}* (letrec (# # # # ...) (let* # #))
In /usr/local/share/gEDA/scheme/auto-uref.scm:
  90: 2 (let* ((refdeses #) (refdes #) (prefix #)) (if prefix (let* # #)))
  94: 3* (if refdes (get-prefix (cdr (get-attribute-name-value refdes))) #f)
  95: 4 [get-prefix "?"]
    ...
  47: 5 (if (= 0 (match:end prefix)) #f (match:substring prefix))
  47: 6* [= 0 ...
  47: 7* [match:end #f]
In /usr/share/guile/1.8/ice-9/regex.scm:
 125: 8 (let* ((matchnum (if # # {1})) (end (cdr #))) (if (= end -1) #f end))
 128: 9* [cdr ...
 128: 10* [vector-ref #f {1}]

/usr/share/guile/1.8/ice-9/regex.scm:128:20: In procedure vector-ref in expression (vector-ref match matchnum):
/usr/share/guile/1.8/ice-9/regex.scm:128:20: Wrong type argument in position 2: 1
\-------------------------------

BTW, my use case for "refdes=?" is indeed sub sheet symbols. If the urefs of a heirarchy are mangled, I'd still like to keep them as short as possible -- A single character. If I need mor than one sub sheet per sheet, the character has to be unique. In addition, they should not interfere with the usual letters for components. Pure digits fit this agenda.

---<)kaimartin(>---

Revision history for this message
KaiMartin (kmk-familieknaak) wrote :
Revision history for this message
Krzysztof Kościuszkiewicz (k-kosciuszkiewicz) wrote :

The bug is legitimate one, as the code will fail whenever value of the refdes attribute does not start with a letter.
I'm not 100% sure if lifting the restriction for the refdes to start with a letter will not break something else, but we can test such change.

Changed in geda:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Krzysztof Kościuszkiewicz (k-kosciuszkiewicz)
Revision history for this message
Krzysztof Kościuszkiewicz (k-kosciuszkiewicz) wrote :
Changed in geda:
assignee: Krzysztof Kościuszkiewicz (k-kosciuszkiewicz) → nobody
status: In Progress → Fix Committed
milestone: none → 1.7.2
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.