Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3594 - kdebase ebuild failure
Summary: kdebase ebuild failure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Dan Armak (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-10 15:09 UTC by Ian Smith
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

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


Attachments
KDM rc file (kdmrc,17.20 KB, text/plain)
2002-06-13 12:38 UTC, Ian Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Smith 2002-06-10 15:09:45 UTC
USE="doc aalib crypt oss matrox fbcon truetype mozilla mozirc mozxmlterm mpeg
tcltk mta-tls tcpd"

sparky root # emerge -f kdebase 
Calculating dependencies ...done!
>>> emerge kde-base/kdebase-3.0.1.20020604 to /
pam
motif
encode
cups
oggvorbis
opengl
ssl
pam

error messages:

  /bin/sh ../../libtool --mode=install /bin/install -c -p  kdm_config
/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/bin/kdm_config
/bin/install -c -p kdm_config
/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/bin/kdm_config
  /bin/sh ../../libtool --mode=install /bin/install -c -p  kdm_greet
/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/bin/kdm_greet
/bin/install -c -p kdm_greet
/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/bin/kdm_greet
mkdir /mnt/huge/tmp/portage/kdebase-3.0.1.20020604/image/usr/kde/3/share/config/kdm
Information: reading old kdmrc /usr/kde/3/share/config/kdm/kdmrc (from kde >= 2.2.x)
Warning: file /usr/kde/3/share/config/kdm/xdm-keys not found
make[4]: *** [install-data-local] Segmentation fault
make[4]: Leaving directory
`/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory
`/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory
`/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory
`/mnt/huge/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm'
make: *** [install-recursive] Error 1

!!! ERROR: The ebuild did not complete successfully.
!!! Function kde_src_install, Line -3669, Exitcode 2
!!! died running make install, kde_src_install:make

!!! emerge aborting on 
/usr/portage/kde-base/kdebase/kdebase-3.0.1.20020604.ebuild .
Comment 1 Andrzej 2002-06-10 19:58:59 UTC
I had the same problem
I had to rename /usr/kde/3/share/config/kdm/kdmrc and 
/etc/X11/xdm/xdm-config (don't remember exactly the name, I'm not at my 
computer right now)
Next I run ebuild "/usr/portage/kde-base/kdebase.latest.ebuild merge" and it 
worked. Kdebase was emerged but there was another problem: 
I couldn't login to kde from kdm, I could only login to twm (xsession) and twm
(failsafe).
What fixed that was putting back my old kdmrc I had renamed in order to emerge 
kdebase. 
Comment 2 Ian Smith 2002-06-11 12:10:54 UTC
I have already tried renaming /usr/kde/3/share/config/kdm/kdmrc before, and it
didn't work, but I haven't tried /etc/X11/xdm/xdm-config yet.

I'll report back later.
Comment 3 Dan Armak (RETIRED) gentoo-dev 2002-06-12 14:54:46 UTC
Hm, I never saw anything like that...  Slight chance, but maybe your kdmrc has 
some rare option that triggers this? Please attach it. 
Oh, and of course, what gcc is that? Maybe it's another gcc3 issue... 
Comment 4 Ian Smith 2002-06-13 12:38:12 UTC
Created attachment 1506 [details]
KDM rc file
Comment 5 R. Steve McKown 2002-06-14 18:38:32 UTC
I am seeing a similar problem in v1.2 when issuing 'emerge kde'.  During
install-data-local in ...kdebase-3.0.1.20020604/kdm/kfrontend, the genkdmconf
program is executed.  This program seems to be caught in an endless loop
generating the following output over and over:

Information: reading old xdm config file /etc/X11/xdm/xdm-config
Warning: file /usr/X11R6/lib/X11/xdm/xdm-keys not found

'ps' verifies that the same genkdmconf process runs for at least several
minutes, consuming a high amount of CPU time while running.  I believe it
eventually stops because it gets sent a signal because the first error output of
emerge contains the perror message "Terminated":

make[4]: *** [install-data-local] Terminated
make[4]: Leaving directory
`/var/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend'

I can duplicate this problem by running the command manually:

fuji root # cd \
/var/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend
fuji root # ./genkdmconf --in \
/var/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/share/config/kdm

The program spun for several minutes before I terminated it with ^C.

I suspect this is a result of miscompiled code due to CFLAGS settings.  I am
running on a Transmeta Crusoe and use CFLAGS of:

-mcpu=i686 -march=i586 -O2 -pipe -fno-strict-aliasing -fomit-frame-pointer
-mpreferred-stack-boundary=2 -malign-functions=0 -malign-jumps=0 -malign-loops=0

BTW, these CFLAGS come from examining the CRUSOE optimizations in the Linux
kernel as well as some feedback from forums.gentoo.org.  I have yet to run
anything but C/C++ compiler toolchain extensively with these settings so they
are somewhat suspect.

I'm going to look into genkdmconf with gdb and try compiling with different
options; if I learn something I will report it here.

Sorry for the long post.
Steve
Comment 6 R. Steve McKown 2002-06-14 20:09:25 UTC
The answer in my case was removing the -fomit-frame-pointer from CFLAGS.  Please
note that I am using gcc 2.95.3-r5 and binutils 2.12.0.90.7, which may be
meaningful variables.

genkdmconf is being miscompiled.  This is, effectively, the command used to
compile genkdmconf (in reality, it is three separate commands in Makefile; I
combined them):

i586-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./../backend
-I/usr/kde/3/include -I/usr/qt/3/include -I/usr/X11R6/include  
-DQT_THREAD_SUPPORT  -D_REENTRANT  -DNDEBUG -O2  -mcpu=i686 -march=i586 -O2
-pipe -fno-strict-aliasing
-fomit-frame-pointer -mpreferred-stack-boundary=2 -malign-functions=0
-malign-jumps=0 -malign-loops=0 genkdmconf.c -o genkdmconf -L/usr/X11R6/lib
-lX11 -lresolv

The program loops if ran by hand.  Under gdb (adding the -g flag) and depending
upon where I set the breakpoints it will either sefault (there's the unhandled
signal that caused program Terminate) or *restart* main upon return from main. 
No joke; see the gdb dialog below for the gory details.

I found that by removing the -fomit-frame-pointer compile flag, genkdmconf
builds and runs correctly.  I've built my entire system with this flag.  Guess
what that means...


**** gdb dialog ****

fuji kfrontend # gdb genkdmconf
GNU gdb 5.1.1
Copyright 2002 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 "i586-pc-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x804b01b: file genkdmconf.c, line 2219.
(gdb) break genkdmconf.c:2329
Breakpoint 2 at 0x804b375: file genkdmconf.c, line 2329.
(gdb)  run --in
/var/tmp/portage/kdebase-3.0.1.20020604/image///usr/kde/3/share/config/kdm
Starting program:
/var/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend/genkdmconf
--in /var/tmp/portage/kdebase-3.0.1.20020604/image///usr/kde/3/share/config/kdm

Breakpoint 1, main (argc=-1073742230, argv=0xbffffe7e) at genkdmconf.c:2219
2219        for (ap = 1; ap < argc; ap++) {
(gdb) cont
Continuing.
Information: reading old xdm config file /etc/X11/xdm/xdm-config

Breakpoint 2, main (argc=???, argv=???) at genkdmconf.c:2329
2329        return 0;
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x400f004d in _res_opcodes () from /lib/libc.so.6
(gdb)

***
By changing the exact locations of the breakpoints I can get it to loop and
restart main:
***

(gdb) clear main
Deleted breakpoints 3 1
(gdb) break 2219
Breakpoint 4 at 0x804b01b: file genkdmconf.c, line 2219.
(gdb) break 2329
Note: breakpoint 2 also set at pc 0x804b375.
Breakpoint 5 at 0x804b375: file genkdmconf.c, line 2329.
(gdb) run --in
/var/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/share/config/kdm
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program:
/var/tmp/portage/kdebase-3.0.1.20020604/work/kdebase-3.0.1/kdm/kfrontend/genkdmconf
--in /var/tmp/portage/kdebase-3.0.1.20020604/image//usr/kde/3/share/config/kdm

Breakpoint 4, main (argc=-1073742230, argv=0xbffffe7e) at genkdmconf.c:2219
2219        for (ap = 1; ap < argc; ap++) {
(gdb) cont
Continuing.
Information: reading old xdm config file /etc/X11/xdm/xdm-config

Breakpoint 2, main (argc=???, argv=???) at genkdmconf.c:2329
2329        return 0;
(gdb) cont
Continuing.

Breakpoint 4, main (argc=-1073742230, argv=0xbffffe7e) at genkdmconf.c:2219
2219        for (ap = 1; ap < argc; ap++) {
(gdb)

*** line 2219 is the first non-decl/non-defn code line in main ***

Comment 7 R. Steve McKown 2002-06-14 20:39:06 UTC
Correction to last post.  Removing *either* -fomit-frame-pointer or
-mpreferred-stack-boundary=2 builds a working genkdmconf in my environment. 
Looks like stack misalignment due to calling a function compiled with a larger
stack boundary size; see
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html.  With
-fomit-frame-pointer, there is no way for the stack misalignment to get fixed.

Perhaps someone more knowledgeable could tell me a way to determine why/what
code in my system is using a larger preferred stack boundary size when I
compiled everything with the same flags.  Is there any code that overrides user
CFLAGS?
Comment 8 Dan Armak (RETIRED) gentoo-dev 2002-06-15 15:09:09 UTC
Someone more knowledgeable than me will have to answer that :-)  
  
Ian Smith: please test this solution; what were your previous optimizations?  
  
Upper optimization limits for various packages known to miscompile are  
appearing everywhere recently. I'll probably use Verwilst's new flag-o-matic  
eclass here; I want to look at it and consider extending it for such complex  
cases as we have here - "flags a b are not allowed together when compiling this 
subdirectory".  
Comment 9 Dan Armak (RETIRED) gentoo-dev 2002-06-15 15:13:48 UTC
Steve: thank you for your explanation of the matter. I'm adding you to cc:,   
if you're interested in the bug's future so to speak please also read my  
previous comment (from when you weren't being cc'd yet). (If not, feel free  
to remove yourself again.)  
Comment 10 Andrzej 2002-07-19 11:12:18 UTC
I want to add one interesting thing about that.
My PORTAGE_TMPDIR is on seperate partition and with ext3 filesystem and my /
partition has xfs filesystem.
When I go to 
PORTAGE_TMPDIR/portage/kdebase-3.1_alpha1/work/kdebase-3.0.6/kdm/kfrontend and
run this command: ./genkdmconf the output is like that:
Information: reading old xdm config file /etc/X11/xdm/xdm-config
Warning: file /usr/X11R6/lib/X11/xdm/xdm-keys not found
When I run that command plus I specify path where I want to put kdmrc:
./genkdmconf --in /usr/kde/3/share/config/kdm 
The output is like above and this is the case for every directory I write after
--in flag besides one and that one is 
PORTAGE_TMPDIR/portage/kdebase-3.1_alpha1/image/usr/kde/3/share/config/kdm and
the output is:
Information: reading old kdmrc /usr/kde/3/share/config/kdm/kdmrc (from kde >= 2.2.x)
Warning: file /usr/kde/3/share/config/kdm/xdm-keys not found
Segmentation fault
That's the only case where i have "Segmentation fault"
Another strange thing is that this bug doesn't always hit me.
I had this problem only with kdebase-3.0.1.20020604 and now kdebase-3.1_alpha.
One more thing.
I moved my PORTAGE_TMPDIR to my /var/tmp on xfs yesterday and ran
 ebuild /usr/portage/kde-base/kdebase/kdebase-3.1_alpha1.ebuild package
and it finished without any error (no "Segmentation fault").
I merged later this package, upgraded to new kdmrc (etc-update) and evrything is
fine so far.
I think that's all.
Greetings and thank you for your time and work :)
Comment 11 Andrzej 2002-07-19 11:14:17 UTC
and my compiler flags are:
-march=i686 -O3 -pipe -fomit-frame-pointer
Comment 12 Dan Armak (RETIRED) gentoo-dev 2002-07-26 10:50:24 UTC
I'll just make kdm/kfrontend compile without -fomit-frame-pointer, to make sure  of removing all instances of the problem.   Andrzej: if this ever occurs again please report.