Iterating on ResourceBundle (using keys) causes segmentation fault
Open
@devnexen is already working on this.
Since Jan 1, 2025.
Bug
Extension: intl
Status: Verified
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
<?php
foreach ((new ResourceBundle('', NULL))->get('calendar')->get('buddhist') as $key => $value)
;
Resulted in:
(segfault)
But I expected:
(no segfault)
On my Windows machine (ICU 75.1), but not only (apparently).
Details
php_intl!resourcebundle_iterator_key+39 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\ext\intl\resourcebundle\resourcebundle_iterator.c @ 107 + e] 0000193`c365e280 0000193`c36900c0 0000000`00130000 0000000`00000000 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\ext\intl\resourcebundle\resourcebundle_iterator.c @ 107 + e
php8!zend_fe_fetch_object_helper_SPEC+e6 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 2981] 0000000`00000000 0000000`00000001 0000000`00000000 0000193`c36142e0 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 2981
php8!ZEND_FE_FETCH_R_SPEC_VAR_HANDLER+25 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 23002 + 8] 0000193`c3614400 0000193`c36142e0 0000000`00000000 0000000`00130000 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 23002 + 8
php8!execute_ex+4f [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 58584 + f] 0000000`00000000 0000000`00000000 000e820`678f0d01 0000193`c1770150 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 58584 + f
php8!zend_execute+140 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 64238] 6328a15`6eea3000 0000193`c3602400 0000193`c366a180 0000000`00000000 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend_vm_execute.h @ 64238
php8!zend_execute_script+201 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend.c @ 1935] 0000000`00000000 0000000`00000000 000008c`223fd0d0 0000193`c3602418 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\Zend\zend.c @ 1935
php8!php_execute_script_ex+277 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\main\main.c @ 2574 + 14] 0000000`00000002 0000000`00000000 0000000`00000002 0000000`00000005 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\main\main.c @ 2574 + 14
php!do_cli+c28 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\sapi\cli\php_cli.c @ 937] 0000000`00000005 0000000`00000004 0000000`00000005 0000193`c585cec0 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\sapi\cli\php_cli.c @ 937
php!main+401 [D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\sapi\cli\php_cli.c @ 1310 + 5] 0000000`00000000 0007ff7`ec55c529 0000193`c177dc80 0000000`00000000 D:\a\php-ftw\php-ftw\php\vs16\x64\php-8.4.1\sapi\cli\php_cli.c @ 1310 + 5
php!__scrt_common_main_seh+10c [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288 + 22] 0000000`00000000 0000000`00000000 0000000`00000000 0000000`00000000 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288 + 22
kernel32!BaseThreadInitThunk+1d 0000000`00000000 0000000`00000000 0000000`00000000 0000000`00000000
ntdll!RtlUserThreadStart+28
PHP Version
PHP 8.4.1
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.