|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81696 crash on mysqly::query -- mysqli_query
Submitted: 2021-12-03 16:41 UTC Modified: 2021-12-29 13:13 UTC
Avg. Score:4.3 ± 0.9
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: info at infreschilab dot it Assigned:
Status: Open Package: MySQLi related
PHP Version: 8.1.1 OS: Slackware 15 arm
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: info at infreschilab dot it
New email:
PHP Version: OS:


 [2021-12-03 16:41 UTC] info at infreschilab dot it
mysqli_query(mysqli $mysql, string $query) crash

Test script:
$mysqli = new mysqli("localhost", "my_user", "my_password", "my_db");
$result = $mysqli->query("SELECT * FROM my_table");

Expected result:
Select queries return a resultset

Actual result:
Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-03 17:14 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-12-03 17:14 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2021-12-04 14:49 UTC] info at infreschilab dot it
-Status: Feedback +Status: Open
 [2021-12-04 14:49 UTC] info at infreschilab dot it
The official php Slackware package is compiled without debugging symbols, but the test in easily to reproduce. The mysqli driver is unusable.
 [2021-12-04 15:01 UTC]
-Assigned To: cmb +Assigned To:
 [2021-12-04 15:01 UTC]
Maybe it is an issue with the official php Slackware package.  Did
you report it there?
 [2021-12-13 09:32 UTC] info at infreschilab dot it
in the apache log:

malloc(): corrupted top size
[Mon Dec 13 10:28:43.737687 2021] [core:notice] [pid 1149:tid 3069336320] AH00052: child pid 11264 exit signal Abort (6)
 [2021-12-13 15:17 UTC] info at infreschilab dot it
new info:

if mariadb accept external connecion and mysqli_connect connect to "", works fine. Else if mysqli_connect connect to "localhost", crashes ( malloc(): corrupted top size ).

Tested on ARM hardware.
 [2021-12-29 09:37 UTC] info at infreschilab dot it
-Operating System: Slackware 15 +Operating System: Slackware 15 arm -PHP Version: 8.1.0 +PHP Version: 8.1.1
 [2021-12-29 09:37 UTC] info at infreschilab dot it
if I compile the package with --enale-debug it does not crash
 [2021-12-29 12:16 UTC] info at infreschilab dot it
php-cgi: malloc.c:2539: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
 [2021-12-29 13:13 UTC]
> Tested on ARM hardware.

Ah!  So this *might* be ARM specific.

Thanks also for the further info.  A stack backtrace might still
be helpful to see where sysmalloc assertion violation stems from.
 [2023-01-11 11:51 UTC] gallwageborg at gmail dot com
Thankful for the little by little useful exercise. Has conclusively the ordinary impact from this vlog. (
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 01:01:30 2024 UTC