Summary | imp/lib/SpellChecker/aspell.php test for ecode broken |
Queue | IMP |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | chuck (at) horde (dot) org |
Requester | liamr (at) umich (dot) edu |
Created | 04/18/2008 (6314 days ago) |
Due | |
Updated | 04/21/2008 (6311 days ago) |
Assigned | 04/18/2008 (6314 days ago) |
Resolved | 04/21/2008 (6311 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
http://cvs.horde.org/diff.php?r1=1.9&r2=1.10&f=imp%2Flib%2FSpellChecker%2Faspell.php
?
comment onto one of the bugs I perceived to be applicable (and that
was still allowing comments). If one of you has an in with the folks
at php.net, could you pursue this?
In the meantime, what about replacing...
if (($ecode = proc_close($process)) != 0) {
with something like..
if (strlen($out) == 0) {
or
if (empty($out)) {
if there's a problem invoking aspell, $out stays empty, but $err gets
filled.. so this seemed like it might work ok?
Maybe ask Ilia what people who _do_ use Oracle should do.
environments re: this issue.
As mentioned in...
http://bugs.php.net/bug.php?id=29123
[16 Jul 2004 1:32am UTC] iliaa@php.net
When sigchild is used the return status from pclose and
proc_close() cannot be retrieved.
And --enable-sigchild is strongly recommended for PHP users using
Oracle. So.. if oracle is going to remain supported, I really think
you have to find another way to judge whether aspell is working than
checking the exit code provided by proc_close()
machine, which I've read might just be another way to say "-1".
I'd like to know why it works (returns exit code 0) in our dev
environment but not our test environment.. but I haven't figured that
out yet. In the meantime, if I rebuild php without --enable-sigchild,
the problem seems to go away. That can't be the answer, tho.
State ⇒ Feedback
$ret = (proc_close($proc) >> 8) & 0xff;
Trick works, and if it still works if you create a genuine failure? We
can't just check for -1, since 0 _is_ being returned in other working
PHP installs.
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ imp/lib/SpellChecker/aspell.php test for ecode broken
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
New Attachment: aspell.log
State ⇒ Unconfirmed
I think I've tracked the issue down. IMP is looking for aspell to
exit with a code of "0" to decide whether the spellcheck works.
imp/lib/SpellChecker/aspell.php ~ ln 67:
if (($ecode = proc_close($process)) != 0) {
require_once 'PEAR.php';
if ($this->_encoding) {
$err = String::convertCharset($err, $this->_encoding,
$charset);
}
return PEAR::raiseError('spellcheck failed: ' . $err, $ecode);
}
proc_close() doesn't return results you think it's returning. See...
http://us2.php.net/manual/en/function.proc-close.php
http://bugs.php.net/bug.php?id=17538
Apparently, it's especially faulty if you compiled php with
--enable-sigchild, which you're told to do if you're trying to use
oracle on linux.
The debugging stubs I placed in aspell.php clearly show that aspell is
being invoked, and is returning the expected output. If I change..
proc_close($process)) != 0
to look for -1, spellchecking works just dandy.