Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Compiling always fails - Segfault
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 12:45 pm    Post subject: [SOLVED] Compiling always fails - Segfault Reply with quote

I have a problem in my G4 iBook for a few days now. Whenever I'm compiling something, I get an "Internal compiler error - segfault". The problem occurs with all kind of packages, but especially the new KDE ebuilds. Here's an error message when compiling ncurses:

Code:

In file included from ../include/curses.h:297,
                 from ../menu/menu.priv.h:44,
                 from ../menu/m_win.c:38:
/usr/include/wchar.h: In function `mbrlen':
/usr/include/wchar.h:326: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.3-20050110/../../../../powerpc-unknown-linux-gnu/bin/ld: total time in link: 0.163975
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.3-20050110/../../../../powerpc-unknown-linux-gnu/bin/ld: data size 2567992
cd ../lib && (rm -f libmenuw.so.5; ln -s libmenuw.so.5.4 libmenuw.so.5; rm -f libmenuw.so; ln -s libmenuw.so.5 libmenuw.so; )
The bug is not reproducible, so it is likely a hardware or OS problem.
make[1]: *** [../objects/m_win.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/ncurses-5.4-r5/work/ncurses-5.4/menu'
make: *** [all] Error 2


This is strange because I had no problems at all until a few days ago, the iBook ran fine for several months. What I think is causing the problem is this in dmesg:

Quote:

Linux agpgart interface v0.100 (c) Dave Jones
[drm] Initialized drm 1.0.0 20040925
[drm] Initialized radeon 1.14.0 20050125 on minor 0:
[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held
[drm:drm_unlock] *ERROR* Process 5742 using kernel context 0


I see the last two lines always right after one of these segfaults. I already try emerging things without X being started (thus the radeon module is not loaded) but it still segfaults, although I have the feeling that GCC "survives" for a longer time. But when it segfault without X, I at least don't get this error in dmesg.

Here's my emerge info:

Quote:

Portage 2.0.51.19 (default-linux/ppc/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r5 ppc)
=================================================================
System uname: 2.6.11-gentoo-r5 ppc 7447A, altivec supported
Gentoo Base System version 1.6.10
Python: dev-lang/python-2.3.5 [2.3.5 (#1, Mar 1 2005, 00:59:28)]
dev-lang/python: 2.3.5
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.9.5, 1.8.5-r3, 1.5, 1.6.3, 1.7.9, 1.4_p6
sys-devel/binutils: 2.15.90.0.3-r4
sys-devel/libtool: 1.5.14
virtual/os-headers: 2.6.8.1-r2
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks nodoc noinfo sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gentoo.mirror.icd.hu/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="ppc X alsa altivec arts artswrappersuid bootsplash cdr crypt cups dga divx4linux dv dvd dvdread exif fam ffmpeg flac foomaticdb freetype gif gimpprint gtk2 ithreads java jpeg kde kdeenablefinal lzw-tiff mpeg nptl nptlonly ogg oggvorbis opengl pdflib pic png ppds qt qt-mt quicktime rtc samba slp ssl threads tiff truetype unicode usb utf8 vorbis xv xvid linguas_de linguas_eo"
Unset: ASFLAGS, CBUILD, CTARGET, LDFLAGS, PORTDIR_OVERLAY


Any help would be greatly appreciated!


Tom


Last edited by fourhead on Tue Apr 05, 2005 6:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
tomvollerthun
Guru
Guru


Joined: 19 Mar 2005
Posts: 316

PostPosted: Tue Apr 05, 2005 12:55 pm    Post subject: Reply with quote

Quote:
The bug is not reproducible, so it is likely a hardware or OS problem.

From what I've heard, this snippet of your error message describes it fairly well: segmentation faults are often due to memory errors or cpu errors

Do you use old/blackmarketed/secondhand memory? Do you overclock your CPU? Is it very hot in your place? (oh, cologne; in dortmund the heat wouldn't be the cause for CPU failures at the moment!!)
_________________
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 1:28 pm    Post subject: Reply with quote

Hm, I don't know. The iBook runs VERY well, my girlfriends is doing a lot of video editing with it under MacOSX, and I can compile some large packages fine like OOo, glibc etc. This error occured just a few days ago, and I THINK it happened after updating GCC and/or the kernel, but I'm not sure. I already reverted back to my previous kernel which didn't solve the problem, but I can't revert back to the previous GCC because I can't compile it anymore :-( May CFLAGS or so be an issue?

Tom
Back to top
View user's profile Send private message
tomvollerthun
Guru
Guru


Joined: 19 Mar 2005
Posts: 316

PostPosted: Tue Apr 05, 2005 1:34 pm    Post subject: Reply with quote

elektrohirn wrote:
I THINK it happened after updating GCC

Well, if you think hardware is not the issue: have you recompiled the complete toolchain after updating GCC?
There are some lengthy threads on how to recompile in the correct order and there is even a script (called tcupdate or so) flying around in the forums.

As to your CFLAGS: I am not so very knowledgeable about them, but since I read some stuff, I think they can do all kinds of evil (up to kidnapping). Do you have very aggressive or exotic CFLAGS?
_________________
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 1:54 pm    Post subject: Reply with quote

CFLAGS="-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"

... as recommended in make.conf - so these should be okay. I'll search for this script you mentioned, thanks for that hint. I reverted back to ppc from ~ppc, perhaps it's just an issue with the newest glibc/gcc or something else, because as I already mentioned this has happened after the last update of the kernel and/or gcc.

Tom
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Tue Apr 05, 2005 2:23 pm    Post subject: Reply with quote

Quote:
CFLAGS="-mcpu=7400 -O2 -pipe -maltivec -mabi=altivec"


i have the same cflags here on my G4 and didnt have any problems with it.

Does actually any compile attempt break ??? I searched a bit in the bugs page but coudnt find anything related ...

cheers
_________________
Error: Failing not supported by current locale
Back to top
View user's profile Send private message
Tuna
Guru
Guru


Joined: 19 Jul 2002
Posts: 485
Location: Berlin

PostPosted: Tue Apr 05, 2005 2:29 pm    Post subject: Reply with quote

do you use a preemptive kernel? preemptive kernels are known to cause problems on PPC. disable it.
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 3:10 pm    Post subject: Reply with quote

Quote:

do you use a preemptive kernel? preemptive kernels are known to cause problems on PPC. disable it.


Um, yes, I've enabled preemption in my kernel. Couldn't this be the reason for this error message in dmesg:

Quote:

[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held


??? I'm just about to recompile gcc, I'll see if it finishes and then I'll boot a new non-preemptive kernel and try again. Thanks for this hint it gave me my hope back :-)

Tom
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 3:13 pm    Post subject: Reply with quote

Quote:

Does actually any compile attempt break ???


No, not all compiles break, just a few of the, but kdelibs & others always failed, while e.g. arts and kate compiled just fine. As postd above, I was even abe to emerge OOo and glibc without any errors, two fairly large packages.

Tom
Back to top
View user's profile Send private message
tomvollerthun
Guru
Guru


Joined: 19 Mar 2005
Posts: 316

PostPosted: Tue Apr 05, 2005 4:34 pm    Post subject: Reply with quote

elektrohirn wrote:
... I'll search for this script you mentioned

No need to search: I needed it today myself: https://forums.gentoo.org/viewtopic-t-282474-highlight-tcupdate.html

There can be two scripts downloaded. I think both do a good job, so I tried them both and found tcupdate to seem to be better, but you should try them yourself (both provide help with --help)
tom
_________________
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Back to top
View user's profile Send private message
l33tmmx
Tux's lil' helper
Tux's lil' helper


Joined: 12 Mar 2005
Posts: 91
Location: Pirkkala, Finland

PostPosted: Tue Apr 05, 2005 6:14 pm    Post subject: Reply with quote

Disable the preemption in the kernel!!!

I had just the same problem on my iBook G4 some time ago: gcc segfaulted occasionally, especially when the machine was hot and / or I was compiling with X running. After recompiling the kernel with preemption disabled, the problem disappeared immediately. (I used LiveCD to recompile the kernel to avoid segfaults)

The preemptive kernel on the PPC architecture is currently badly broken, unfortunately... :(
_________________
"Trust me, I know what I'm doing!"
- Sledge Hammer

Follow me on Twitter
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 05, 2005 6:42 pm    Post subject: Reply with quote

Thanks so much for your help. I disabled preemption and everything compiles fine now. I found several threads regarding this issue, wouldn't it be a good idea to spit out a warning when emerging the kernel sources that preemption causes this kind of problems? I think I remember enabling preemption when I did the switch from gentoo-sources-2.6.11-r3 to -r5.

Tom
Back to top
View user's profile Send private message
softchill
n00b
n00b


Joined: 28 Jun 2003
Posts: 73
Location: Quebec, Canada

PostPosted: Fri Jul 08, 2005 10:45 pm    Post subject: Reply with quote

Thanks a lot, I have the same problem. Perhaps there should be a warning in the kernel config. :)
Back to top
View user's profile Send private message
Patchoulol
n00b
n00b


Joined: 12 Mar 2004
Posts: 17

PostPosted: Sun Jul 10, 2005 11:02 am    Post subject: Reply with quote

How to know if preemption is on? I have removed the config from the hard drive :(
Back to top
View user's profile Send private message
stimuli
Apprentice
Apprentice


Joined: 16 Dec 2002
Posts: 292
Location: Vancouver, BC, Canada

PostPosted: Mon Jul 11, 2005 3:06 am    Post subject: Reply with quote

there's a config.gz in /proc or /dev, if I recall correctly. It is the config used to build your kernel. Name it .config and put it in your sources folder. Then run make menuconfig
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Jul 11, 2005 5:03 pm    Post subject: Reply with quote

Patchoulol wrote:
How to know if preemption is on? I have removed the config from the hard drive :(

try zgrep PREEMPT /proc/config.gz
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
gnomeza
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2003
Posts: 97

PostPosted: Sun Jul 17, 2005 10:06 pm    Post subject: Re: [SOLVED] Compiling always fails - Segfault Reply with quote

Quote:

Linux agpgart interface v0.100 (c) Dave Jones
[drm] Initialized drm 1.0.0 20040925
[drm] Initialized radeon 1.14.0 20050125 on minor 0:
[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held
[drm:drm_unlock] *ERROR* Process 5742 using kernel context 0


FWIW, the error above is unrelated to the segfaults. It is caused by a problem with the AGP driver (uninorth-agp) and appears when X attempts to load DRI.

It's currently preventing me from finally getting 3D acceleration working on my Powerbook (Radeon 9600 M10)...

I haven't found a solution yet...

- Mark
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Sun Jul 17, 2005 10:39 pm    Post subject: Reply with quote

ATi chipsets >9200 are only partially supported. You could try one of the latest CVS X.org releases, but beyond that there's not much you can do to get 3D support. r300.sf.net is the project page for the people working on a driver.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum