pcb

avoid instant 'CRASH' if an action script implies 'invalidate_lr'

Bug #1754479 reported by KaiMartin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Low
Bert Timmerman

Bug Description

The file /src/hid/common/hidnogui.c contains a number of checks for conditions that are not supposed to happen if no GUI is present. The default action if any of these conditions trigger, is
an immediate exit of the application. Apparently, this is supposed to alert the user that something runs afoul.

One of the conditions is a call of the function 'invalidate_lr()'. However, there is at least one use case where this condition is legitimately met while no GUI is present. If the eps HID is used to print the different strings ('names') of the footprint, the only way to do this is to include
an action string or an action script to the command. The required actions are 'DISPLAY(NameOnPCB)' and DISPLAY(Value)', respectively. These actions call 'invalidate_lr()' and consequently the application exits before EPS output is produced.

I attached a patch which resolves this situation and allows me to do complex prints from a bash script.

Note, that I had submitted a similar patch back in about 2011. This patch got rejected by the then active developers. Apparently the potential to alert users about the condition was deemed more important than my need to do scripted printing. Also, my patch was seen as band-aid, whereas a proper solution would have been to introduce an action HID (I hope, I remember correctly).

In the aftermath of this decision, I
* lost most of my motivation to contribute to the code
* habitually patched the source whenever I built a new version of pcb.
As a side effect, this prevented me to share my printing solution.
This bug report is an attempt to resolve these long running issues.

---<)kaimartin(>---

Revision history for this message
KaiMartin (kmk-familieknaak) wrote :
Changed in pcb:
milestone: none → pcb-4.1.1
assignee: nobody → Bert Timmerman (bert-timmerman)
importance: Undecided → Low
status: New → In Progress
Changed in pcb:
status: In Progress → Fix Committed
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Hi Kai-Martin,

I hope that pcb-4.1.1 will be released in a couple of months and that you can stop applying patches on *every* new release.

If you want to send in a (git) patch for a proper solution (if needed, and as described above), then this will be most welcome.

Anyway, better to let the user know what is going on (intended or not), than invoke a crash !

Kind regards,

Bert Timmerman

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.