Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 2003 19:28:34 +0400 (MSD)
From:      Andrey Alekseyev <uitm@blackflag.ru>
To:        freebsd-hackers@freebsd.org
Subject:   ld-elf/libc problem? (was: php3/php4 problem)
Message-ID:  <200309011528.TAA00479@slt.oz>

next in thread | raw e-mail | index | archive | help
Hello,

Two months ago, after a thorough tracking of commits to STABLE, I've built
a 4.8-STABLE distribution. The distribution was built from sources cvsup'd
on Jul 06, 2003 and was targeted to be an upgrade package for a large
production site.

While the customer was testing this distribution, a serious compatibility
problem revealed. Namely, php3+php4 Apache dynamic modules combo stopped
working. Perfectly stable before, this configuration always caused Apache
to crash on 4.8-STABLE (Jul 06). Rebuilding Apache and php didn't help.
Even with the simpliest config, Apache always failed when php3 and php4 were
both enabled.

I spent long hours reading through commit logs since 4.6.2 and I found a
solution. It turns out that backing out the commits below and replacing
certain ld-elf and libc source files with the appropriate old versions
effectively solves php3+php4 dynamic modules configuration.

Frankly speaking, I'm extremely suprised just nobody noticed this problem.
All I could find were two postings from people in Germany. The customer
I worked for, contacted them only to find they had given up and thrown
their php3+php4 combo away.

Btw, this commit
"MFC: r1.69, support binaries with arbitrary number of PT_LOAD segments"
probably also needs suitable modifications to the kernel RLIMIT_VMEM mechanism.

Comments?

Old versions checkout list:

cvs co -r1.10.2.2  include/dlfcn.h
cvs co -r1.20.2.1  include/link.h
cvs co -r1.6       lib/libc/gen/dlfcn.c
cvs co -r1.43.2.11 libexec/rtld-elf/rtld.c
cvs co -r1.7       libexec/rtld-elf/map_object.c
cvs co -r1.3.2.2   libexec/rtld-elf/malloc.c
cvs co -r1.15.2.5  libexec/rtld-elf/rtld.h
cvs co -r1.73.2.12 sys/kern/imgact_elf.c
cvs co -r1.20.2.1  sys/sys/link_elf.h
cvs co -r1.16      sys/vm/vm.h



Commits backed out:

kan         2002/11/29 07:22:17 PST

   Modified files:        (Branch: RELENG_4)
     libexec/rtld-elf     rtld.c
   Log:
   MFC: r1.68 symbool lookup order change.

   Revision   Changes    Path
   1.43.2.12  +12 -12    src/libexec/rtld-elf/rtld.c

kan         2002/11/29 08:05:14 PST

   Modified files:        (Branch: RELENG_4)
     libexec/rtld-elf     map_object.c rtld.c
   Log:
   MFC: r1.69, support binaries with arbitrary number of PT_LOAD segments

   Revision   Changes    Path
   1.7.2.1    +57 -39    src/libexec/rtld-elf/map_object.c
   1.43.2.13  +1 -5      src/libexec/rtld-elf/rtld.c

dillon      2002/12/28 11:49:41 PST

   Modified files:        (Branch: RELENG_4)
     sys/vm               vm.h
     sys/kern             imgact_elf.c
     libexec/rtld-elf     map_object.c
   Log:
   MFC ELF coredump handling fixes.  Do not skip read-only pages unrelated
   to the binary image.  Use NOCORE to differentiate between the two.
   Introduce a debug.elf_legacy_coredump sysctl which, if set, reverts to
   the old behavior.

   See the log message in sys/kern/imgact_elf.c 1.133.

   PR:             kern/45994

   Revision   Changes    Path
   1.7.2.2    +23 -6     src/libexec/rtld-elf/map_object.c
   1.73.2.13  +31 -11    src/sys/kern/imgact_elf.c
   1.16.2.1   +2 -1      src/sys/vm/vm.h

kan         2003/02/20 12:42:46 PST

   Modified files:        (Branch: RELENG_4)
     include              dlfcn.h link.h
     lib/libc/gen         dlfcn.c
     libexec/rtld-elf     malloc.c rtld.c rtld.h
     sys/sys              link_elf.h
   Added files:           (Branch: RELENG_4)
     lib/libc/gen         dlinfo.3
   Log:
   MFC: Properly remove unloaded objects from all lists.
        Implement dlinfo function.

   Aproved by:     re (murray)

   Revision   Changes    Path
   1.10.2.3   +35 -1     src/include/dlfcn.h
   1.20.2.2   +14 -3     src/include/link.h
   1.6.2.1    +9 -1      src/lib/libc/gen/dlfcn.c
   1.3.2.1    +266 -0    src/lib/libc/gen/dlinfo.3 (new)
   1.3.2.3    +18 -1     src/libexec/rtld-elf/malloc.c
   1.43.2.15  +288 -56   src/libexec/rtld-elf/rtld.c
   1.15.2.6   +3 -3      src/libexec/rtld-elf/rtld.h
   1.20.2.2   +14 -3     src/sys/sys/link_elf.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309011528.TAA00479>