Closed 769344359 closed 4 years ago
我自己跑make test
是通过测试的
=====================================================================
TIME START 2019-12-16 16:43:18
=====================================================================
PASS Check for seaslog presence [tests/001.phpt]
PASS Check for seaslog_get_version [tests/002.phpt]
PASS Check for seaslog_get_author [tests/003.phpt]
PASS Check for setBasePath [tests/004.phpt]
PASS Check for setLogger [tests/005.phpt]
PASS Check for setDatetimeFormat [tests/006.phpt]
PASS Check for setRequestID [tests/007.phpt]
PASS Check for SeasLog log functions with one parameter. [tests/008.phpt]
PASS Check for SeasLog log functions with two parameters. [tests/009.phpt]
PASS Check for SeasLog log functions with three parameters. [tests/010.phpt]
PASS Check for SeasLog::log() function with two parameters. [tests/011.phpt]
PASS Check for SeasLog::log() function with three parameters. [tests/012.phpt]
PASS Check for SeasLog::log() function with four parameters. [tests/013.phpt]
PASS Check for SeasLog::getBuffer() function. [tests/014.phpt]
PASS Check for SeasLog::closeLoggerStream() function. [tests/015.phpt]
FAIL Check for SeasLog::analyzerCount() function. [tests/016.phpt]
FAIL Check for SeasLog::analyzerDetail() function. [tests/017.phpt]
PASS Check for new SeasLog(). [tests/018.phpt]
PASS Check for SeasLog::setRequestVariable() and SeasLog::getRequestVariable() function. [tests/019.phpt]
PASS Check for SeasLog::setLogger() function. [tests/020.phpt]
PASS Check for SeasLog::getBufferCount() function. [tests/021.phpt]
PASS pr 284 [tests/022.phpt]
=====================================================================
TIME END 2019-12-16 16:43:19
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 30
---------------------------------------------------------------------
Number of tests : 22 22
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 2 ( 9.1%) ( 9.1%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 20 ( 90.9%) ( 90.9%)
---------------------------------------------------------------------
Time taken : 1 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Check for SeasLog::analyzerCount() function. [tests/016.phpt]
Check for SeasLog::analyzerDetail() function. [tests/017.phpt]
=====================================================================
php 5.6
(gdb) bt
#0 get_code_filename_line (result=0x7ffffffe9fc0) at /home/ubuntu/SeasLog/src/Request.c:329
#1 0x00007ffff3eaa30e in seaslog_template_formatter (xbuf=0x7fffffffa050, generate_type=2, fmt=0x7ffff7fdc984 "F", level=0x7ffff3eb0a00 "ERROR", ap=0x7fffffffa070)
at /home/ubuntu/SeasLog/src/TemplateFormatter.c:330
#2 0x00007ffff3ea99b2 in seaslog_spprintf (pbuf=0x7fffffffa1a8, generate_type=2, level=0x7ffff3eb0a00 "ERROR", max_len=0) at /home/ubuntu/SeasLog/src/TemplateFormatter.c:157
#3 0x00007ffff3eab5d0 in appender_handle_file (message=0x7ffff7ec89f8 "aaa", message_len=3, level=0x7ffff3eb0a00 "ERROR", level_int=3, logger=0x7ffff7fdcb60, ce=0x55555640eff0)
at /home/ubuntu/SeasLog/src/Appender.c:144
#4 0x00007ffff3eab79e in seaslog_log_ex (argc=1, level=0x7ffff3eb0a00 "ERROR", level_int=3, message=0x7ffff7ec89f8 "aaa", message_len=3, module=0x7ffff3eb1540 "", module_len=0,
ce=0x55555640eff0) at /home/ubuntu/SeasLog/src/Appender.c:190
#5 0x00007ffff3ea32ca in seaslog_log_context_ex (argc=1, check_argc=1, level=0x7ffff3eb0a00 "ERROR", level_int=3, message=0x7ffff7ec89f8 "aaa", message_len=3, context=0x0,
module=0x7ffff3eb1540 "", module_len=0, seaslog_ce=0x55555640eff0) at /home/ubuntu/SeasLog/seaslog.c:384
#6 0x00007ffff3ea3614 in seaslog_log_by_level_common_ex (argc=1, check_argc=1, level=0x7ffff3eb0a00 "ERROR", level_int=3, messages=0x7ffff7fdd038, context=0x0,
logger_str=0x7ffff3eb1540 "", logger_len=0, seaslog_ce=0x55555640eff0) at /home/ubuntu/SeasLog/seaslog.c:456
#7 0x00007ffff3ea37b1 in seaslog_log_by_level_common (ht=1, return_value=0x7ffff7fde8d8, return_value_ptr=0x7fffffffa578, this_ptr=0x0, return_value_used=1,
level=0x7ffff3eb0a00 "ERROR", level_int=3) at /home/ubuntu/SeasLog/seaslog.c:532
#8 0x00007ffff3ea533c in zim_SEASLOG_RES_NAME_error (ht=1, return_value=0x7ffff7fde8d8, return_value_ptr=0x7fffffffa578, this_ptr=0x0, return_value_used=1)
at /home/ubuntu/SeasLog/seaslog.c:1228
#9 0x0000555555a62b85 in zend_call_function (fci=0x7fffffffa5b0, fci_cache=0x7fffffffa580) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_execute_API.c:850
#10 0x0000555555933b6a in zif_forward_static_call_array (ht=2, return_value=0x7ffff7fe0560, return_value_ptr=0x7ffff7fa6328, this_ptr=0x0, return_value_used=0)
at /home/ubuntu/php-src-PHP-5.6.40/ext/standard/basic_functions.c:4934
#11 0x0000555555ac0c81 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7fa6360) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:558
#12 0x0000555555ac675d in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0x7ffff7fa6360) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:2602
#13 0x0000555555ac02e7 in execute_ex (execute_data=0x7ffff7fa6360) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:363
#14 0x0000555555ac0370 in zend_execute (op_array=0x7ffff7fe0fa8) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:388
#15 0x0000555555a629c1 in zend_call_function (fci=0x7fffffffa950, fci_cache=0x7fffffffa920) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_execute_API.c:831
#16 0x0000555555a9acb8 in zend_call_method (object_pp=0x0, obj_ce=0x7ffff7fdfe90, fn_proxy=0x7ffff7fdfff0, function_name=0x555555f5143e "__callstatic", function_name_len=12,
retval_ptr_ptr=0x7fffffffaa28, param_count=2, arg1=0x7ffff7fdfd60, arg2=0x7ffff7fe17d8) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_interfaces.c:97
#17 0x0000555555ab63e8 in zend_std_callstatic_user_call (ht=1, return_value=0x7ffff7fdcf48, return_value_ptr=0x7ffff7fa61f8, this_ptr=0x0, return_value_used=0)
at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_object_handlers.c:1145
#18 0x0000555555ac0c81 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7fa6250) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:558
#19 0x0000555555ac1455 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7ffff7fa6250) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:693
#20 0x0000555555ac02e7 in execute_ex (execute_data=0x7ffff7fa6250) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:363
#21 0x0000555555ac0370 in zend_execute (op_array=0x7ffff7fdde78) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend_vm_execute.h:388
#22 0x0000555555a789d2 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/ubuntu/php-src-PHP-5.6.40/Zend/zend.c:1341
#23 0x00005555559d975e in php_execute_script (primary_file=0x7fffffffd050) at /home/ubuntu/php-src-PHP-5.6.40/main/main.c:2613
#24 0x0000555555b35441 in do_cli (argc=2, argv=0x555556289ae0) at /home/ubuntu/php-src-PHP-5.6.40/sapi/cli/php_cli.c:998
#25 0x0000555555b367a5 in main (argc=2, argv=0x555556289ae0) at /home/ubuntu/php-src-PHP-5.6.40/sapi/cli/php_cli.c:1382
ptr->op_array
也是空的
(gdb) p ptr->op_array
$6 = (zend_op_array *) 0x0
core dump 堆栈
const char *ret;
没有被赋值过,然后strlen(ret)访问了只读地址导致core dump