[oi-dev] [Fwd: [xwin-discuss] X build heads up: Bad symbols may occur]

Alan Coopersmith alan.coopersmith at oracle.com
Thu Sep 30 18:29:17 UTC 2010


(A bunch of the bug id's mentioned are so new they haven't yet been published
 to bugs.opensolaris.org, but should appear there in a day or two.   -alan-)

-------- Original Message --------
Subject: [xwin-discuss] X build heads up: Bad symbols may occur
Date: Thu, 30 Sep 2010 11:25:02 -0700
From: Alan Coopersmith <alan.coopersmith at oracle.com>
To: OpenSolaris X Window System List <xwin-discuss at opensolaris.org>

As mentioned in an earlier thread on xwin-discuss, xterm and several other
binaries in the packages we generated for build 149 have bad symbol table
data which causes bad data at runtime, and depending on the program a
variety of unexpected things may happen - such as xterm & xlogo being unable
to start because they have invalid Xaw widget class structures.

Thanks to the expert help of the linker team, this has been tracked down to
building binaries with *all* of these conditions:
  1) Mapfile flags that create separate bss segments, such as those used in
     the X consolidation builds since 4988923 (s10_53 or later)
  2) A linker containing the changes for 6910387 (snv_135 or later)
     and 6949596 (snv_142 or later)
  3) Thread-specific storage data sections, such as can be created in a
     compilation that #includes <string.h> after the changes for
     6960818 (snv_147 or later) - unless the compiler optimizes them out.
     It currently appears Studio 12 on SPARC optimizes them out at -xO1 or
     higher, but not unoptimized, and does not optimize them out on x86.

Since we built X build 149 on snv_147, and have those mapfile flags present
in X (since s10_53 in fact), we hit this issue.   You can detect invalid
binaries with ldd -r or elfdump:

% ldd -r /usr/bin/xterm
[...]
        relocation R_386_COPY offset invalid: simpleMenuWidgetClass:
offset=0x84026e8 lies outside memory image; relocation discarded
        relocation R_386_COPY offset invalid: smeBSBObjectClass:
offset=0x84026ec lies outside memory image; relocation discarded
        relocation R_386_COPY offset invalid: scrollbarWidgetClass:
offset=0x84026f4 lies outside memory image; relocation discarded
        relocation R_386_COPY offset invalid: sessionShellWidgetClass:
offset=0x8402700 lies outside memory image; relocation discarded

% elfdump /usr/bin/xterm >> /dev/null
/usr/bin/xterm: .dynsym: index[224]: bad symbol entry: smeBSBObjectClass:
section[25] size: 0x26c8: symbol (address 0x84026ec, size 0x4) lies outside of
containing section
/usr/bin/xterm: .dynsym: index[251]: bad symbol entry: sessionShellWidgetClass:
section[25] size: 0x26c8: symbol (address 0x8402700, size 0x4) lies outside of
containing section
[...many more...]

While the linker team is working on fixing the linker (CR 6988300), I have
just pushed a change to xnv-gate to temporarily remove the mapfile flags
causing separate bss segments to be generated (CR 6988507).   Anyone who is
building the X gate on snv_147 or later will want to ensure these changes
are included in their build.   (On SPARC, you will definitely want them when
building debuggable, since otherwise your debug builds will get mysterious
memory corruption not in the optimized versions.)

At some future point, after the linker fix is delivered to ON, we will
restore these mapfiles to the X build options (CR 6988508) - at that point
I'll send a flag day warning people to be sure to either build on a new
enough ON or to revert this change from their builds.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System

_______________________________________________
xwin-discuss mailing list
xwin-discuss at opensolaris.org
List info: http://mail.opensolaris.org/mailman/listinfo/xwin-discuss
Unsubscribe: http://mail.opensolaris.org/mailman/options/xwin-discuss



More information about the oi-dev mailing list