Bug #75599 [NEW]: Thread Sanitizer error.

From: Date: Thu, 30 Nov 2017 14:14:59 +0000
Subject: Bug #75599 [NEW]: Thread Sanitizer error.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212835@lists.php.net to get a copy of this message
From: rperper at litespeedtech dot com Operating system: OpenSuSE PHP version: 7.2.0 Package: PCRE related Bug Type: Bug Bug description:Thread Sanitizer error. Description: ------------ I am a developer at LiteSpeed Technologies and am working on a thread-capable version of the PHP module to be included in the Open-LiteSpeed web server. During load testing, we got a thread-sanitizer message in parse_tz.c line 389 (see backtrace below) in a call to setlocale. setlocale is not a thread-safe function and this is expected, though not desired, behavior. We noted setlocale in a number of different locations throughout the code and recommend its removal. Test script: --------------- Not reproducible in a script. Actual result: -------------- WARNING: ThreadSanitizer: data race (pid=52259)  Write of size 8 at 0x7d040000d700 by thread T1 (mutexes: write M504):  #0 setlocale /home/abuild/rpmbuild/BUILD/llvm-3.8.0.src/stage2/../projects/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:2523 (openlitespeed+0x000000524600) #1 seek_to_tz_position /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/ext/date/lib/parse_tz.c:389 (mod_lsphp72.so+0x0000002243cc) #2 timelib_timezone_id_is_valid /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/ext/date/lib/parse_tz.c:436 (mod_lsphp72.so+0x00000022430c) #3 zif_date_default_timezone_set /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/ext/date/php_date.c:4835 (mod_lsphp72.so+0x0000001777df) #4 ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/Zend/zend_vm_execute.h:573 (mod_lsphp72.so+0x0000014a67c8) #5 execute_ex /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/Zend/zend_vm_execute.h:59726 (mod_lsphp72.so+0x0000013c3345) #6 zend_execute /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/Zend/zend_vm_execute.h:63763 (mod_lsphp72.so+0x0000013c3c60) #7 zend_execute_scripts /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/Zend/zend.c:1496 (mod_lsphp72.so+0x0000012d2adc) #8 php_execute_script /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/main/main.c:2592 (mod_lsphp72.so+0x0000010d17a9) #9 lsiapi_execute_script /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/sapi/mod_lsphp/mod_lsphp.c:1400 (mod_lsphp72.so+0x00000158ad02) #10 lsiapi_module_main /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/sapi/mod_lsphp/mod_lsphp.c:1509 (mod_lsphp72.so+0x000001586718) #11 process_req /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/sapi/mod_lsphp/mod_lsphp.c:1536 (mod_lsphp72.so+0x0000015847c5) #12 mod_lsphp_begin_process /home/user/proj/openlitespeed/src/modules/mod_lsphp/php-7.2/sapi/mod_lsphp/mod_lsphp.c:1667 (mod_lsphp72.so+0x00000157f3a0) #13 MtHandlerProcess(ls_lfnodei_s*) /home/user/proj/openlitespeed/src/lsiapi/modulehandler.cpp:46 (openlitespeed+0x00000088ced5) #14 WorkCrew::workerRoutine(CrewWorker*) /home/user/proj/openlitespeed/src/thread/workcrew.cpp:448 (openlitespeed+0x000000944a11) #15 CrewWorker::thr_main(void*) /home/user/proj/openlitespeed/src/thread/crewworker.cpp:36 (openlitespeed+0x00000094531e) #16 Thread::start_routine(void*) /home/user/proj/openlitespeed/src/thread/thread.cpp:43 (openlitespeed+0x000000942657) -- Edit bug report at https://bugs.php.net/bug.php?id=75599&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75599&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75599&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75599&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75599&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75599&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75599&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75599&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75599&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75599&r=support Expected behavior: https://bugs.php.net/fix.php?id=75599&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75599&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75599&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75599&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75599&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75599&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75599&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75599&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75599&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75599&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75599&r=mysqlcfg

« previous php.bugs (#212835) next »