I looked into core dump and I notcied that it fails on php_message_handler_for_zend
function with %s(%d) : Freeing
string format.
In php source code this string is used in one place main/main.c#L1509
#if ZEND_DEBUG
if (EG(error_reporting) & E_WARNING) {
char memory_leak_buf[1024];
if (message==ZMSG_MEMORY_LEAK_DETECTED) {
zend_leak_info *t = (zend_leak_info *) data;
snprintf(memory_leak_buf, 512, "%s(%d) : Freeing " ZEND_ADDR_FMT " (%zu bytes), script=%s\n", t->filename, t->lineno, (size_t)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated));
if (t->orig_filename) {
char relay_buf[512];
snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno);
strlcat(memory_leak_buf, relay_buf, sizeof(memory_leak_buf));
}
} else {
unsigned long leak_count = (zend_uintptr_t) data;
snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":""));
}
# if defined(PHP_WIN32)
OutputDebugString(memory_leak_buf);
# else
fprintf(stderr, "%s", memory_leak_buf);
# endif
}
#endif
It looks this code is responsible for printing messages about memory leaks, when php is complied without --enable-debug
I'm not getting this error.
Core dump backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00000000008d2c02 in format_converter (odp=0x7ffd232284f0, fmt=0x108c769 "s(%d) : Freeing 0x%016zx (%zu bytes), script=%s\n", ap=0x7ffd23228550)
at /home/vagrant/php-uamqp/php-build/src/main/snprintf.c:997
#2 0x00000000008d369c in strx_printv (ccp=0x7ffd2322854c, buf=0x7ffd232288c0 "[Sat Sep 14 17:57:09 2019] Script: '/home/vagrant/php-uamqp/examples/publish_and_receive_to_service_bus.php'\n",
len=512, format=0x108c768 "%s(%d) : Freeing 0x%016zx (%zu bytes), script=%s\n", ap=0x7ffd23228550) at /home/vagrant/php-uamqp/php-build/src/main/snprintf.c:1252
#3 0x00000000008d3947 in ap_php_snprintf (buf=0x7ffd232288c0 "[Sat Sep 14 17:57:09 2019] Script: '/home/vagrant/php-uamqp/examples/publish_and_receive_to_service_bus.php'\n", len=512,
format=0x108c768 "%s(%d) : Freeing 0x%016zx (%zu bytes), script=%s\n") at /home/vagrant/php-uamqp/php-build/src/main/snprintf.c:1297
#4 0x00000000008cde7c in php_message_handler_for_zend (message=4, data=0x7ffd23229970) at /home/vagrant/php-uamqp/php-build/src/main/main.c:1509
#5 0x000000000096b7ac in zend_message_dispatcher (message=4, data=0x7ffd23229970) at /home/vagrant/php-uamqp/php-build/src/Zend/zend.c:1063
#6 0x0000000000930b44 in zend_mm_check_leaks (heap=0x7f6460800040) at /home/vagrant/php-uamqp/php-build/src/Zend/zend_alloc.c:2112
#7 0x0000000000930ea1 in zend_mm_shutdown (heap=0x7f6460800040, full=0, silent=0) at /home/vagrant/php-uamqp/php-build/src/Zend/zend_alloc.c:2184
#8 0x0000000000931c77 in shutdown_memory_manager (silent=0, full_shutdown=0) at /home/vagrant/php-uamqp/php-build/src/Zend/zend_alloc.c:2600
#9 0x00000000008cee2f in php_request_shutdown (dummy=0x0) at /home/vagrant/php-uamqp/php-build/src/main/main.c:1927
#10 0x0000000000a60f6f in do_cli (argc=3, argv=0x2bf02e0) at /home/vagrant/php-uamqp/php-build/src/sapi/cli/php_cli.c:1178
#11 0x0000000000a617dd in main (argc=3, argv=0x2bf02e0) at /home/vagrant/php-uamqp/php-build/src/sapi/cli/php_cli.c:1403