Skip to content

Calling setproctitle() reliably causes crash on shutdown #6

@xiongchiamiov

Description

@xiongchiamiov

When upgrading from PHP 5.4 to 5.5, we started seeing errors in our logs. We
finally traced it down to setproctitle().

[#]> cat proctitle.ini
extension=proctitle.so

[#]> cat test.php
<?php

setproctitle('asdf');
[#]> php -n -c proctitle.ini test.php
*** glibc detected *** php: free(): invalid next size (fast): 0x0000000000ff4490 ***
======= Backtrace: =========
/lib64/libc.so.6[0x2aaab0ce92ef]
/lib64/libc.so.6(cfree+0x4b)[0x2aaab0ce973b]
php[0x842795]
php[0x83a90f]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x2aaab0c94994]
php[0x439d99]
======= Memory map: ========
00400000-00d00000 r-xp 00000000 08:01 476115                             /usr/bin/php
00eff000-00fcf000 rw-p 008ff000 08:01 476115                             /usr/bin/php
00fcf000-01268000 rw-p 00fcf000 00:00 0                                  [heap]
2aaaaaaab000-2aaaaaac7000 r-xp 00000000 08:01 753742                     /lib64/ld-2.5.so
[snip]
2aaab1e86000-2aaab545e000 r--p 00000000 08:01 590955                     /usr/lib/locale/locale-archive
7fffaf84b000-7fffaf860000 rw-p 7fffaf84b000 00:00 0                      [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vdso]
Aborted
[#]> php -i | head
phpinfo()
PHP Version => 5.5.10

System => Linux ip-10-101-141-29 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64
Build Date => Mar 28 2014 14:13:54
Configure Command =>  './configure'  '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--enable-shmop' '--enable-calendar' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-pcntl' '--with-imap=/usr/lib64' '--with-imap-ssl=/usr/local/ssl/include/openssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc=shared' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-dom' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-readline' '--with-mcrypt=/usr/local/include/mcrypt' '--with-mhash' '--with-tidy=shared,/usr' '--enable-sigchild' '--enable-intl' '--with-apxs2=/usr/sbin/apxs' '--enable-fpm' '--with-fpm-user=apache' '--with-fpm-group=apache' '--enable-opcache'

This is using proctitle 0.1.2.

cc @danielbeardsley

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions