Crash when loading vendor resource from an action string.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pcb |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This bash script lets pcb die:
# Apply vendor drill mapping.
# See http://
echo "units = mm" > vendor.res
echo "drillmap = {" >> vendor.res
echo " round = nearest" >> vendor.res
echo " 0.75" >> vendor.res
echo " 1.0" >> vendor.res
echo "}" >> vendor.res
"${PCB}" --action-string "
LoadFrom(Layout, input.pcb)
LoadVendorFro
"
${PCB} points to a binary compiled from git HEAD as of 31/07/2013. ${PCB_PATHS} and ${PCB_CMDS} are set up just like it's done in pcbtest.sh coming with the sources.
Loading the same resource file from the menu works as expected. The backtrace hints on a conflict between parsing the vendor resource file and parsing the menu resource file:
(gdb) bt
#0 0x00007ffff50f7bbd in getc () from /lib/x86_
#1 0x000000000048d5c5 in res_parse_getchars (buf=0x87e9c0 "", max_size=<optimized out>) at res_parse.y:85
#2 0x000000000048ea4e in yy_get_next_buffer () at res_lex.c:1111
#3 reslex () at res_lex.c:953
#4 0x000000000048dccc in resparse () at res_parse.c:1323
#5 0x000000000048df96 in resource_parse (filename=
at res_parse.y:132
#6 0x00000000004cde27 in ghid_load_menus () at hid/gtk/
#7 ghid_build_
#8 ghid_create_
#9 0x00000000004cefa6 in ghid_do_export (options=<optimized out>) at hid/gtk/
#10 0x0000000000426a87 in main (argc=1, argv=0x7fffffff
Changed in pcb: | |
status: | New → Fix Committed |
Changed in pcb: | |
status: | Fix Committed → Fix Released |
Changed in pcb: | |
milestone: | none → pcb-20140316 |
A commit was made which affects this bug cee2b55cb4f75ac e616d8f518 git.geda- project. org/pcb/ commit/ ?id=32941c40201 5bcdcee2b55cb4f 75ace616d8f518
git master commit 32941c402015bcd
http://
commit 32941c402015bcd cee2b55cb4f75ac e616d8f518
Author: Markus Hitter <email address hidden>
Commit: Markus Hitter <email address hidden>
src/ res_parse. y: handle resource globals gracefully.
Likely, res_file is used somewhere to check something. In case a
resource file was loaded earlier, but the current parsing is from
a string, res_file is still != NULL, so this check would mislead.
Solution: Clear res_file and res_filename as soon as the file
behind it gets closed.
Also replace a number of zeros with the more appropriate NULL.
Affects-bug: lp-1206882