php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21822 unaligned access installing PEAR
Submitted: 2003-01-22 12:09 UTC Modified: 2003-02-23 04:37 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: mtr at media dot mit dot edu Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.0 OS: Tru64
Private report: No CVE-ID: None
 [2003-01-22 12:09 UTC] mtr at media dot mit dot edu
Installing php-4.3.0 with php-4.3.0RC2-stat+onupdateint+zendparam.patch applied on Tru64 5.0A using gcc-3.0.4 results in two unaligned access errors as follows:

./configure --with-apxs=/usr/local/apache_1.3.27/bin/apxs
--enable-trans-sid --with-zlib=/usr/local 
--with-openssl=/usr/local/ssl
--with-imap=../imap-2001a
--with-mysql=/usr/local/mysql-3.23.53
--with-gettext=/usr/local

bash-2.05b# gmake install
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP SAPI module
[activating module `php4' in /usr/local/apache/conf/httpd.conf]
.
.
.
Installing PEAR environment:      /usr/local/lib/php/
Unaligned access pid=213250 <php> va=0x14005c8e4 pc=0x12019e658 ra=0x12019db68 inst=0xb4290000
[PEAR] Archive_Tar    - already installed: 0.9
[PEAR] Console_Getopt - already installed: 1.0
[PEAR] PEAR           - already installed: 1.0b3
Unaligned access pid=213308 <php> va=0x14005c8e4 pc=0x12019e658 ra=0x12019db68 inst=0xb4290000
[PEAR] DB             - already installed: 1.3
.
.
.
etc ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-27 02:56 UTC] spamhole at gmx dot at
We have the 99% same problem on OpenBSD 3.1. Below is the output of 'make install':

root@quenati(php-4.3.0)$ make install
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP SAPI module
[activating module `php4' in /var/www/conf/httpd.conf]
cp libs/libphp4.so /usr/lib/apache/modules/libphp4.so
chmod 755 /usr/lib/apache/modules/libphp4.so
cp /var/www/conf/httpd.conf /var/www/conf/httpd.conf.bak
cp /var/www/conf/httpd.conf.new /var/www/conf/httpd.conf
rm /var/www/conf/httpd.conf.new
Installing shared extensions:
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Installing PEAR environment:      /usr/local/lib/php/
pid 15270 (php): unaligned access: va=0x12021df34 pc=0x120181c10
ra=0x120181c08 op=stq
Bus error (core dumped)
*** Error code 138

Stop in /usr/src/php-4.3.0 (line 196 of Makefile).
*** Error code 1

Stop in /usr/src/php-4.3.0 (line 202 of Makefile).

any suggestions how we can fix this asap?
thanks!
 [2003-01-27 02:58 UTC] spamhole at gmx dot at
forgot to mention - the compiler used is gcc 2.95.3!
 [2003-02-21 10:00 UTC] ddhill at _nospamplease_ dot zk3 dot dec dot com
I have encountered this problem and know where the problem lies.

The problem lies in the use of OnUpdateInt by the zlib extension, and by grep anyway in a half dozen other extensions. Despite the name, OnUpdateInt requires that the target be a long and not an int.

If you modify ext/zlib/php_zlib.h and change

        int output_compression;
        int output_compression_level;

to longs the problem will go away. The reason for this is that OnUpdateInt casts the pointer passed to it as a long* which on Tru64 is 64 bits vs. a 32 bit value for an int. When zlib is initialized, the first value is ok because it happend to be 64 aligned, but the second value is not, and so generates the unaligned warning. This is *not* a trivial problem as the assignment to the long* means the 64 bits gets written into a 32 bit space which means whatever follows in memory get trashed. Given the endian of the machine, the value appears correct if the int is checked though, but you get this apparently "random" data corruption of the next member of the structure.
 [2003-02-21 10:18 UTC] ddhill at zk3 dot dec dot com
This bug has the same root problem as is described in bug 20268.
 [2003-02-23 04:37 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.


Add comments to bug #20268

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 05:01:31 2024 UTC