PHP code generates a segmentation fault -


edit added.

i getting segmentation fault php ternary operation. i'm using php (5.4.13).

<?php  $t = empty($_get['t2']) ? $_get['t2'] : 'test'; $t = empty($_get['t2']) ? 'test' : $_get['t2'];  echo '<pre>'.print_r($t, true).'</pre>';  ?> 

the statements:

$t = empty($_get['t2']) ? $_get['t2'] : 'test'; $t = empty($_get['t2']) ? 'test' : $_get['t2']; 

dispatches segmentation fault (i checked apache error log this). commented statements above not throw segmentation fault.

i doubt source error, able narrow down. sites use php having problem.

i don't think bug! more error in php installation or in 1 of dependencies. no function used, language features, thought narrowed down pretty easily.

edit: wanted know common problems causes segmentation fault, , if 1 of them can identified above code know solutions , how act. (this question, wonder it)

edit 2: ready now, there no more assignment in $_get, guess advisable , valid. error still there.

edit 3: valgrind, trace is:

==3775== process terminating default action of signal 11 (sigsegv) ==3775==  bad permissions mapped region @ address 0x0 ==3775==    @ 0x0: ??? ==3775==    0xf60f9f7: execute (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775==    0xf5a619f: zend_execute_scripts (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775==    0xf548e87: php_execute_script (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775==    0xf650a94: ??? (in /opt/rh/php54/root/usr/lib64/httpd/modules/libphp5.so) ==3775==    0x133baf: ap_run_handler (in /usr/sbin/httpd) ==3775==    0x13746d: ap_invoke_handler (in /usr/sbin/httpd) ==3775==    0x142b2f: ap_process_request (in /usr/sbin/httpd) ==3775==    0x13f9a7: ??? (in /usr/sbin/httpd) ==3775==    0x13b6b7: ap_run_process_connection (in /usr/sbin/httpd) ==3775==    0x147976: ??? (in /usr/sbin/httpd) ==3775==    0x147c45: ??? (in /usr/sbin/httpd) 

and gdb is:

#0  0x0000000000000000 in ?? () #1  0x00007fc4dd8a49f8 in execute () /etc/httpd/modules/libphp54-php5.so #2  0x00007fc4dd83b1a0 in zend_execute_scripts () /etc/httpd/modules/libphp54-php5.so #3  0x00007fc4dd7dde88 in php_execute_script () /etc/httpd/modules/libphp54-php5.so #4  0x00007fc4dd8e5a95 in ?? () /etc/httpd/modules/libphp54-php5.so #5  0x00007fc4e818dbb0 in ap_run_handler () #6  0x00007fc4e819146e in ap_invoke_handler () #7  0x00007fc4e819cb30 in ap_process_request () #8  0x00007fc4e81999a8 in ?? () #9  0x00007fc4e81956b8 in ap_run_process_connection () #10 0x00007fc4e81a1977 in ?? () #11 0x00007fc4e81a1c46 in ?? () #12 0x00007fc4e81a2293 in ap_mpm_run () #13 0x00007fc4e8179900 in main () 

final edit

as suspected beginning surely corrupted installation of php , it's extensions. code had no problem guess used part of faulty installation. more can added did not found exact cause , it's solution, managing make work again, thank guiding me resolution.

in looking @ code don't believe have errors.

with said mentioned having issues many of sites. wondering if getting hit malicious bots might causing error similar on [php bug report][1]https://bugs.php.net/bug.php?id=59748.[1]:.

i @ logs , see if traffic has changed on sites start taking advantage of issue.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -