Ticket #185 (new defect)

Opened 3 months ago

Last modified 3 months ago

Using a php script for sendmail_path causes segmentation fault

Reported by: blueyed Owned by: moo
Priority: major Milestone: 1.3.0
Component: cacher Version: 1.2.2
Keywords: Cc:
Blocked By: PHP Version: 5.2.6
Application: Need User Feedback: no
Other Exts: SAPI: Others
Probability: Blocking:

Description

I've noticed that "mail()" failed on my webserver, since I've installed XCache:

# php -d sendmail_path="/usr/local/bin/sendmail_test" -r "var_dump( mail('EMAIL', 'test', 'test') );"
/dev/zero: No space left on device
Failed creating file mappping
PHP Fatal error:  Failed creating file mappping in Unknown on line 0
PHP Fatal error:  XCache: Cannot create shm in Unknown on line 0
testSegmentation fault
bool(false)

/usr/local/bin/sendmail_test looks as follows:

#!/usr/bin/php
<?php
echo "test";
?>

Executing sendmail_test itself works fine, only when used for sendmail_path it fails.

The workaround for me is to use "#!/usr/bin/php -n" for this script (-n for "no ini and therefore also no xcache). Debian/Ubuntu uses the same conf.d directories for CLI and CGI, otherwise I might have disabled XCache for CLI instead.

If you need more information, like e.g. a backtrace in case you cannot reproduce this, please let me know.

Change History

Changed 3 months ago by moo

iirc i have fixed the segv issue, but it is a problem if it still "Segmentation fault"

"Failed creating file mappping" is not a bug, as we can see "No space left on device", it's just something like out of memory (limit)

can u pls check your ulimit or whatever limit that relatived to memory or shared memory?

Changed 3 months ago by moo

btw, the reason it "out of memory" in this specified case, is because when the parent (the var_dump one) is executed, shared memory is allocated for this process, and when sendmail_path is executed as another process, one more shm is allocated which might have exceeded the limitation.

php.ini for cli is not recommended to enable XCache anyway.

Note: See TracTickets for help on using tickets.