Bug #75525 [NEW]: Access Violation in vcruntime140.dll

From: Date: Tue, 14 Nov 2017 17:48:58 +0000
Subject: Bug #75525 [NEW]: Access Violation in vcruntime140.dll
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212583@lists.php.net to get a copy of this message
From: john-stevenson at blueyonder dot co dot uk Operating system: Windows 10 PHP version: 7.2.0RC6 Package: Reproducible crash Bug Type: Bug Bug description:Access Violation in vcruntime140.dll Description: ------------ When running on Windows with PHP_INI_SCAN_DIR set, php will either crash or misreport information when running php --ini. This did not happen on pre-7.2 versions. php_init_config() calls PHPAPI php_scandir and the directory list returned has corrupted dirent->d_name values. This either causes an access violation when calling strrchr from the runtime, or results in any ini file in the directory being correctly reported, not reported or reported multiple times. The crashes seem to happen more frequently when the target folder contains 200 + entries, although the misreported data can happen with a single entry. Test script: --------------- // The crashes happen more frequently on a debug build, so: configure --disable-all --enable-cli --enable-debug --disable-zts // Using my temp folder which has lots of stuff in it run: SET PHP_INI_SCAN_DIR=C:\Users\John\AppData\Local\Temp add an .ini file to the chosen folder (for example 'scan-dir.ini'). It isn't actually needed but it helps show the misreported data. run: php.exe --ini Expected result: ---------------- Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: (none) Scan for additional .ini files in: C:\Users\John\AppData\Local\Temp Additional .ini files parsed: C:\Users\John\AppData\Local\Temp\scan-dir.ini Actual result: -------------- A crash: > vcruntime140d.dll!strrchr(const char * string, int ch) Line 203 C Non-user code. Symbols loaded. php7_debug.dll!php_init_config() Line 687 C Symbols loaded. php7_debug.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules, unsigned int num_additional_modules) Line 2250 C Symbols loaded. php.exe!php_cli_startup(_sapi_module_struct * sapi_module) Line 431 C Symbols loaded. php.exe!main(int argc, char * * argv) Line 1371 C Symbols loaded. [External Code] Annotated Frame Unhandled exception thrown: read access violation. **string** was 0x193A4B4A600. occurred ----- Or missing data: Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: (none) Scan for additional .ini files in: C:\Users\John\AppData\Local\Temp Additional .ini files parsed: (none ----- Or duplicate data: Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: (none) Scan for additional .ini files in: C:\Users\John\AppData\Local\Temp Additional .ini files parsed: C:\Users\John\AppData\Local\Temp\scan-dir.ini, C:\Users\John\AppData\Local\Temp\scan-dir.ini, C:\Users\John\AppData\Local\Temp\scan-dir.ini -- Edit bug report at https://bugs.php.net/bug.php?id=75525&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75525&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75525&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75525&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75525&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75525&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75525&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75525&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75525&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75525&r=support Expected behavior: https://bugs.php.net/fix.php?id=75525&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75525&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75525&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75525&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75525&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75525&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75525&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75525&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75525&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75525&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75525&r=mysqlcfg

« previous php.bugs (#212583) next »