php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14218 using pspell functions cause apache to Abort
Submitted: 2001-11-25 14:57 UTC Modified: 2002-02-22 06:57 UTC
From: beckman at purplecow dot com Assigned:
Status: Closed Package: Pspell related
PHP Version: 4.0.6 OS: FreeBSD 4.4-STABLE
Private report: No CVE-ID: None
 [2001-11-25 14:57 UTC] beckman at purplecow dot com
Script:
   $q = "foo";
   $pl = pspell_new_personal("/usr/share/dict/acmovies","en");
   $sug = pspell_suggest($pl,$q);
   if (count($sug)>0) {
      echo "Suggestions:<ul>";
      while(list(,$val)=each($sug)) {
         echo "<li>{$val}";
      }
   } else {
      echo "No matches.";
   }
}

Script runs when pspell_new_personal is not included (commented out).  fails with pspell_new function as well.

Configure line:
 './configure' '--with-apxs=/usr/local/sbin/apxs' '--with-config-file-path=/usr/local/etc' '--enable-versioning' '--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd' '--without-mysql' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-zlib' '--with-mysql=/usr/local' '--with-pspell=/usr/local' '--prefix=/usr/local' 'i386--freebsd4.4'

Server Version: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a PHP/4.0.6

Aspell: aspell-0.33.7.1
Pspell: pspell-0.12.2_1
Ispell: ispell-3.1.20c_2
mod_PHP: mod_php4-4.0.6_5

Apache error line: 
[date] [notice] child pid X exit signal Abort trap (6)

Successfully compiled example-c and tested it in pspell.

All pspell and aspell directories and files are readable by nobody, directories executable for nobody (others).

httpd does not crash, the child gets an Abort trap (6).  No backtrace available.

Not using Soblot.

PHP compiles correctly, everything works except that when I use pspell functions httpd crashes.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-25 15:00 UTC] beckman at purplecow dot com
Sorry -- That script has an extra close curly brackets that isn't really there.  Please remove that to get desired crashing effect.

Also, http://www.adcritic.com/spellcheck.php is the offending script.  In IE, I get the "The page cannot be displayed."  Telnetting gets me this:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /spellcheck.php?q=foo HTTP/1.0

Connection closed by foreign host.

where if I leave the query blank (it doesn't run the offending pspell function), I get:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /spellcheck.php HTTP/1.0

HTTP/1.1 200 OK
Date: Sun, 25 Nov 2001 19:59:49 GMT
Server: Apache/1.3.22 (Unix) mod_gzip/1.3.19.1a PHP/4.0.6
X-Powered-By: PHP/4.0.6
Set-Cookie: ADCRITICPHPSID=188feaf823cbb54ca102332da63464d8; expires=Sat, 23-Feb-02 19:59:49 GMT; path=/; domain=.adcritic.com
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Connection: close
Content-Type: text/html

<form action="/spellcheck.php" method="GET">
<input name='q' type='text'>
</form>
Connection closed by foreign host.

If q is empty, the script isn't executed (if !empty($q)) etc...

 [2001-11-29 18:30 UTC] vlad@php.net
hmmm... It does not crash, it does not let you have a backtrace, yet it doesn't work either. And you seem to have followed most of the installation instructions and have recent versions of everything. On top of that I know nothing concerning FreeBSD, and do not have a FreeBSD machine.

Couple questions:

1. Can you execute and use example-c as nobody (I know you executed it, period, but probably with more permissions, so this might not work.

2. Is /usr/share/dict/acmovies is a *file* (not a dir) in the .pws format? I know, it's kinda stupid to askm but just in case...

Besides that, I have no clues right now. Any ideas? anyone?

 [2001-11-29 19:22 UTC] beckman at purplecow dot com
Answers:

1. Built pspell from scratch again, uninstalled and reinstalled, su'ed to nobody, executed example-c with success, ran a few lookups.  Cut and paste:
 --> su - nobody -c id
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
--> su - nobody -c "`pwd`/example-c en"
Using: en---aspell

Type "h" for help.

s recieve

receive
receiver
Recife
relieve
received
receives
[...]

2. I wasn't sure what the pws format looked like, so I threw out the personal one and just tried pspell_new("en");, with no luck.  I put an echo and exit before the pspell_new, and it works fine.  Put an echo and an exit AFTER the pspell_new call, and it "Abort"s the apache thread. 
[Thu Nov 29 19:10:42 2001] [notice] child pid 79097 exit signal Abort trap (6)

Could it be that we're running mod_gzip?  I wouldn't think so, but we are using it.  We are also using the Zend PHP Optimizer.

I'm happy to install PHP on a FreeBSD box and give you access if you want to play, though it wouldn't be the box I'm having trouble with, and I haven't tested the pspell failure on that install.

 [2001-11-30 17:07 UTC] vlad@php.net
thanks for offering access to a freebsd box... i do not think that's going to help a lot though 'cause I won't have time to get to it soon (overtime job and getting married at the same time, ouch!).

I'll look more into it later, but if someone with more experience with freebsd can look into it, that would be great. I am no UNIX guru, by any means. I don't even know why your apache doesn't give you a core. No, I do not know whether mod_gzip or zend optimizer contribute, I would imagine, it shouldn't contribute much, but you could try to eliminate those two possibilities by not using them and see if that helps.

In short, does anyone feel up to picking this bug up? It seems like it's something simple yet fundamental. I lack the time and knowledge. Otherwise I'll get back to it a bit later (probably ver 4.2 or so)
 [2002-02-22 06:57 UTC] yohgaki@php.net
This bug has been fixed in CVS.

I suppose this is fixed in CVS. Please test CVS version and report back if you still have this problem.
 [2002-05-13 11:12 UTC] dh at wordassault dot com
I'm having this problem with php 4.2.0 on FreeBSD 4.5.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 23:01:29 2024 UTC