[Mach-devel] mach 0.4.8 fc1 on fc4 problem

John Dalbec jpdalbec at ysu.edu
Thu Dec 15 21:43:24 UTC 2005


I'm trying to set up a Fedora Core 1 build root in mach on Fedora Core 3.  The 
setup fails because ld-linux.so.2 -> ld-2.3.2.so segfaults in dl_main().  See 
below for details.  Any thoughts on how I can further diagnose the problem?
Thanks,
John Dalbec

> Date: Thu, 08 Dec 2005 16:59:50 -0500
> From: John Dalbec <jpdalbec at ysu.edu>
> To:  mach-devel at lists.sourceforge.net
> Subject: Re: [Mach-devel] mach 0.4.8 fc1 on fc4 problem
> 
> Who Knows wrote:
> 
>>John Dalbec wrote:
>>
>>
>>
>>>This looks like the problem I had with fc2-on-fc3 with 0.4.7 where I 
>>>needed to: create a mach-libselinux package containing 
>>>/usr/lib/libselinux-mach.so
>>>create a local repository containing it
>>>add the local repository to /etc/mach/locations and /etc/mach/dist.d/...
>>>add mach-libselinux to the "minimal" package list in /etc/mach/dist.d/...
>>>John
>>
>>
>>The new version 0.4.8 now correctly copies the libselinux files which 
>>should eliminate the need for the special package.
>>and i did verify they were copied for the fc1 root.
>>
>>thanks
>>
>>Jim
> 
> 
> OK, I'm getting the same problem in FC1-on-FC3.  It looks like 
> glibc_post_upgrade fails when iconvconfig segfaults.  Actually it looks like any 
> chrooted command segfaults at that point.  Strace shows that the segfault occurs 
> almost immediately after trying to open /etc/ld.so.preload.  I can't get a 
> backtrace from gdb.  I wonder if the chroot command itself is segfaulting?  I 
> don't see a fork() in the strace output.
> John

I've strace()'d "true" in a working FC1 buildroot (on RHL 9) and the next
strace'd command opens /etc/ld.so.cache.  Maybe it's corrupted?  No, removing it
doesn't help.

FC3 # /var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6
/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6: relocation error:
/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6: symbol _dl_starting_up,
version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
FC3 # strace /var/lib/mach/roots/fedora-1-i386-legacy/lib/ld-linux.so.2
/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6
execve("/var/lib/mach/roots/fedora-1-i386-legacy/lib/ld-linux.so.2",
["/var/lib/mach/roots/fedora-1-i386-legacy/lib/ld-linux.so.2",
"/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6"], [/* 24 vars */]) = 0
uname({sys="Linux", node="dalbec134-fc3.meshel.ysu.edu.localdomain", ...}) = 0
brk(0)                                  = 0x946b000
open("/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\\\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1570564, ...}) = 0
old_mmap(NULL, 1296772, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x957000
old_mmap(0xa8e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x136000) = 0xa8e000
old_mmap(0xa91000, 10628, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa91000
close(3)                                = 0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f95000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

FC3 # gdb /var/lib/mach/roots/fedora-1-i386-legacy/lib/ld-linux.so.2
GNU gdb Red Hat Linux (6.1post-1.20040607.43.0.1rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...(no debugging symbols
found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run /var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6
Starting program: /var/lib/mach/roots/fedora-1-i386-legacy/lib/ld-linux.so.2
/var/lib/mach/roots/fedora-1-i386-legacy/lib/libc.so.6
Reading symbols from shared object read from target memory...(no debugging
symbols found)...done.
Loaded system supplied DSO at 0xd61000

Program received signal SIGSEGV, Segmentation fault.
0x00372600 in dl_main ()
(gdb) bt
#0  0x00372600 in dl_main ()
#1  0x0038070a in _dl_sysdep_start ()
#2  0x00371f80 in _dl_start ()
#3  0x00371c57 in _start ()

0x0037253d <dl_main+1309>:      test   %edi,%edi
0x0037253f <dl_main+1311>:      je     0x3738be <dl_main+6302>
0x00372545 <dl_main+1317>:      mov    0xffffff48(%ebp),%eax
0x0037254b <dl_main+1323>:      test   %eax,%eax
0x0037254d <dl_main+1325>:      jne    0x373878 <dl_main+6232>
0x00372553 <dl_main+1331>:      mov    0xffffff4c(%ebx),%eax
0x00372559 <dl_main+1337>:      test   %eax,%eax
0x0037255b <dl_main+1339>:      je     0x3728bb <dl_main+2203>
0x00372561 <dl_main+1345>:      mov    0x18(%eax),%edi
0x00372564 <dl_main+1348>:      lea    0xffffd96a(%ebx),%edx
0x0037256a <dl_main+1354>:      mov    $0x1,%ecx
0x0037256f <dl_main+1359>:      movl   $0x0,(%esp)
0x00372576 <dl_main+1366>:      mov    %edx,%eax
0x00372578 <dl_main+1368>:      mov    %edi,0xffffff48(%ebx)
0x0037257e <dl_main+1374>:      call   0x37a8f0 <_dl_new_object>
0x00372583 <dl_main+1379>:      mov    %eax,0xffffff00(%ebp)
0x00372589 <dl_main+1385>:      sub    $0x4,%esp
0x0037258c <dl_main+1388>:      test   %eax,%eax
0x0037258e <dl_main+1390>:      je     0x3728bb <dl_main+2203>
0x00372594 <dl_main+1396>:      mov    0xffffff4c(%ebx),%edi
0x0037259a <dl_main+1402>:      mov    0xffffff00(%ebp),%esi
0x003725a0 <dl_main+1408>:      mov    0x1c(%edi),%eax
0x003725a3 <dl_main+1411>:      mov    %edi,%edx
0x003725a5 <dl_main+1413>:      add    %eax,%edx
0x003725a7 <dl_main+1415>:      movzwl 0x2c(%edi),%eax
0x003725ab <dl_main+1419>:      mov    %edx,0x144(%esi)
0x003725b1 <dl_main+1425>:      mov    %ax,0x14c(%esi)
0x003725b8 <dl_main+1432>:      xor    %esi,%esi
0x003725ba <dl_main+1434>:      cmp    %eax,%esi
0x003725bc <dl_main+1436>:      jae    0x3725e3 <dl_main+1475>
0x003725be <dl_main+1438>:      mov    %eax,0xfffffefc(%ebp)
0x003725c4 <dl_main+1444>:      mov    %edx,%edi
0x003725c6 <dl_main+1446>:      mov    %esi,%eax
0x003725c8 <dl_main+1448>:      shl    $0x5,%eax
0x003725cb <dl_main+1451>:      lea    (%eax,%edi,1),%ecx
0x003725ce <dl_main+1454>:      cmpl   $0x2,(%edx)
0x003725d1 <dl_main+1457>:      je     0x37385a <dl_main+6202>
0x003725d7 <dl_main+1463>:      inc    %esi
0x003725d8 <dl_main+1464>:      add    $0x20,%edx
0x003725db <dl_main+1467>:      cmp    0xfffffefc(%ebp),%esi
---Type <return> to continue, or q <return> to quit---
0x003725e1 <dl_main+1473>:      jb     0x3725c6 <dl_main+1446>
0x003725e3 <dl_main+1475>:      mov    0xffffff00(%ebp),%eax
0x003725e9 <dl_main+1481>:      lea    0x58(%ebx),%edx
0x003725ef <dl_main+1487>:      mov    %edx,0xfffffef8(%ebp)
0x003725f5 <dl_main+1493>:      mov    0x8(%eax),%esi
0x003725f8 <dl_main+1496>:      test   %esi,%esi
0x003725fa <dl_main+1498>:      je     0x37288c <dl_main+2156>
0x00372600 <dl_main+1504>:      mov    (%esi),%edx

eax            0xb7f7a000       -1208508416
ecx            0xd61054 14028884
edx            0x386560 3695968
ebx            0x386508 3695880
esp            0xbfa77cd0       0xbfa77cd0
ebp            0xbfa77e9c       0xbfa77e9c
esi            0x578    1400
edi            0xb7f7a000       -1208508416
eip            0x372600 0x372600
eflags         0x10206  66054
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x0      0

elf/rtld.c:
...
       struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL);
       if (__builtin_expect (l != NULL, 1))
         {
           static ElfW(Dyn) dyn_temp[DL_RO_DYN_TEMP_CNT];

           l->l_phdr = ((const void *) GL(dl_sysinfo_dso)
                        + GL(dl_sysinfo_dso)->e_phoff);
           l->l_phnum = GL(dl_sysinfo_dso)->e_phnum;
           for (uint_fast16_t i = 0; i < l->l_phnum; ++i)
             {
               const ElfW(Phdr) *const ph = &l->l_phdr[i];
               if (ph->p_type == PT_DYNAMIC)
                 {
                   l->l_ld = (void *) ph->p_vaddr;
                   l->l_ldnum = ph->p_memsz / sizeof (ElfW(Dyn));
                   break;
                 }
               if (ph->p_type == PT_LOAD)
                 assert ((void *) ph->p_vaddr == GL(dl_sysinfo_dso));
             }
           elf_get_dynamic_info (l, dyn_temp);
...

elf/dynamic-link.h:
...
static inline void __attribute__ ((unused, always_inline))
elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
{
   ElfW(Dyn) *dyn = l->l_ld;
   ElfW(Dyn) **info;

#ifndef RTLD_BOOTSTRAP
   if (dyn == NULL)
     return;
#endif

   info = l->l_info;

   while (dyn->d_tag != DT_NULL)
     {
       if (dyn->d_tag < DT_NUM)
         info[dyn->d_tag] = dyn;
...

I'm guessing the above is the location of the segfault?
I tried installing the i386 C library but it still segfaults.
John
> 
> 
> 
> --__--__--
> 
> _______________________________________________
> Mach-devel mailing list
> Mach-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mach-devel
> 
> 
> End of Mach-devel Digest
> 






More information about the fedora-legacy-list mailing list