From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 1 08:25:57 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1110416A4BF for ; Mon, 1 Sep 2003 08:25:57 -0700 (PDT) Received: from frontend2.aha.ru (bird.zenon.net [213.189.198.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 813C643FB1 for ; Mon, 1 Sep 2003 08:25:54 -0700 (PDT) (envelope-from uitm@blackflag.ru) Received: from [195.2.90.70] (HELO slt.oz) by frontend2.aha.ru (CommuniGate Pro SMTP 4.0.6) with ESMTP id 211376441 for freebsd-hackers@freebsd.org; Mon, 01 Sep 2003 19:25:51 +0400 Received: (from uitm@localhost) by slt.oz (8.8.8/8.8.8) id TAA00479 for freebsd-hackers@freebsd.org; Mon, 1 Sep 2003 19:28:36 +0400 (MSD) From: Andrey Alekseyev Message-Id: <200309011528.TAA00479@slt.oz> To: freebsd-hackers@freebsd.org Date: Mon, 1 Sep 2003 19:28:34 +0400 (MSD) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: ld-elf/libc problem? (was: php3/php4 problem) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2003 15:25:57 -0000 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