Opened 11 years ago

Closed 8 years ago

#185 closed defect (worksforme)

Using a php script for sendmail_path causes segmentation fault

Reported by: blueyed Owned by: moo
Priority: major Milestone: 1.3.2
Component: cacher Version: 1.2.2
Keywords: Cc:
Application: PHP Version: 5.2.6
Other Exts: SAPI: Others
Probability: Blocked By:


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

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

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 (3)

comment:1 Changed 11 years 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?

comment:2 Changed 11 years 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.

comment:3 Changed 8 years ago by moo

  • Resolution set to worksforme
  • Status changed from new to closed

works for me in 1.3.2-dev

Note: See TracTickets for help on using tickets.