public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Two more vDSO issues
@ 2004-02-27 16:22 Jakub Jelinek
  2004-02-28 14:22 ` Thorsten Kukuk
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jakub Jelinek @ 2004-02-27 16:22 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers, mingo

Hi!

1) l->ld needs to be relocated as well (I did not catch this up in my
   previous testing, because vDSO was mapped both in the new place and
   in the old location)
2) if kernel provides just AT_SYSINFO_EHDR but not AT_SYSINFO, ld.so would
   segfault.

2004-02-27  Jakub Jelinek  <jakub@redhat.com>

	* elf/rtld.c (dl_main): Adjust l->l_ld of the vDSO by l->l_addr.
	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Only set
	GL(dl_sysinfo) if non-zero.

--- libc/elf/rtld.c.jj	2004-02-27 13:51:54.000000000 +0100
+++ libc/elf/rtld.c	2004-02-27 14:56:05.000000000 +0100
@@ -1246,6 +1246,7 @@ ERROR: ld.so: object '%s' from %s cannot
 	  l->l_map_start = (ElfW(Addr)) GL(dl_sysinfo_dso);
 	  l->l_addr = l->l_map_start - l->l_addr;
 	  l->l_map_end += l->l_addr;
+	  l->l_ld = (void *) ((ElfW(Addr)) l->l_ld + l->l_addr);
 	  elf_get_dynamic_info (l, dyn_temp);
 	  _dl_setup_hash (l);
 	  l->l_relocated = 1;
--- libc/sysdeps/generic/dl-sysdep.c.jj	2004-02-27 17:08:24.000000000 +0100
+++ libc/sysdeps/generic/dl-sysdep.c	2004-02-27 17:18:39.992891935 +0100
@@ -201,7 +201,7 @@ _dl_sysdep_start (void **start_argptr,
 
 #if defined NEED_DL_SYSINFO
   /* Only set the sysinfo value if we also have the vsyscall DSO.  */
-  if (GL(dl_sysinfo_dso) != 0)
+  if (GL(dl_sysinfo_dso) != 0 && new_sysinfo)
     GL(dl_sysinfo) = new_sysinfo;
 #endif
 

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-02-27 16:22 [PATCH] Two more vDSO issues Jakub Jelinek
@ 2004-02-28 14:22 ` Thorsten Kukuk
  2004-03-08 13:15   ` Andreas Schwab
  2004-02-28 17:55 ` Ulrich Drepper
  2004-03-08 13:44 ` Andreas Schwab
  2 siblings, 1 reply; 8+ messages in thread
From: Thorsten Kukuk @ 2004-02-28 14:22 UTC (permalink / raw)
  To: Glibc hackers

On Fri, Feb 27, Jakub Jelinek wrote:

> Hi!
> 
> 1) l->ld needs to be relocated as well (I did not catch this up in my
>    previous testing, because vDSO was mapped both in the new place and
>    in the old location)
> 2) if kernel provides just AT_SYSINFO_EHDR but not AT_SYSINFO, ld.so would
>    segfault.

Even with this patches, glibc always seg.faults if compiled with
NPTL support on IA64 when calling rpcgen the first time during build.

It works fine with linuxthreads and I don't see problems on other
architectures.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Maxfeldstr. 5                 D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-02-27 16:22 [PATCH] Two more vDSO issues Jakub Jelinek
  2004-02-28 14:22 ` Thorsten Kukuk
@ 2004-02-28 17:55 ` Ulrich Drepper
  2004-03-08 13:44 ` Andreas Schwab
  2 siblings, 0 replies; 8+ messages in thread
From: Ulrich Drepper @ 2004-02-28 17:55 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers, mingo

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-02-28 14:22 ` Thorsten Kukuk
@ 2004-03-08 13:15   ` Andreas Schwab
  2004-03-09  0:06     ` Ulrich Drepper
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2004-03-08 13:15 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Thorsten Kukuk, Glibc hackers

Thorsten Kukuk <kukuk@suse.de> writes:

> On Fri, Feb 27, Jakub Jelinek wrote:
>
>> Hi!
>> 
>> 1) l->ld needs to be relocated as well (I did not catch this up in my
>>    previous testing, because vDSO was mapped both in the new place and
>>    in the old location)
>> 2) if kernel provides just AT_SYSINFO_EHDR but not AT_SYSINFO, ld.so would
>>    segfault.
>
> Even with this patches, glibc always seg.faults if compiled with
> NPTL support on IA64 when calling rpcgen the first time during build.

Note that it only crashes when starting a program by explicitly calling
the dynamic linker, it appears that __thread_self->private is not
correctly set.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-02-27 16:22 [PATCH] Two more vDSO issues Jakub Jelinek
  2004-02-28 14:22 ` Thorsten Kukuk
  2004-02-28 17:55 ` Ulrich Drepper
@ 2004-03-08 13:44 ` Andreas Schwab
  2004-03-09 10:43   ` Ulrich Drepper
  2 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2004-03-08 13:44 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers, Thorsten Kukuk

Jakub Jelinek <jakub@redhat.com> writes:

> 2) if kernel provides just AT_SYSINFO_EHDR but not AT_SYSINFO, ld.so would
>    segfault.

Here's another bugfix:

2004-03-08  Andreas Schwab  <schwab@suse.de>

	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Don't truncate
	sysinfo pointer value.

--- sysdeps/generic/dl-sysdep.c.~1.110.~	2004-03-06 22:46:14.000000000 +0100
+++ sysdeps/generic/dl-sysdep.c	2004-03-08 14:36:01.934030411 +0100
@@ -99,7 +99,7 @@ _dl_sysdep_start (void **start_argptr,
 # endif
 #endif
 #ifdef NEED_DL_SYSINFO
-  ElfW(Word) new_sysinfo = 0;
+  uintptr_t new_sysinfo = 0;
 #endif
 
   __libc_stack_end = DL_STACK_END (start_argptr);

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-03-08 13:15   ` Andreas Schwab
@ 2004-03-09  0:06     ` Ulrich Drepper
  2004-03-09  9:09       ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Ulrich Drepper @ 2004-03-09  0:06 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Glibc hackers

Andreas Schwab wrote:

>>Even with this patches, glibc always seg.faults if compiled with
>>NPTL support on IA64 when calling rpcgen the first time during build.
> 
> 
> Note that it only crashes when starting a program by explicitly calling
> the dynamic linker, it appears that __thread_self->private is not
> correctly set.

I compiled on ia64 just yesterday and all worked beautifully.  No idea
what you run into.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-03-09  0:06     ` Ulrich Drepper
@ 2004-03-09  9:09       ` Andreas Schwab
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2004-03-09  9:09 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Ulrich Drepper <drepper@redhat.com> writes:

> Andreas Schwab wrote:
>
>>>Even with this patches, glibc always seg.faults if compiled with
>>>NPTL support on IA64 when calling rpcgen the first time during build.
>> 
>> 
>> Note that it only crashes when starting a program by explicitly calling
>> the dynamic linker, it appears that __thread_self->private is not
>> correctly set.
>
> I compiled on ia64 just yesterday and all worked beautifully.  No idea
> what you run into.

You didn't have USE_DL_SYSINFO defined.  The bug is obvious.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Two more vDSO issues
  2004-03-08 13:44 ` Andreas Schwab
@ 2004-03-09 10:43   ` Ulrich Drepper
  0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Drepper @ 2004-03-09 10:43 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Glibc hackers

Andreas Schwab wrote:

> 	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Don't truncate
> 	sysinfo pointer value.

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-09 10:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27 16:22 [PATCH] Two more vDSO issues Jakub Jelinek
2004-02-28 14:22 ` Thorsten Kukuk
2004-03-08 13:15   ` Andreas Schwab
2004-03-09  0:06     ` Ulrich Drepper
2004-03-09  9:09       ` Andreas Schwab
2004-02-28 17:55 ` Ulrich Drepper
2004-03-08 13:44 ` Andreas Schwab
2004-03-09 10:43   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).