php.net |  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: 2025-01-14 18:12 UTC
Votes:3
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: No Feedback Package: MySQLi related
PHP Version: 8.1.1 OS: Slackware 15 arm
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at infreschilab dot it
New email:
PHP Version: OS:

 

 [2021-12-03 16:41 UTC] info at infreschilab dot it
Description:
------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-03 17:14 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-12-03 17:14 UTC] cmb@php.net
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
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php 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] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2021-12-04 15:01 UTC] cmb@php.net
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 "127.0.0.1", 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] cmb@php.net
> 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.
 [2025-01-14 18:10 UTC] bukka@php.net
-Status: Open +Status: No Feedback
 [2025-01-14 18:10 UTC] bukka@php.net
As noted without the stack trace, this is impossible to investigate. We also have arm tests and there are no crashes so it might be something build specific or there are some other issue. 8.1 is now also out of normal support. If you are still able to re-create the issue with latest, please open a new issue as we might need more info.
 [2025-01-14 18:12 UTC] bukka@php.net
Just to clarify, I meant if you are able to recreate with the latest PHP version (8.3 or 8.4), please open a new GitHub issue as comments here are just private and we might need some further feedback.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Mar 10 21:01:30 2025 UTC