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: 2021-12-29 13:13 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: Open Package: MySQLi related
PHP Version: 8.1.1 OS: Slackware 15 arm
Private report: No CVE-ID: None
 [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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC