Bug #76594 [Com]: Bus Error due to unaligned access in zend_ini.c OnUpdateLong

From: Date: Sun, 08 Jul 2018 22:30:44 +0000
Subject: Bug #76594 [Com]: Bus Error due to unaligned access in zend_ini.c OnUpdateLong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216237@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76594&edit=1

 ID:                 76594
 Comment by:         rainer dot jung at kippdata dot de
 Reported by:        rainer dot jung at kippdata dot de
 Summary:            Bus Error due to unaligned access in zend_ini.c
                     OnUpdateLong
 Status:             Feedback
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Solaris Sparc 32 Bit
 PHP Version:        7.3.0alpha3
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Confirmed, the patch fixes it. Great job, thanks a lot!


Previous Comments:
------------------------------------------------------------------------
[2018-07-08 13:34:47] cmb@php.net

Ah!  While mbstring.strict_detection is not new, it has been
declared as long in PHP 7.2.7[1].

Rainer, please try with the attached patch.

[1] <https://github.com/php/php-src/blob/php-7.2.7/ext/mbstring/mbstring.h#L190>

------------------------------------------------------------------------
[2018-07-08 13:34:07] cmb@php.net

The following patch has been added/updated:

Patch Name: mbstring.strict_detection
Revision:   1531056846
URL:        https://bugs.php.net/patch-display.php?bug=76594&patch=mbstring.strict_detection&revision=1531056846

------------------------------------------------------------------------
[2018-07-08 13:13:24] nikic@php.net

The issue is that mbstring.strict_detection uses OnUpdateLong instead of OnUpdateBool in https://github.com/php/php-src/blob/php-7.3.0alpha3/ext/mbstring/mbstring.c#L1503.
I don't think the option is new though.

------------------------------------------------------------------------
[2018-07-08 13:08:19] cmb@php.net

Thanks!

> I didn't find the code that sets mh_arg1 to 97 (decimal).

That appears to be an issue with the mbstring module globals[1].
Apparently, these are not properly aligned.

[1] <https://github.com/php/php-src/blob/php-7.3.0alpha3/ext/mbstring/mbstring.h#L139-L174>

------------------------------------------------------------------------
[2018-07-08 12:45:12] rainer dot jung at kippdata dot de

It does not happen for 7.2.7. I did not test any 7.3 alpha before.

Compiler is gcc 7.3.0.

Bus errors due to bad alignment are well-lknown on Solaris. I didn't find the code that sets
mh_arg1 to 97 (decimal).

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=76594


--
Edit this bug report at https://bugs.php.net/bug.php?id=76594&edit=1


Thread (10 messages)

« previous php.bugs (#216237) next »