Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 142198 - [4.1/bad code] >= x11-terms/xterm-215-r1 garbled colors handling w/ -Os
Summary: [4.1/bad code] >= x11-terms/xterm-215-r1 garbled colors handling w/ -Os
Status: RESOLVED DUPLICATE of bug 135718
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Emanuele Giaquinta (RETIRED)
URL:
Whiteboard:
Keywords:
: 147518 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-30 10:29 UTC by Emmanuel Rosa
Modified: 2006-09-14 00:28 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mutt executed within script (typescript,830 bytes, text/plain)
2006-07-31 16:16 UTC, Emmanuel Rosa
Details
emerge of xterm-219 (xtermbuild.txt,26.24 KB, text/plain)
2006-09-10 09:32 UTC, Emmanuel Rosa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Rosa 2006-07-30 10:29:10 UTC
Portage 2.1.1_pre4 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-ck1 i686)
=================================================================
System uname: 2.6.17-ck1 i686 Intel(R) Celeron(R) CPU 1.80GHz
Gentoo Base System version 1.12.1
app-admin/eselect-compiler: 2.0.0_rc2
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -Os -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/X11/app-defaults /etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /usr/X11R6/lib/X11/xkb"
CXXFLAGS="-march=pentium4 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages metadata-transfer prelink sandbox sfperms strict userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac alsa apache2 apm asf avi berkdb bitmap-fonts bzip2 cli crypt cups dlloader dri dts dvd emboss encode ffmpeg foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imagemagick imlib ipv6 isdnlog java jpeg libg++ libwww mad mailwrapper mikmod mmx moznoirc moznomail mp3 mpeg ncurses network nls nptl nptlonly nsplugin objc ogg opengl oss pam pcre pdflib perl pic png ppds pppd python qt3 qt4 quicktime readline reflection samba sdl session spell spl sse ssl svg tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis xml xmms xorg xv zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en userland_GNU video_cards_i810 video_cards_fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Emmanuel Rosa 2006-07-30 10:30:39 UTC
Gosh, I'm so sorry. Once again, I placed 'emerge --info' in the wrong textbox. Again, I appologize.

Portage 2.1.1_pre4 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3,
2.6.17-ck1 i686)
=================================================================
System uname: 2.6.17-ck1 i686 Intel(R) Celeron(R) CPU 1.80GHz
Gentoo Base System version 1.12.1
app-admin/eselect-compiler: 2.0.0_rc2
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -Os -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/X11/app-defaults /etc/env.d /etc/env.d/java/
/etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild
/etc/terminfo /usr/X11R6/lib/X11/xkb"
CXXFLAGS="-march=pentium4 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages metadata-transfer prelink sandbox
sfperms strict userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac alsa apache2 apm asf avi berkdb bitmap-fonts bzip2 cli crypt
cups dlloader dri dts dvd emboss encode ffmpeg foomaticdb fortran gdbm gif gpm
gstreamer gtk gtk2 imagemagick imlib ipv6 isdnlog java jpeg libg++ libwww mad
mailwrapper mikmod mmx moznoirc moznomail mp3 mpeg ncurses network nls nptl
nptlonly nsplugin objc ogg opengl oss pam pcre pdflib perl pic png ppds pppd
python qt3 qt4 quicktime readline reflection samba sdl session spell spl sse
ssl svg tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb vorbis
xml xmms xorg xv zlib elibc_glibc input_devices_keyboard input_devices_mouse
kernel_linux linguas_en userland_GNU video_cards_i810 video_cards_fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-07-30 10:37:22 UTC
Works fine here (tried w/ ufed, mc). You have some screenshot? Also, locale command output and /etc/conf.d/consolefont settings would be probably useful here.
Comment 3 Emmanuel Rosa 2006-07-30 10:43:20 UTC
Arg! Sorry. I keep messing this up!

The problem is, that when executing ncurses-based programs, usually the screen gets covered with the foreground color. For example, when executing mutt or alsamixer, the screen becomes complete white. With other programs such as orpheus, only part of the screen becomes completely white. My first suspicion would be the ncurses library, but this problem developed right after an 'emerge -u world' in which xterm was updated from x11-terms/xterm-215 and ncurses was not updated. Also, changing the foreground color for XTerm in .Xresources affects this problem. See below.

These are the packages that would be merged, in order:

Calculating world dependencies  ..... done!

[ebuild     U ] sys-apps/portage-2.1.1_pre4 [2.1.1_pre3-r3] 
*** Portage will stop merging at this point and reload itself,
    then resume the merge.
[ebuild     U ] dev-libs/nss-3.11.2 [3.11.1-r1] 
[ebuild     U ] net-misc/neon-0.26.1 [0.25.5] USE="nls% -gnutls% -socks5% -stati
c%" 
[ebuild     U ] gnome-base/orbit-2.14.2 [2.14.0] 
[ebuild     U ] net-print/foomatic-filters-ppds-20060720 [20060601] 
[ebuild     U ] net-print/foomatic-db-ppds-20060720 [20060601] 
[ebuild     U ] net-print/cups-1.2.2 [1.2.1-r2] USE="ppds%" 
[ebuild     U ] net-fs/samba-3.0.23a [3.0.22-r3] LINGUAS="-ja% -pl%" 
[ebuild     U ] gnome-base/gnome-vfs-2.14.2-r1 [2.14.2] 
[ebuild  N    ] app-portage/portage-utils-0.1.20  USE="python" 
[ebuild     U ] dev-java/java-config-wrapper-0.10-r2 [0.9-r5] 
[ebuild     U ] dev-java/java-config-2.0.26-r4 [2.0.26] 
[ebuild     U ] media-sound/alsa-headers-1.0.12_rc1 [1.0.11] 
[ebuild     U ] media-libs/alsa-lib-1.0.12_rc1 [1.0.11-r1] 
[ebuild     U ] dev-java/sun-jdk-1.5.0.07-r2 [1.5.0.07]
[ebuild     U ] www-client/mozilla-firefox-1.5.0.5 [1.5.0.4] LINGUAS="-ar% -ca% 
-cs% -da% -de% -el% -en_GB% -es% -es_AR% -es_ES% -fi% -fr% -ga% -ga_IE% -he% -hu
% -it% -ja% -ko% -mk% -nb% -nb_NO% -nl% -pl% -pt_BR% -ro% -ru% -sk% -sl% -sv% -s
v_SE% -tr% -zh_CN% -zh_TW%" 
[ebuild     U ] media-sound/alsa-utils-1.0.12_rc1 [1.0.11] 
[ebuild     U ] mail-client/mozilla-thunderbird-1.5.0.5 [1.5.0.4] 
[ebuild     U ] dev-libs/elfutils-0.122 [0.120] 
[ebuild     U ] sys-devel/prelink-20060712 [20060213] 
[ebuild     U ] dev-libs/liboil-0.3.8-r1 [0.3.8] 
[ebuild     U ] sys-libs/db-4.3.29-r2 [4.3.29] 
[ebuild     U ] mail-mta/postfix-2.3.0 [2.2.10] USE="-dovecot-sasl%" 
[ebuild     U ] sys-apps/shadow-4.0.17-r1 [4.0.16-r2] 
[ebuild     U ] media-libs/imlib2-1.2.2.001 [1.2.1.009] USE="bzip2*" 
[ebuild     U ] app-emulation/qemu-softmmu-0.8.1-r1 [0.8.1] USE="alsa%" 
[ebuild     U ] dev-libs/atk-1.12.1 [1.11.4] 
[ebuild     U ] gnome-base/libglade-2.6.0 [2.5.1] 
[ebuild     U ] net-misc/dhcpcd-2.0.8-r2 [2.0.7] 
[ebuild     U ] app-emulation/wine-0.9.17 [0.9.16] 
[ebuild     U ] media-libs/libmp4v2-1.5.0.1 [1.5] 
[ebuild     U ] media-libs/faac-1.24-r3 [1.24-r2] 
[ebuild     U ] x11-terms/xterm-215-r1 [215] USE="-paste64%"

$locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

# /etc/conf.d/consolefont

# CONSOLEFONT specifies the default font that you'd like Linux to use on the
# console.  You can find a good selection of fonts in /usr/share/consolefonts;
# you shouldn't specify the trailing ".psf.gz", just the font name below.
# To use the default console font, comment out the CONSOLEFONT setting below.
# This setting is used by the /etc/init.d/consolefont script (NOTE: if you do
# not want to use it, run "rc-update del consolefont" as root).

CONSOLEFONT="default8x16"

# CONSOLETRANSLATION is the charset map file to use.  Leave commented to use
# the default one.  Have a look in /usr/share/consoletrans for a selection of
# map files you can use.

#CONSOLETRANSLATION="8859-1_to_uni"

Screenshot of orpheus: http://www.imagehosting.us/index.php?action=show&ident=1489661
Comment 4 Emmanuel Rosa 2006-07-30 11:32:37 UTC
Ok, now I know it's not an ncurses problem.In the listing below, the directory 'Institute - Distort Yourself' shows up completely blocked out in white. I believe the stick flag causes that, because when I disabled it the directory became visible.

$ ls -l
total 37327
-rw-r--r-- 1 emmanuel users 5256931 Jul 10 17:02 01 walking city.mp3
-rw-r--r-- 1 emmanuel users 4358272 Jul 10 17:04 ATONE_-_Un An_-_03_-_Accordeon.mp3
drwxr-xr-t 2 emmanuel users     864 Jul 30 11:33 Institute - Distort Yourself
-rw-r--r-- 1 emmanuel users 1296213 Jul 12 16:27 Necropolis_Morning_Air.mp3

Comment 5 Emanuele Giaquinta (RETIRED) gentoo-dev 2006-07-31 15:58:49 UTC
The only difference between xterm-215 and xterm-215-r1 is an optional feature which you have not activated.
In which other programs do you get this problem?
Comment 6 Thomas Dickey 2006-07-31 16:07:47 UTC
A typescript file (from running the application in 'script')
would show what is sent to xterm, and would help with the
problem description.  
Comment 7 Emmanuel Rosa 2006-07-31 16:15:31 UTC
So far, I've noticed this problem with alsamixer, orpheus, mutt, and when listing directories with ls, I can't see directories with the sticky bit enabled.

I've tried the programs above with aterm, and I haven't had any problems. And like mentioned by Emanuele Giaquinta, it's most likely not xterm because I downgraded to the previous version and still have this problem.

PS: I like how Emanuele is spelled. My name is Emmanuel. I bet it's even pronounced the same.

Comment 8 Emmanuel Rosa 2006-07-31 16:16:40 UTC
Created attachment 93159 [details]
mutt executed within script

Attached is the output of script when I executed mutt. I simply ran mutt, and exited.
Comment 9 Thomas Dickey 2006-07-31 16:36:31 UTC
I don't see anything odd in the typescript.  I replayed it slowly to look for
visual glitches, didn't see any (though the clearing operations near the end
were noticeable).  Colors look ok.  You should be able to replay it (using
slowcat in ftp://invisible-island.net/ncurses ) on aterm and see normal
behavior.  "slowcat -9 typescript" would go very slowly - perhaps there is
some point where X and xterm are not agreeing well, though a mechanism does
not come to mind.
Comment 10 Emmanuel Rosa 2006-08-20 08:01:13 UTC
After using aterm for about a two weeks I tried xterm, and it segfaulted. So yesterday, I emerged x11-terms/xterm-216 with FEATURES="nostrip" and USE="debug" so I could use gdb to narrow down the problem, but now it works! But I don't know what fixed the problem.

Comment 11 Thomas Dickey 2006-08-20 09:09:06 UTC
Did xterm-216 segfault, or was that xterm-215?
Comment 12 Emmanuel Rosa 2006-08-20 09:20:28 UTC
(In reply to comment #11)
> Did xterm-216 segfault, or was that xterm-215?
> 

I believe it was xterm-216 that segfaulted. xterm-215 would run, but had visibility problems. But after re-emerging, xterm-216 started to work.
Comment 13 Emmanuel Rosa 2006-09-09 13:22:21 UTC
I'm not running x11-terms/xterm-219 and it's segfaulting, I tried downgrading back to 218, same problem. Here's the output of gdb (I compiled with USE="debug FEATURES="nostrip")

$ gdb xterm
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/xterm 

Program received signal SIGSEGV, Segmentation fault.
0x0806e869 in x_strcasecmp ()

Any ideas?
Comment 14 Seemant Kulleen (RETIRED) gentoo-dev 2006-09-09 13:33:51 UTC
after the seg, can you run the command "bt" (I think it is) in gdb to output a backtrace, please?
Comment 15 Emmanuel Rosa 2006-09-10 08:33:34 UTC
(In reply to comment #14)
> after the seg, can you run the command "bt" (I think it is) in gdb to output a
> backtrace, please?
> 
(gdb) bt
#0  0x0806e869 in x_strcasecmp ()
#1  0x0805161c in VTInitialize ()
#2  0xb7d0a2fb in XtInitializeWidgetClass () from /usr/lib/libXt.so.6
#3  0xb7d0a78e in XtInitializeWidgetClass () from /usr/lib/libXt.so.6
#4  0xb7d0abc8 in _XtCreateWidget () from /usr/lib/libXt.so.6
#5  0xb7d2e369 in XtToolkitThreadInitialize () from /usr/lib/libXt.so.6
#6  0xb7d2e480 in XtVaCreateManagedWidget () from /usr/lib/libXt.so.6
#7  0x0806079e in main ()

Comment 16 Thomas Dickey 2006-09-10 08:53:59 UTC
The only places I see x_strcasecmp() used in VTInitialize() are
against the locale resource's value.  That is initialized to a
nonnull value (which can be modified by your resource settings).
Comment 17 Emmanuel Rosa 2006-09-10 09:00:43 UTC
(In reply to comment #16)
> The only places I see x_strcasecmp() used in VTInitialize() are
> against the locale resource's value.  That is initialized to a
> nonnull value (which can be modified by your resource settings).
> 
Well, below is my $HOME/.Xresources

Xcursor.size: 16 
Xcursor.theme: jimmac 
xterm*Background: black
xterm*Foreground: green

I don't know which is the default resource file.
Comment 18 Thomas Dickey 2006-09-10 09:12:55 UTC
I don't think it matters (there should be no way to set a string
resource to null using a resource-file - only from within the
application).  If you could modify the ebuild and make it have
some debugging information, there would be more to see in the
debugger.  I normally use the configure --enable-trace option for
this sort of thing (it makes xterm generate Trace-parent.out which
includes the resource details).  Even adding -g to the compile/link
options would give more detail in the backtrace.
Comment 19 Emmanuel Rosa 2006-09-10 09:31:25 UTC
(In reply to comment #18)
> I don't think it matters (there should be no way to set a string
> resource to null using a resource-file - only from within the
> application).  If you could modify the ebuild and make it have
> some debugging information, there would be more to see in the
> debugger.  I normally use the configure --enable-trace option for
> this sort of thing (it makes xterm generate Trace-parent.out which
> includes the resource details).  Even adding -g to the compile/link
> options would give more detail in the backtrace.
> 

I did was you said. I used the portage overlay to add --enable-trace and -g. Now, xterm doesn't segfault! I don't understand this. Nothing useful shows up in gdb because xterm runs. Attached is the emerge process.



Comment 20 Emmanuel Rosa 2006-09-10 09:32:07 UTC
Created attachment 96598 [details]
emerge of xterm-219
Comment 21 Thomas Dickey 2006-09-10 10:39:04 UTC
Running with your configure options, I do get a bug (will see).
thanks
Comment 22 Thomas Dickey 2006-09-10 11:31:25 UTC
I'm running with gcc 4.1.2, and find that the -Os option causes the
problem.  Changing it to -O2 or -O3 works.  Printing the loop index
'i' and/or the resource value works.  This is the call on line 5613
of charproc.c which is breaking:
    if (!x_strcasecmp(wnew->screen.Acolors[i].resource, XtDefaultForeground)) {
and since it works fine when I print the values, but not otherwise,
it's a compiler bug as far as I'm concerned.  If there's no printf's
then 'i' is optimized away.
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2006-09-13 23:45:22 UTC
*** Bug 147518 has been marked as a duplicate of this bug. ***
Comment 24 SpanKY gentoo-dev 2006-09-14 00:28:32 UTC

*** This bug has been marked as a duplicate of 135718 ***