|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-03-03 00:20 UTC] tstarling at wikimedia dot org
Description: ------------ If you use Apache 1.3.x/PHP/APC on an x86_64 architecture, it will segfault on exit in the glibc function do_lookup_x(). This is probably a glibc bug. I have not yet isolated this bug sufficiently for the satisfaction of the glibc developers, but enough to produce a workaround. The issue involves dynamic linking to libraries which depend on libraries with the DF_1_NODELETE flag set in their .dynamic section. The link map for the secondary library is corrupted when Apache shuts down PHP after reading its configuration, i.e. before it forks. The workaround is to not link to any library with DF_1_NODELETE. This includes librt and libpthread. APC only uses librt when SHM is enabled. When using mmap, it is not required. Please change config.m4 to link to librt only when necessary. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
But depending on the configured file mask, I do use shm calls. See apc_mmap.c: /* * If the filemask contains .shm we try to do a POSIX-compliant shared memory * backed mmap which should avoid synchs on some platforms. At least on * FreeBSD this implies MAP_NOSYNC and on Linux it is equivalent of mmap'ing * a file in a mounted shmfs. For this to work on Linux you need to make sure * you actually have shmfs mounted. Also on Linux, make sure the file_mask you * pass in has a leading / and no other /'s. eg. /apc.shm.XXXXXX * On FreeBSD these are mapped onto the regular filesystem so you can put whatever * path you want here. */ if(strstr(file_mask,".shm")) { mktemp(file_mask); fd = shm_open(file_mask, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); if(fd == -1) { apc_eprint("apc_mmap: shm_open on %s failed:", file_mask); return (void *)-1; } if (ftruncate(fd, size) < 0) { close(fd); shm_unlink(file_mask); apc_eprint("apc_mmap: ftruncate failed:"); return (void *)-1; } shmaddr = (void *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); shm_unlink(file_mask); close(fd); } So I can't easily avoid librt here as far as I can tell.