php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67715 php-milter does not build and crashes randomly
Submitted: 2014-07-30 11:53 UTC Modified: 2014-07-30 18:15 UTC
From: attb2 at torzsasztal dot hu Assigned: mike (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.4.31 OS: Linux Ubuntu, Debian
Private report: No CVE-ID: None
 [2014-07-30 11:53 UTC] attb2 at torzsasztal dot hu
Description:
------------
I've built php-milter SAPI on Ubuntu 12.04.
PHP version: 5.4.31 downloaded from php.net

Installed extra packages:
apt-get install libmilter-dev libxml2-dev libmysqlclient-dev

Build script:
./configure --prefix=/usr/local/php54 \
 --with-milter=yes \
 --with-pdo-mysql=mysqlnd
make fails with error message:
libtool: link: `sapi/milter/php_milter.lo' is not a valid libtool object

I have to build the getopt.lo and php_milter.lo files manually:
/bin/bash /usr/local/src/php-5.4.31/libtool --silent --preserve-dup-deps --mode=compile /usr/local/src/php-5.4.31/meta_ccld -Isapi/milter/ -DPHP_ATOM_INC -I/usr/local/src/php-5.4.31/include -I/usr/local/src/php-5.4.31/main -I/usr/local/src
/php-5.4.31 -I/usr/local/src/php-5.4.31/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/src/php-5.4.31/TSRM -I/usr/local/src/php-5.4.31/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS  -c /usr/local/src/php-
5.4.31/sapi/milter/getopt.c -o sapi/milter/getopt.lo
/bin/bash /usr/local/src/php-5.4.31/libtool --silent --preserve-dup-deps --mode=compile /usr/local/src/php-5.4.31/meta_ccld -Isapi/milter/ -DPHP_ATOM_INC -I/usr/local/src/php-5.4.31/include -I/usr/local/src/php-5.4.31/main -I/usr/local/src
/php-5.4.31 -I/usr/local/src/php-5.4.31/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/src/php-5.4.31/TSRM -I/usr/local/src/php-5.4.31/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS  -c /usr/local/src/php-
5.4.31/sapi/milter/php_milter.c -o sapi/milter/php_milter.lo

then make, make install.

I start php-milter with example milter.php script.
When I connect to localhost:25 and send SMTP emails it randomly crashes.

Syslog:
kernel: [1390948.241287] php-milter[31837]: segfault at 42 ip 00000000006e59b8 sp 00007ff237c86980 error 4 in php-milter[400000+7d5000]



Test script:
---------------
Start php-milter:
/tmp/bin/php-milter -a -p inet:3340 -f /tmp/bin/milter.php

It listens on port 3340 and works for a while.

SMTP commands:
telnet localhost 25
ehlo localhost
MAIL FROM: test@domain.local
RCPTO TO: test@domain.local
data
test sample
.

/tmp/milter.log:
[12:06:19 30.07.2014]	-- startup --
[12:06:19 30.07.2014]	milter_init()
[12:06:33 30.07.2014]	milter_connect('localhost')
[12:06:42 30.07.2014]	milter_envfrom(args[])
[12:06:42 30.07.2014]		args[0] = test@domain.local
[eof]



Expected result:
----------------
To run in daemon mode forever without crash. :-)

Actual result:
--------------
It crashes with segfault.
kernel: [1391258.670146] php-milter[31943]: segfault at 42 ip 00000000006e59b8 sp 00007f94390e2980 error 4 in php-milter[400000+7d5000]


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-30 13:02 UTC] attb2 at torzsasztal dot hu
strace gave me this output when daemon crashes:

/usr/local/src/php-5.4.31/Zend/zend_hash.c(1055) : ht=0x7f62bc0948c8 is already destroyed
/usr/local/src/php-5.4.31/Zend/zend_hash.c(551) : ht=0x7f62bc0bdcb8 is already destroyed
/usr/local/src/php-5.4.31/Zend/zend_hash.c(683) : ht=0x7f62bc0948c8 is already destroyed
 [2014-07-30 18:11 UTC] mike@php.net
-Summary: php-milter crashes randomly +Summary: php-milter does not build and crashes randomly -Assigned To: +Assigned To: mike
 [2014-07-30 18:15 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-07-30 18:15 UTC] mike@php.net
-Status: Assigned +Status: Closed
 [2014-07-30 18:15 UTC] mike@php.net
I fixed an obvious crash. For anything else, I'd need a real backtrace.
 [2014-08-04 08:26 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-08-04 08:43 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-08-04 09:59 UTC] dmitry@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-08-14 00:52 UTC] tyrael@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-10-07 23:13 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 [2014-10-07 23:24 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=12b2127b72543710590887d8bcf26be9e02bcc71
Log: Fixed bug #67715 (php-milter does not build and crashes randomly).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC