php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76113 mbstring does not build with Oniguruma 6.8.1
Submitted: 2018-03-19 09:23 UTC Modified: 2018-03-20 15:19 UTC
Votes:4
Avg. Score:4.0 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:1 (25.0%)
From: chris at chrullrich dot net Assigned: cmb (profile)
Status: Closed Package: mbstring related
PHP Version: 5.6.34 OS:
Private report: No CVE-ID: None
 [2018-03-19 09:23 UTC] chris at chrullrich dot net
Description:
------------
Oniguruma 6.8.1 moved the implementation of the regex_t type out of its public header.

ext/mbstring/php_mbregex.c:457:31: error: incomplete definition of type 'struct php_mb_re_pattern_buffer'
        if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
                                ~~~~~^
/usr/local/include/oniguruma.h:673:8: note: forward declaration of 'struct php_mb_re_pattern_buffer'
struct re_pattern_buffer;
       ^
./php_onig_compat.h:4:37: note: expanded from macro 're_pattern_buffer'
#define re_pattern_buffer           php_mb_re_pattern_buffer
                                    ^
ext/mbstring/php_mbregex.c:457:60: error: incomplete definition of type 'struct php_mb_re_pattern_buffer'
        if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
                                                             ~~~~~^
/usr/local/include/oniguruma.h:673:8: note: forward declaration of 'struct php_mb_re_pattern_buffer'
struct re_pattern_buffer;
       ^
./php_onig_compat.h:4:37: note: expanded from macro 're_pattern_buffer'
#define re_pattern_buffer           php_mb_re_pattern_buffer
                                    ^
ext/mbstring/php_mbregex.c:457:81: error: incomplete definition of type 'struct php_mb_re_pattern_buffer'
        if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
                                                                                  ~~~~~^
/usr/local/include/oniguruma.h:673:8: note: forward declaration of 'struct php_mb_re_pattern_buffer'
struct re_pattern_buffer;
       ^
./php_onig_compat.h:4:37: note: expanded from macro 're_pattern_buffer'
#define re_pattern_buffer           php_mb_re_pattern_buffer
                                    ^
3 errors generated.
*** [php_mbregex.lo] Error code 1

make[1]: stopped in ext/mbstring
1 error


The fix (see patch) is to use the appropriate API to access Oniguruma's internals.


Patches

fix-bug-76113 (last revision 2018-03-19 09:25 UTC by chris at chrullrich dot net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-19 23:07 UTC] cmb@php.net
Thanks for reporting this issue, the detailed analysis, and for
providing a patch!

The patch looks good, but I wonder which version of Oniguruma
introduced these functions.  It seems that we currently don't
explicitly check for a minimum version – which appears to be
fishy per se.
 [2018-03-19 23:42 UTC] chris at chrullrich dot net
The oldest release I could easily find is 2.3.1, released 2004-06-17, and it has them already.

http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/distfiles/ruby/onigd2_3_1.tar.gz
 [2018-03-20 15:19 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2018-03-20 15:19 UTC] cmb@php.net
Thanks.  Compatibility with Oniguruma 2.3.1 should be more than
sufficient.
 [2018-03-20 16:12 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4072b2787074ee8e247a6639585b49e10c5a55fe
Log: Fix #76113: mbstring does not build with Oniguruma 6.8.1
 [2018-03-20 16:12 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 01:01:30 2024 UTC