Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 271367 - sys-libs/glibc-2.9_p20081201 breaks with sys-kernel/ps3-sources
Summary: sys-libs/glibc-2.9_p20081201 breaks with sys-kernel/ps3-sources
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: PPC64 Linux
: High major (vote)
Assignee: ppc64 architecture team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-27 03:30 UTC by Jean-Francis Roy
Modified: 2010-06-08 20:14 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francis Roy 2009-05-27 03:30:52 UTC
glibc-2.8_p20080602-r1 breaks a brand new Gentoo installation on a PS3 ppc64 installation.

Reproducible: Always

Steps to Reproduce:
1. Get a PS3 (d'oh!)
2. Unpack the latest stage3-ppc64-64ul and the portage tree
3. chroot, etc
4. Change make.conf to optimise for the cell processor (-mcpu=cell), ACCEPT_KEYWORDS="~ppc64"
5. emerge -uNDav1 python
6. python-updater
7. emerge -uNDav1 system 

Actual Results:  
After the glibc upgrade :

>>> Emerging (32 of 32) sys-devel/gcc-4.3.3-r2
Traceback (most recent call last):            
  File "/usr/lib/portage/bin/ebuild", line 59, in <module>
    import portage                                        
  File "/usr/lib/portage/pym/portage/__init__.py", line 96, in <module>
    from portage.data import ostype, lchown, userland, secpass, uid, wheelgid, \
  File "/usr/lib/portage/pym/portage/data.py", line 101, in <module>            
    mystatus, myoutput = getstatusoutput("id -G portage")                       
  File "/usr/lib64/python2.6/commands.py", line 55, in getstatusoutput          
    pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')                               
OSError: [Errno 9] Bad file descriptor                     

Getting this python error for anything. I tried to start a python interpretor and directly use the os.popen function. Fails.

Expected Results:  
Not this to happen ;-)

I can't ren emerge --info, as python is broken.
Comment 1 Jean-Francis Roy 2009-05-27 04:12:34 UTC
Modified version number. This is the one, the 2.8 version was the one who was unmerged at the end of the process... sorry for the typo.
Comment 2 Sebastian Luther (few) 2009-05-27 10:46:29 UTC
You didn't update python and forgot to run python-updater, right?
Comment 3 Jean-Francis Roy 2009-05-27 13:42:33 UTC
Nop, that time I specifically updated python (because I ran into this problem twice using an old PS3 2008.0 stage) and ran python-updater.

Just tried again without the -mcpu=cell and -abi=altivec flags:


Steps to Reproduce:
1. Get a PS3 (d'oh!)
2. Unpack the latest stage3-ppc64-64ul and the portage tree
3. chroot, etc
4. ACCEPT_KEYWORDS="~ppc64"
7. emerge -uNDav1 system 

Failing at the exact same place (after glibc's upgrade)
Comment 4 Jean-Francis Roy 2009-05-27 13:52:47 UTC
If you have any test request, I'm starting over. I'll update everything but glibc and GCC. Just tell me what to test / what glibc version to merge, etc :-)
Comment 5 Jean-Francis Roy 2009-05-27 20:39:00 UTC
Same test with glibc-2.9_p20081201-r1. Changing summary to reflect that all revisions of glibc-2.9_p20081201 do break the system.
Comment 6 SpanKY gentoo-dev 2009-05-27 22:36:58 UTC
someone with Gentoo actually installed on their PS3 will have to take a look.  the popen/pipe issue should have been fixed already by 1095_all_glibc-2.9-assume-pipe2.patch.
Comment 7 Jean-Francis Roy 2009-05-28 03:05:09 UTC
Just tested with hard-masked 2.10.1, same issue :(
Comment 8 Jean-Francis Roy 2009-05-28 15:35:25 UTC
(In reply to comment #6)
> someone with Gentoo actually installed on their PS3 will have to take a look. 
> the popen/pipe issue should have been fixed already by
> 1095_all_glibc-2.9-assume-pipe2.patch.
> 

Where is this file? Merged with another patch? I don't find it anywhere in Portage...
Comment 9 Jean-Francis Roy 2009-05-28 16:17:00 UTC
Well, well, well.

Checking the comments on the patch, I understood what's the problem.

I'm on a LiveCD, trying to install a Gentoo on the PS3, but the only LiveCD that works on the PS3 is an old one with an old kernel. (2.6.23 I think).

Updating the system before installing a new kernel and rebooting will compile glibc with 2.6.29 headers but the kernel running is old... Should be added in the Gentoo documentation not to upgrade everything prior to the first boot of the machine with the current stage3.

Resolving bug with resolution to INVALID.
Comment 10 SpanKY gentoo-dev 2009-05-30 00:02:35 UTC
mmm that shouldnt cause a problem unless you also set NPTL_KERN_VER to something newer than the running kernel
Comment 11 Jean-Francis Roy 2009-05-30 07:00:13 UTC
(In reply to comment #10)
> mmm that shouldnt cause a problem unless you also set NPTL_KERN_VER to
> something newer than the running kernel
> 

Everything works fine while booted on a newer kernel. I did not set NPTL_KERN_VER to anyting ;-)

Booting the recent kernel was only a workaround?
Comment 12 SpanKY gentoo-dev 2009-05-30 10:11:22 UTC
correct.  the default build should allow for building against any recent kernel header version but running on 2.6.9+.
Comment 13 Marcus Comstedt 2009-07-05 07:40:06 UTC
This also happed to me, running 2.6.24.

/usr/include/linux/version.h indicates 2.6.27.
Comment 14 Marcus Comstedt 2009-07-05 08:09:47 UTC
(I did not set NPTL_KERN_VER, and I wasn't installing from a live cd, but
 merely upgrading a working system.)
Comment 15 Marcus Comstedt 2009-07-05 08:21:38 UTC
Also, both the stage4 and the kernel source overlays seems to contain nothing
newer than 2.6.24, so where to get the new kernel?
Comment 16 Marcus Comstedt 2009-07-05 10:34:12 UTC
Building and installing 2.6.28.10 straight from kernel.org fixed the problem.
Luckily, the system was not too botched to compile a kernel.
Comment 17 Jean-Francis Roy 2009-07-05 17:15:15 UTC
(In reply to comment #15)
> Also, both the stage4 and the kernel source overlays seems to contain nothing
> newer than 2.6.24, so where to get the new kernel?
> 

You don't need any "special" kernel, the vanilla Linux kernel supports the PS3 since I don't remember what version. You can use the normal gentoo-sources. There is a file named ps3_defconfig in arch/powerpc/configs from which you can base your .config. Watch out though, this .config example doesn't include lots of needed things (USB keyboard and mouse, filesystems, etc).
Comment 18 Marcus Comstedt 2009-07-05 17:59:04 UTC
Well, it's been a long time since I had to compile a ps3 kernel last...  :-)

No worries about the config, I used the one from my 2.6.24 kernel and
did make oldconfig, which turned out ok.
Comment 19 Maik Nijhuis 2009-08-06 12:14:23 UTC
I just ran into this bug on my PS3 with ppc64 installation. After upgrading my kernel from ps3-sources-2.6.23-r1 to gentoo-sources-2.6.27-r8, all problems related to popen() are gone. And my 240 days uptime :(

I suggest making glibc-2.9 dependent on a recent kernel, since it gives bad problems with old kernels. Even emerge does not run anymore!

If you run into this bug, and emerge is broken, you can 'fix' emerge by changing   getstatusoutput("id -G portage")   to   0, '250'   in
/usr/lib/portage/pym/portage/data.py. Then you can emerge recent kernel sources, configure, compile and install them, and reboot. Afterwards, you can undo the fix again. I used this fix with portage version 2.1.6.13.
Comment 20 SpanKY gentoo-dev 2009-08-21 05:39:35 UTC
it'll take me a while to set up my ps3 with linux, so it'll be faster if someone could give me temp access (non-root) to a box that is misbehaving ...
Comment 21 Jean-Francis Roy 2009-08-21 14:06:45 UTC
(In reply to comment #20)
> it'll take me a while to set up my ps3 with linux, so it'll be faster if
> someone could give me temp access (non-root) to a box that is misbehaving ...
> 

If you want to set up your PS3 with Gentoo and run into that bug, you can follow this howto I wrote/updated some weeks ago:
http://en.gentoo-wiki.com/wiki/Sony_Playstation_3

Just ensure you stay in the chroot of the old PS3 LiveCD to do all the upgrade.


I've got two installations up and running (ppc and ppc64) and I don't plan for now to reproduce this bug again... I may do it in a couple of weeks if you don't want to try it out on your own until then. I could then give you an access.

Comment 22 SpanKY gentoo-dev 2009-09-07 04:21:50 UTC
looks like another kernel bug.  the official linux-2.6.23 release had powerpc maxing out at 309 syscalls.  that means anything with 310 or higher should return ENOSYS.

unfortunately, it would seem that the sony patches to the linux kernel adds unofficial syscalls thus breaking this whole process.  if you look at the patchsets in the ps3-sources 2.6.23 / 2.6.24, you'll see this little gem:
http://overlays.gentoo.org/proj/cell/browser/sys-kernel/ps3-sources/files/00-sony-2.6.24.patch.bz2

--- linux-2.6.24/include/asm-powerpc/unistd.h
+++ linux-2.6.24-20080131/include/asm-powerpc/unistd.h
@@ -332,10 +332,22 @@
 #define __NR_eventfd       307
 #define __NR_sync_file_range2  308
 #define __NR_fallocate     309
+#define __NR_pfm_create_context    310
+#define __NR_pfm_write_pmcs    (__NR_pfm_create_context+1)
+#define __NR_pfm_write_pmds    (__NR_pfm_create_context+2)
+#define __NR_pfm_read_pmds (__NR_pfm_create_context+3)
+#define __NR_pfm_load_context  (__NR_pfm_create_context+4)
+#define __NR_pfm_start     (__NR_pfm_create_context+5)
+#define __NR_pfm_stop      (__NR_pfm_create_context+6)
+#define __NR_pfm_restart   (__NR_pfm_create_context+7)
+#define __NR_pfm_create_evtsets    (__NR_pfm_create_context+8)
+#define __NR_pfm_getinfo_evtsets (__NR_pfm_create_context+9)
+#define __NR_pfm_delete_evtsets (__NR_pfm_create_context+10)
+#define __NR_pfm_unload_context    (__NR_pfm_create_context+11)

-#define __NR_syscalls      310
+#define __NR_syscalls      322

which means anything in the future that officially uses these numbers (like pipe2) will break.  the only solution here is to upgrade your kernel and stop using the ps3-sources kernel.  i'll add a blocker to the newer glibc, but the ppc64 guys really should:
 - update the livecd to a newer kernel not using these custom patchsets
 - add a newer ps3-sources ebuild that simply does `die` or redirects to gentoo-sources
Comment 23 SpanKY gentoo-dev 2010-06-08 04:23:20 UTC
dont use ps3-sources
Comment 24 Jean-Francis Roy 2010-06-08 14:42:58 UTC
And don't install using old liveCDs running on it ;) (that was the original problem). And anyway now people must own a PS3 which isn't upgraded to the newest Sony firmwares :(.
Comment 25 SpanKY gentoo-dev 2010-06-08 19:35:17 UTC
i'm debating buying a 2nd PS3 ... was hoping geohot would have something released by now for us
Comment 26 Jean-Francis Roy 2010-06-08 20:14:24 UTC
I've got two PS3s, one that remains with the old firmware (I've got Gentoo on it, but I didn't use it for months), and one other that I had to upgrade to play the latest games, etc. I hope geohot will release something... (maybe it's done, didn't check since one month).