From: crrodriguez at opensuse dot org
Operating system: Linux ia64
PHP version: 5.2CVS-2009-03-19 (CVS)
PHP Bug Type: *General Issues
Bug description: Aligment issues in mbstring and sysvshm extensions
Description:
------------
in platforms which strictly alignment is required, we still have some
bugs..
patch:
--- ext/mbstring/oniguruma/regint.h
+++ ext/mbstring/oniguruma/regint.h
@@ -256,7 +256,7 @@
#define NULL_UCHARP ((UChar* )0)
#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
-#define WORD_ALIGNMENT_SIZE SIZEOF_INT
+#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
(pad_size) = WORD_ALIGNMENT_SIZE \
--- ext/sysvshm/sysvshm.c
+++ ext/sysvshm/sysvshm.c
@@ -375,7 +375,7 @@ static int php_put_shm_data(sysvshm_chun
long total_size;
long shm_varpos;
- total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 4) * 4 + 4;
/* 4-byte alligment */
+ total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / sizeof(long))
* sizeof(long) + sizeof(long); /* long alligment */
if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) {
php_remove_shm_data(ptr, shm_varpos);
Reproduce code:
---------------
-----
Expected result:
----------------
------
Actual result:
--------------
--------
--
Edit bug report at http://bugs.php.net/?id=47721&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47721&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47721&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47721&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47721&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47721&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47721&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47721&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47721&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47721&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47721&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47721&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47721&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47721&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47721&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47721&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47721&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47721&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47721&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47721&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47721&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47721&r=mysqlcfg