|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76440 free(): invalid pointer
Submitted: 2018-06-10 08:46 UTC Modified: 2020-03-08 10:37 UTC
Avg. Score:3.7 ± 0.9
Reproduced:1 of 3 (33.3%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: spam2 at rhsoft dot net Assigned: krakjoe (profile)
Status: Closed Package: MySQLi related
PHP Version: 7.2Git-2018-06-10 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:


 [2018-06-10 08:46 UTC] spam2 at rhsoft dot net
7.2.7RC1 is fine, but every recent GIT tarball has the same crashes
i have no reproducer because that's the cleanup cronjob from a 250000 LOC codebase over 5 virtual hosts as a daily cronjob

BTW: 7.2.7-dev shoud be 7.2.8-dev now

[root@testserver:~]$ cat messages
Jun 10 10:08:11 testserver php[270845]: free(): invalid pointer
Jun 10 10:08:11 testserver systemd[1]: Started Process Core Dump (PID 270859/UID 0).
Jun 10 10:08:11 testserver systemd-coredump[270860]: Process 270857 (php) of user 4500 dumped core.
Stack trace of thread 270857:
#0  0x00007f934ddbc660 raise (
#1  0x00007f934ddbdc41 abort (
#2  0x00007f934ddfef17 __libc_message (
#3  0x00007f934de0521a malloc_printerr (
#4  0x00007f934de06d5c _int_free (
#5  0x00007f934d664b64 n/a (
#6  0x00007f934d663f02 n/a (
#7  0x00007f934d663d56 n/a (
#8  0x00007f934d663d38 n/a (
#9  0x00007f934d663cf2 n/a (
#10 0x00007f934d663a5f n/a (
#11 0x00007f934d63a58a n/a (
#12 0x00007f934d63a507 n/a (
#13 0x00005646a56ca880 execute_ex (php)
#14 0x00005646a575623a zend_execute (php)
#15 0x00005646a57473f4 zend_execute_scripts (php)
#16 0x00005646a572e404 php_execute_script (php)
#17 0x00005646a576834c n/a (php)
#18 0x00005646a567e36b n/a (php)
#19 0x00007f934dda8f2a __libc_start_main (
#20 0x00005646a56e992a _start (php)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-10 10:40 UTC]
-Assigned To: +Assigned To: johannes
 [2018-06-10 10:40 UTC]
This might be related to commit d6e81f0[1].  Johannes, could you
have a look at this issue please?

[1] <;a=commit;h=d6e81f0bfd0cb90586dd83d4fd47a4302605261a>
 [2018-06-12 17:13 UTC] spam2 at rhsoft dot net

the same with current 7.2 GIT

so now we have a master where opcache crashes and a 7.2 tree which still says it's 7.2.7-dev while the changelog has entries for 7.2.8 crahsing with mysqlnd

gdb don't really help even with a debug build, the only stacktrace i get is from systemd when running as oneshot-service

[root@testserver:~]$ systemctl start contentlounge-cleanup.service
[root@testserver:~]$ cat messages
Jun 12 19:12:34 testserver php[518756]: free(): invalid pointer
Jun 12 19:12:34 testserver systemd[1]: Started Process Core Dump (PID 518763/UID 0).
Jun 12 19:12:34 testserver systemd-coredump[518764]: Process 518762 (php) of user 4500 dumped core.

Stack trace of thread 518762:
#0  0x00007f8f519ba660 raise (
#1  0x00007f8f519bbc41 abort (
#2  0x00007f8f519fcf17 __libc_message (
#3  0x00007f8f51a0321a malloc_printerr (
#4  0x00007f8f51a04d5c _int_free (
#5  0x00007f8f44156249 _mysqlnd_pefree (
#6  0x00007f8f441451fb mysqlnd_mysqlnd_conn_data_free_contents_pub (
#7  0x00007f8f441455da mysqlnd_mysqlnd_conn_data_dtor_priv (
#8  0x00007f8f4414ca82 mysqlnd_mysqlnd_conn_data_free_reference_priv (
#9  0x00007f8f441516cc mysqlnd_mysqlnd_conn_dtor_priv (
#10 0x00007f8f44151b5d mysqlnd_mysqlnd_conn_close_pub (
#11 0x00007f8f43f18175 php_mysqli_close (
#12 0x00007f8f43f1215a mysqli_link_free_storage (
#13 0x00005614f98cf3e2 zend_objects_store_free_object_storage (php)
#14 0x00005614f9863dc7 shutdown_executor (php)
#15 0x00005614f987e807 zend_deactivate (php)
#16 0x00005614f97ebb17 php_request_shutdown (php)
#17 0x00005614f9969851 do_cli (php)
#18 0x00005614f9969f2c main (php)
#19 0x00007f8f519a6f2a __libc_start_main (
#20 0x00005614f9653cea _start (php)

[wwwcron@testserver:~]$ /usr/bin/php /Volumes/dune/updateservice/distribute/call_cronjob.php cleanup.php
free(): invalid pointer
[wwwcron@testserver:~]$ gdb --args /usr/bin/php /Volumes/dune/updateservice/distribute/call_cronjob.php cleanup.php
GNU gdb (GDB) Fedora 8.0.1-36.fc27
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/php...done.
(gdb) run
Starting program: /usr/bin/php /Volumes/dune/updateservice/distribute/call_cronjob.php cleanup.php
Missing separate debuginfos, use: dnf debuginfo-install php-cli-7.2.8-3.0.fc27.20180612.1853.rh.sandybridge.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/".
Detaching after fork from child process 518628.
Detaching after fork from child process 518629.
Detaching after fork from child process 518630.
Detaching after fork from child process 518631.
free(): invalid pointer
Detaching after fork from child process 518634.
[Inferior 1 (process 518624) exited normally]
(gdb) bt
No stack.
 [2018-06-14 08:43 UTC]
-Status: Assigned +Status: Feedback
 [2018-06-14 08:43 UTC]
This issue should be fixed by Can you please verify that current 7.2 HEAD resolves this problem for you?
 [2018-06-14 09:22 UTC] spam2 at rhsoft dot net
confirmed - thanks!

p.s.: the bugtracker is terrible slow currently and ends in repeated timeouts
 [2018-06-14 09:30 UTC]
-Status: Feedback +Status: Assigned -Assigned To: johannes +Assigned To: krakjoe
 [2018-06-14 09:30 UTC]
Thanks for checking! Assigning this to krakjoe to make sure this fix is cherry-picked into the 7.1 release (or else the original change reverted).
 [2020-03-08 10:37 UTC]
-Status: Assigned +Status: Closed
 [2020-03-08 10:37 UTC]
PHP 7.1 doesn't appear to be affected by this, but has reached
it's end of life anyway, so I'm closing this ticket.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Mar 31 14:01:23 2020 UTC