pcb

Segfault when opening a layout

Bug #796066 reported by Traumflug
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Undecided
Unassigned

Bug Description

OS is Ubuntu 11.04 AMD64 with Intel internal graphics. PCB built from scratch with git sources as of today:

    ./autogen.sh && ./configure --disable-doc && make clean && make

Steps to reproduce: open an existing layout with the GUI menu.
Expected behaviour: the layout becomes visible.
Actual behaviour: crash.

Here's the backtrace:

mah@piccard:~/RepRap/pcb$ cd src
mah@piccard:~/RepRap/pcb/src$ ./pcbtest.sh -gdb
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
[...]
(gdb) run
Starting program: /home/mah/RepRap/pcb/src/pcb --lib-path /home/mah/RepRap/pcb/lib --lib-newlib /home/mah/RepRap/pcb/newlib:/home/mah/RepRap/pcb/lib/pcblib-newlib --element-path /home/mah/RepRap/pcb/lib --font-path /home/mah/RepRap/pcb/src --lib-command-dir /home/mah/RepRap/pcb/lib
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffead5f700 (LWP 5035)]
[New Thread 0x7fffea55e700 (LWP 5036)]
disabling 3D rasterization
[New Thread 0x7fffe0f07700 (LWP 5037)]
[Thread 0x7fffe0f07700 (LWP 5037) exited]
[New Thread 0x7fffe0f07700 (LWP 5038)]
[New Thread 0x7fffe0706700 (LWP 5039)]
[New Thread 0x7fffdff05700 (LWP 5040)]
[Thread 0x7fffdff05700 (LWP 5040) exited]
[Thread 0x7fffead5f700 (LWP 5035) exited]
[Thread 0x7fffe0706700 (LWP 5039) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00000000004631f5 in GetValueEx (val=<value optimized out>,
    units=0x12179ab ",6000,3000,1600:Power,4000,7000,4000,1600:Fat,6000,9000,6000,1600:Skinny,10000,13000,10000,1600", absolute=<value optimized out>,
    extra_units=0x0, default_unit=0x1 <Address 0x1 out of bounds>)
    at misc.c:188
188 if (!scaled && default_unit && *default_unit)
(gdb) bt
#0 0x00000000004631f5 in GetValueEx (val=<value optimized out>,
    units=0x12179ab ",6000,3000,1600:Power,4000,7000,4000,1600:Fat,6000,9000,6000,1600:Skinny,10000,13000,10000,1600", absolute=<value optimized out>,
    extra_units=0x0, default_unit=0x1 <Address 0x1 out of bounds>)
    at misc.c:188
#1 0x000000000046331a in GetNum (s=0x7fffffffb9a8,
    default_unit=<value optimized out>) at misc.c:851
#2 0x000000000046442c in ParseRouteString (
    s=0x12179a7 "3000,6000,3000,1600:Power,4000,7000,4000,1600:Fat,6000,9000,6000,1600:Skinny,10000,13000,10000,1600", routeStyle=<value optimized out>,
    default_unit=0x1 <Address 0x1 out of bounds>) at misc.c:881
#3 0x000000000046ef82 in yyparse () at parse_y.y:657
#4 0x000000000046da2c in Parse (Executable=<value optimized out>,
    Path=0x87fdc0 "",
    Filename=0x1136460 "/home/mah/RepRap/Generation_7_Electronics/OptoEndstop.pcb", Parameter=<value optimized out>) at parse_l.l:285
#5 0x000000000045369a in LoadPCB (
    Filename=0x1136460 "/home/mah/RepRap/Generation_7_Electronics/OptoEndstop.pcb") at file.c:408
#6 0x00000000004287dc in ActionLoadFrom (argc=<value optimized out>,
    argv=<value optimized out>, x=<value optimized out>,
    y=<value optimized out>) at action.c:5884
#7 0x0000000000496fcd in hid_actionv (name=<value optimized out>, argc=2,
    argv=0x7fffffffcde0) at hid/common/actions.c:246
#8 0x0000000000497552 in hid_actionl (name=<value optimized out>)
    at hid/common/actions.c:210

(#9 to #36 removed)

Note: the initial empty layout comes up fine.

Tags: segfault
Revision history for this message
Traumflug (mah-jump-ing) wrote :
Revision history for this message
Traumflug (mah-jump-ing) wrote :

Here's another backtrace, made with an unoptimized executable:

#0 0x000000000048091f in GetValueEx (
    val=0x12d2847 "3000,6000,3000,1600:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600",
    units=0x12d284b ",6000,3000,1600:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600", absolute=0x7fffffffb79e, extra_units=0x0,
    default_unit=0x1 <Address 0x1 out of bounds>) at misc.c:188
#1 0x00000000004836d5 in GetNum (s=0x7fffffffb7f8,
    default_unit=0x1 <Address 0x1 out of bounds>) at misc.c:851
#2 0x00000000004838af in ParseRouteString (
    s=0x12d2847 "3000,6000,3000,1600:Power,2500,6000,3500,1000:Fat,4000,6000,3500,1000:Skinny,600,2402,1181,600", routeStyle=0xfbd1e8,
    default_unit=0x1 <Address 0x1 out of bounds>) at misc.c:881
#3 0x00000000004924bc in yyparse () at parse_y.y:657

Looks like the string "cmil" sent in parse_y.y:657 doesn't reach it's destination.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

After some useful hints on the geda-users list, ths diagnosis is as follows:

parse_y.h, parse_y.c and parse_y.o are not updated automatically after parse_y.y has changed. Likely, a Makefile dependency is missing. After deleting all these and rebuilding, file loading worked fine.

Also likely, the situation is the same for recreating parse_l.c and parse_l.o from parse_l.[hl].

Revision history for this message
Traumflug (mah-jump-ing) wrote :

The automake-generated build rules in src/Makefile.in check for existence of some files around parse_y.h instead of rebuilding them in case they're outdated. That's obviously not useful.

Attempts to find where these build rules come from failed, however. One item which I think should be corrected is in the attached patch. The problem remains, though.

Revision history for this message
DJ Delorie (djdelorie) wrote : Re: [Pcb-bugs] [Bug 796066] Re: Segfault when opening a layout

Did you build with --enable-maintainer-mode ? It should enable by
default if you build out of git, but that might be broken...

Revision history for this message
Traumflug (mah-jump-ing) wrote :

Uh, no, didn't know a maintainer mode exists.

Revision history for this message
Andrew Poelstra (asp11) wrote :

I think this is broken, DJ. I have to do --enable-maintainer-mode explicitly.

Revision history for this message
DJ Delorie (djdelorie) wrote :

When you first run ./configure, watch for the line "checking if maintainer mode is required"
It should be enabled automatically if you're building from git AND building the documentation, otherwise it would default to off.

Revision history for this message
Traumflug (mah-jump-ing) wrote :

> if you're building from git AND building the documentation

Well, I'm not building documentation (to save time) and the files not properly refreshed don't belong to documentation.

Traumflug (mah-jump-ing)
Changed in geda-project:
importance: Undecided → Critical
Revision history for this message
Traumflug (mah-jump-ing) wrote :

This was fixed with commit 8b567052b8d6580945e1870debe87792036bf73e:

http://git.geda-project.org/pcb/commit/?id=8b567052b8d6580945e1870debe87792036bf73e

Changed in geda-project:
status: New → Fix Released
tags: added: segfault
Revision history for this message
Chad Parker (parker-charles) wrote :

Marked as released in gEDA project, and six years old. If the problem persists, please file a new bug report.

Changed in pcb:
status: New → 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.