Share

Hunspell

Tracker: Bugs

5 Segmentation fault - ID: 1951087
Last Update: Comment added ( nemethl )

I get a segmentation fault when I call hunspell from a PHP application
using shell_exec() or exec(). This happens for all versions >=1.1.6. For
all version <=1.1.5 it runs fine though. It also works without problems on
the command line, so I guess it is somehow related to the locale encoding.


I tested with default installations of PHP on Ubuntu 7.10, 8.4 and Debian
4. Any insight would be greatly appreciated.

Regards


Michel Weimerskirch ( michel_w ) - 2008-04-24 19:27

5

Closed

None

Németh László

None

None

Public


Comments ( 3 )




Date: 2008-06-17 08:40
Sender: nemethlProject Admin


Fixed in Hunspell 1.2.3. Thanks, Laci

Here is my test PHP code:

<?
$word = $_POST["word"];
?>
<html><title>Hunspell example</title>
<body>
<h1>Hunspell suggestions</h1>

<form method="post" action="<?php echo $PHP_SELF;?>">
Word: <input type="text" size="12" maxlength="12" name="word">
<input type="submit" value="submit" name="submit"><br />
</form>

<?
echo "<h2>", $word, "</h2>";
if ($word != "") {
exec('echo ' . $word . ' | hunspell -d en_US', $a);
if (sizeof($a) > 1) echo $a[sizeof($a)-2];
}
?>

</html>
</body>



Date: 2008-04-25 11:32
Sender: nemethlProject Admin


Michel, the problem may be the Hunspell incompatibility of the restricted
environment of PHP shell_exec. Could you run Hunspell with different
options, for example, -h, -D, or setting environmental variables "HOME=/tmp
/usr/bin/hunspell", and report the results? Thanks in advance, László


Date: 2008-04-24 20:25
Sender: michel_w


Here is the corresponding message from /var/log/messages

Apr 24 22:22:57 B026 kernel: hunspell[9525]: segfault at 00000000 eip
b7cbe283 esp bff303fc error 4

(This is from hunspell 1.1.9 which comes with Ubuntu 7.10. Newser version
produce similar messages)


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2008-06-17 08:40 nemethl
close_date - 2008-06-17 08:40 nemethl
assigned_to nobody 2008-04-25 11:32 nemethl