Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2.6, glibc and NPTL
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
joseh
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 89

PostPosted: Sat Dec 27, 2003 7:43 pm    Post subject: Reply with quote

So let me get this straight.

Can nptl be compiled on a per-program basis or do you have to first recompile glibc with nptl, then recompile any other +nptl apps?

Also, if 2.6 is required, is there a kernel option to turn on?

And how do you tell it is working correctly? (I have once compiled mplayer with +xv but since I had -X, xv support was never implemented, yet emerge, etcat, and others all claimed it was)
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sun Dec 28, 2003 7:44 am    Post subject: Reply with quote

joseh wrote:
So let me get this straight.

Can nptl be compiled on a per-program basis or do you have to first recompile glibc with nptl, then recompile any other +nptl apps?

Also, if 2.6 is required, is there a kernel option to turn on?

And how do you tell it is working correctly? (I have once compiled mplayer with +xv but since I had -X, xv support was never implemented, yet emerge, etcat, and others all claimed it was)

NPTL cannot be compiled on a "per-program" basis. You simply recompile glibc with NPTL support, and anything that dynamically links against glibc (pretty much all programs that you care about) will begin using NPTL.

2.6 is required; no kernel options to turn on. Just recompile glibc (and anything that uses the nptl USE flag) and you're good to go.

To see if you have NPTL support, use `ps' or `top' to examine your process list. xmms and Java are notable apps where you can see a change. Without NPTL, you'll see multiple listings for a single instance of the program. With NPTL, you'll only see one listing.
Back to top
View user's profile Send private message
joseh
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2003
Posts: 89

PostPosted: Sun Dec 28, 2003 6:16 pm    Post subject: Reply with quote

Thanks! :)
Back to top
View user's profile Send private message
nbensa
l33t
l33t


Joined: 10 Jul 2002
Posts: 799
Location: Buenos Aires, Argentina

PostPosted: Sun Dec 28, 2003 6:49 pm    Post subject: Reply with quote

tazmanian wrote:
To see if you have NPTL support, use `ps' or `top' to examine your process list.


Or just :

Code:
/lib/libc.so.6


Too bad there's a bug in nptl'ed glibc...
Code:
$ /lib/libc.so.6
Inconsistency detected by ld.so: rtld.c: 1273: dl_main: Assertion `_rtld_local._dl_rtld_map.l_prev->l_next == _rtld_local._dl_rtld_map.l_next' failed!


I have a patch to fix this, but the guys at RedHat (http://sources.redhat.com/ml/libc-alpha/2003-10/msg00011.html) are currently discussing if it is safe to apply. Here it is anyway:

Code:
diff -urN glibc-2.3.2.old/elf/rtld.c glibc-2.3.2/elf/rtld.c
--- glibc-2.3.2.old/elf/rtld.c  2003-01-07 15:47:35.000000000 -0300
+++ glibc-2.3.2/elf/rtld.c      2003-12-27 01:19:55.231825549 -0300
@@ -1102,19 +1102,7 @@
       while (GL(dl_loaded)->l_searchlist.r_list[i] != &GL(dl_rtld_map))
        ++i;
       GL(dl_rtld_map).l_prev = GL(dl_loaded)->l_searchlist.r_list[i - 1];
-      if (__builtin_expect (mode, normal) == normal)
-       GL(dl_rtld_map).l_next = (i + 1 < GL(dl_loaded)->l_searchlist.r_nlist
-                                 ? GL(dl_loaded)->l_searchlist.r_list[i + 1]
-                                 : NULL);
-      else
-       /* In trace mode there might be an invisible object (which we
-          could not find) after the previous one in the search list.
-          In this case it doesn't matter much where we put the
-          interpreter object, so we just initialize the list pointer so
-          that the assertion below holds.  */
-       GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
-
-      assert (GL(dl_rtld_map).l_prev->l_next == GL(dl_rtld_map).l_next);
+      GL(dl_rtld_map).l_next = GL(dl_rtld_map).l_prev->l_next;
       GL(dl_rtld_map).l_prev->l_next = &GL(dl_rtld_map);
       if (GL(dl_rtld_map).l_next != NULL)
        {
Back to top
View user's profile Send private message
Cossins
Veteran
Veteran


Joined: 21 Mar 2003
Posts: 1136
Location: Copenhagen, Denmark

PostPosted: Sun Dec 28, 2003 7:50 pm    Post subject: Reply with quote

Does anyone here know how to make NFS work properly with NPTL?
It oftenly gives me the error "Stale NFS file handle" while updating something from CVS in distfiles in the imported Portage tree.

- Simon
_________________
who cares
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sun Dec 28, 2003 8:07 pm    Post subject: Reply with quote

nbensa wrote:
Too bad there's a bug in nptl'ed glibc...
Code:
$ /lib/libc.so.6
Inconsistency detected by ld.so: rtld.c: 1273: dl_main: Assertion `_rtld_local._dl_rtld_map.l_prev->l_next == _rtld_local._dl_rtld_map.l_next' failed!


Huh. I'm not seeing this.... (glibc-2.3.2-r3 +nls -pic -build +nptl)
Code:
$ /lib/libc.so.6
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice).
Compiled on a Linux 2.4.19 system on 2003-12-22.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        NPTL 0.28 by Ulrich Drepper
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
Report bugs using the `glibcbug' script to <bugs@gnu.org>.

Though I don't think the line
Code:
Compiled on a Linux 2.4.19 system on 2003-12-22.
is accurate.
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Sun Dec 28, 2003 10:43 pm    Post subject: Reply with quote

Woah...I'm using glibc-2.3.3_pre20031212 and recompiled both nvidia-kernel-1.0.5328 and nvidia-glx-1.0.5328 and using nvidia-glx freezes my system.
Code:
Section "Module"

# This loads the DBE extension module.

    Load        "dbe"     # Double buffer extension

# This loads the miscellaneous extensions module, and disables
# initialisation of the XFree86-DGA extension within that module.
    SubSection  "extmod"
      Option    "omit xfree86-dga"   # don't initialise the DGA extension
    EndSubSection

# This loads the Type1 and FreeType font modules
    Load        "type1"
    Load        "speedo"
    Load        "freetype"
    Load        "xtt"

# This loads the GLX module
    Load       "glx"
# This loads the DRI module
    Load       "dri"
    Load   "GLcore"

EndSection

and
Code:

Section "Device"
    Identifier "Nvidia"
    Driver     "nvidia"
    VideoRam   65536
    Option "UseEdidFreqs"   "On"
    Option "UseSoftEDID"   "On"
    Option "NvAgp"       "1"
    Option "RenderAccel"    "1"
    Option "IgnoreDisplayDevices" "DFP,TV"
    Option "ConnectedMonitor"   "CRT"
    Option "NoLogo" "0"
    Option "AGPMode"   "4"
    Option "AGPFastWrite" "On"
    Option "EnableDepthMoves"   "On"
    Option "EnablePageFlip"   "On"
    Option "CursorShadow"   "1"
EndSection

Btw...I know I have NoLogo turned off, I like to use it to make sure that its working properly...and I just noticed I had AGPMode set to 4 as well, we both prolly followed some dufus who said something about it... :x
Back to top
View user's profile Send private message
nbensa
l33t
l33t


Joined: 10 Jul 2002
Posts: 799
Location: Buenos Aires, Argentina

PostPosted: Mon Dec 29, 2003 3:11 am    Post subject: Reply with quote

tazmanian wrote:
Huh. I'm not seeing this.... (glibc-2.3.2-r3 +nls -pic -build +nptl)
Code:
$ /lib/libc.so.6
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice).


I'm running gcc 3.3.2 20031201 (Gentoo Linux 3.3.2-r4, propolice.) Maybe that's why I hit it :-(
Back to top
View user's profile Send private message
Zapp!
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2002
Posts: 77
Location: Germany

PostPosted: Thu Jan 01, 2004 4:42 pm    Post subject: Reply with quote

tazmanian wrote:
Though I don't think the line
Code:
Compiled on a Linux 2.4.19 system on 2003-12-22.
is accurate.

I think the version number refers to the kernel headers installed, not the kernelversion the system is actually running on.
I compiled glibc with 2.6.0 headers, but I can't post my output since I get this bug mentioned above (compiled with 3.3.2 20031201 (Gentoo Linux 3.3.2-r4, propolice))
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Thu Jan 01, 2004 8:42 pm    Post subject: Reply with quote

Zapp! wrote:
tazmanian wrote:
Though I don't think the line
Code:
Compiled on a Linux 2.4.19 system on 2003-12-22.
is accurate.

I think the version number refers to the kernel headers installed, not the kernelversion the system is actually running on.

Aha! Thanks for the clarification! :)
Back to top
View user's profile Send private message
dedeaux
Apprentice
Apprentice


Joined: 19 Jun 2002
Posts: 183
Location: Nairobi, Kenya

PostPosted: Fri Jan 02, 2004 8:48 am    Post subject: Reply with quote

so then....

If a person adds npts to the use flag and then re-emerges glibc what happens next?

revdep-rebuild?

Or just try using it?
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Fri Jan 02, 2004 8:52 am    Post subject: Reply with quote

dedeaux wrote:
If a person adds npts to the use flag and then re-emerges glibc what happens next?

revdep-rebuild?

Or just try using it?

Rebuild anything else that uses the nptl flag (`emerge -epv world | grep nptl' to see). Also if you're using the nvidia-glx stuff, rebuild that too.

Then, just try using it, and rebuild as necessary.
Back to top
View user's profile Send private message
dedeaux
Apprentice
Apprentice


Joined: 19 Jun 2002
Posts: 183
Location: Nairobi, Kenya

PostPosted: Fri Jan 02, 2004 11:59 am    Post subject: Reply with quote

I ran

Code:
emerge -evp world|grep nptl


and it returned nill.

I assume that implies that it would be safe to recompile glibc with nptl support for the future. But then again, if nothing uses it I will not see any advantages.

Isn't openoffice java based? If so, wouldn't that take advantage of it?

I see ppl mentioning mozilla taking advantage, yet nothing showed up on my box.

I am running nvidia though -- which I read offers mixed success.
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sat Jan 03, 2004 12:24 am    Post subject: Reply with quote

dedeaux wrote:
I ran
Code:
emerge -evp world|grep nptl

and it returned nill.
Odd. At the very least, it should have shown glibc.

dedeaux wrote:
But then again, if nothing uses it I will not see any advantages.

The above command will print out packages that you have installed which use the nptl flag. But this doesn't mean that only these packages will benefit from NPTL. Anything that uses threads (e.g, Mozilla, Java, XMMS) should see benefit from NPTL.
Back to top
View user's profile Send private message
sigmalll
Guru
Guru


Joined: 24 Aug 2003
Posts: 332

PostPosted: Sun Feb 01, 2004 6:43 pm    Post subject: Reply with quote

Tazmanian wrote:
dedeaux wrote:
I ran
Code:
emerge -evp world|grep nptl

and it returned nill.
Odd. At the very least, it should have shown glibc.



I noticed the same thing, seems I would have to go for a 2.3.3 pre release (good / bad idea?)
https://forums.gentoo.org/viewtopic.php?t=130582
Back to top
View user's profile Send private message
Kristleifur
n00b
n00b


Joined: 04 Jan 2004
Posts: 41
Location: Iceland

PostPosted: Sun Feb 22, 2004 4:35 pm    Post subject: Reply with quote

sigmalll wrote:
I noticed the same thing, seems I would have to go for a 2.3.3 pre release (good / bad idea?)
https://forums.gentoo.org/viewtopic.php?t=130582


I tried emerging the latest glibc ebuild as it has the rtld-assert-fix patch built in. It was a bit flaky. Now compiling 2.3.2-r9 with the same patch.
Back to top
View user's profile Send private message
hayafirst
n00b
n00b


Joined: 25 Feb 2004
Posts: 7

PostPosted: Wed Feb 25, 2004 7:10 pm    Post subject: Reply with quote

Quote:
I have a patch to fix this, but the guys at RedHat (http://sources.redhat.com/ml/libc-alpha/2003-10/msg00011.html) are currently discussing if it is safe to apply. Here it is anyway:


I know I am stupid. But I am really new in Gentoo. So here's my question: How may I use this patch inGentoo? Thanks
Back to top
View user's profile Send private message
Kristleifur
n00b
n00b


Joined: 04 Jan 2004
Posts: 41
Location: Iceland

PostPosted: Wed Feb 25, 2004 10:42 pm    Post subject: Reply with quote

hayafirst wrote:
Quote:
I have a patch to fix this, but the guys at RedHat (http://sources.redhat.com/ml/libc-alpha/2003-10/msg00011.html) are currently discussing if it is safe to apply. Here it is anyway:


I know I am stupid. But I am really new in Gentoo. So here's my question: How may I use this patch inGentoo? Thanks


As stated in the bug report, it is included in the latest, masked 2.3.3 version of glibc. However, that version of glibc didn't work too well for me so I copied the appropriate lines out of the glibc-2.3.3_pre20040207.ebuild file and inserted them in a copy of the glibc-2.3.2-r9.ebuild file.

These are the lines:
Code:
# Fix an assert when running libc.so from commandline, bug #34733.
cd ${S}; epatch ${FILESDIR}/2.3.2/${PN}-2.3.2-rtld-assert-fix.patch


It's a bit of a hack, and the modified file will get overwritten on the next 'emerge sync', so you'll need a backup.

There are probably better and more proper ways of going about doing this.

The ebuild files are in /usr/portage/sys-libs/glibc. I advise against attempting this until you completely understand what you are about to do, as glibc is a very important package for the health of your system.

Furthermore, the patch is not 100% essential. As far as I could tell, the only thing that broke on my system without the patch applied was xmms, and I'm not even sure that it was due to the lack of said patch.
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1319
Location: UK

PostPosted: Mon Apr 19, 2004 10:57 pm    Post subject: Reply with quote

mplayer segfaults for me, re-compilig without nptl

(why is everyone calling it NTPL?????) too alike to a crappy ISP (ntl)
Back to top
View user's profile Send private message
meowsqueak
Veteran
Veteran


Joined: 26 Aug 2003
Posts: 1549
Location: New Zealand

PostPosted: Wed Jul 07, 2004 4:08 am    Post subject: Reply with quote

I tried emerging glibc-2.3.3.20040420 inside UML-2.6 (usermode linux) as I want to play around with NPTL. Unfortunately after many minutes I get the following error:

Quote:
CPP='gcc -E -x c-header' /var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/elf/ld-linux.so.2 --library-path /var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/math:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/elf:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/dlfcn:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/nss:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/nis:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/rt:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/resolv:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/crypt:/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/nptl /var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/sunrpc/xbootparam_prot.T
cannot set up thread-local storage: set_thread_area failed when setting up thread-local storage

make[2]: *** [/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/buildhere/sunrpc/xbootparam_prot.stmp] Error 127
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2/sunrpc'
make[1]: *** [sunrpc/others] Error 2
make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.3.20040420/work/glibc-2.3.2'
make: *** [all] Error 2

!!! ERROR: sys-libs/glibc-2.3.3.20040420 failed.
!!! Function src_compile, Line 548, Exitcode 2
!!! (no error message)


Does anyone know what this means? Has anyone else successfully emerged glibc with nptl support inside UML?

EDIT: Apparently I need to compile glibc with nptl support from a kernel running TLS. My currently running kernel is 2.6.6-1um so I need to figure out what TLS is and how to get it into this kernel...

EDIT2: TLS is thread-local storage but still no idea how to get it into my environment.
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Wed Jul 07, 2004 11:32 am    Post subject: Reply with quote

Anyone reading this thread should really go and read this thread...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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