View Issue Details

IDProjectCategoryView StatusLast Update
0015607CentOS-7[All Projects] generalpublic2019-04-15 08:53
Reporterkevin-netearth.net 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformX86_64 on Xen server 7.5OSCentOSOS Version7.6.1810 (Core)
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0015607: Strang memory allocation problem upgrading from 7.5 to 7.6
DescriptionCentos 7.6 64bit on Xenserver 7.5 with 4G Ram.

Running a php script with a curl call to an https:// URL in a loop will after about 65 alterations start to slow down as the ca-bundle is loaded into memory. (This is another bug, that the memory is not released, and I think has been there for a while)
In 7.5 the file is loaded and although memory usage increases the script runs OK or until memory runs out.
Upgrading to 7.6 causes the php script to slow to several seconds per loop as lots of brk() commands are called, as seen via strace.



 
Steps To ReproduceRun PHP script to an SSL enables web server with a valid cert.

<?php

function file_get_contents_curl( $url ) {

  $ch = curl_init();

  curl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE );
  curl_setopt( $ch, CURLOPT_HEADER, 0 );
  curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  curl_setopt( $ch, CURLOPT_URL, $url );
  curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE );

  $data = curl_exec( $ch );
  curl_close( $ch );

  return $data;

}

$l_count = 0;
while (true) {
    $response = file_get_contents_curl('https://127.0.0.1/testfile');
        $l_count++;
        echo $l_count." ".$response;
        usleep(50000);
}
Additional InformationRelevant strace output for 7.5:

stat("/etc/pki/tls/certs/ca-bundle.crt", {st_mode=S_IFREG|0444, st_size=211658, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {4400, 813971827}) = 0
open("/etc/pki/tls/certs/ca-bundle.crt", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0444, st_size=211658, ...}) = 0
read(7, "# ACCVRAIZ1\n-----BEGIN CERTIFICA"..., 211658) = 211658
close(7)

For 7.6

stat("/etc/pki/tls/certs/ca-bundle.crt", {st_mode=S_IFREG|0444, st_size=211658, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {555, 655676628}) = 0
open("/etc/pki/tls/certs/ca-bundle.crt", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0444, st_size=211658, ...}) = 0
read(7, "# ACCVRAIZ1\n-----BEGIN CERTIFICA"..., 211658) = 211658
close(7) = 0
brk(NULL) = 0x561de5040000
brk(NULL) = 0x561de5040000
brk(0x561de4f94000) = 0x561de4f94000
brk(NULL) = 0x561de4f94000
brk(NULL) = 0x561de4f94000
brk(0x561de4fb6000) = 0x561de4fb6000
brk(NULL) = 0x561de4fb6000
brk(0x561de4fd9000) = 0x561de4fd9000
brk(NULL) = 0x561de4fd9000
brk(0x561de4ffc000) = 0x561de4ffc000
brk(NULL) = 0x561de4ffc000
brk(0x561de5021000) = 0x561de5021000



The number of brk() commands increases for each loop.









TagsNo tags attached.
abrt_hash
URL

Activities

kevin-netearth.net

kevin-netearth.net

2018-12-18 15:48

reporter   ~0033381

Update:
The ca-bundle open strace output is the same for 7.5 and 7.6 until about 66 iterations then the brk() commands appear.
kevin-netearth.net

kevin-netearth.net

2018-12-18 16:10

reporter   ~0033382

The Subject line should be:
Strange memory allocation problem upgrading from 7.5 to 7.6
toracat

toracat

2018-12-18 17:04

manager   ~0033383

Corrected.
coderhwz

coderhwz

2019-04-15 08:53

reporter   ~0034191

we meet this problem too, do you find out why ?@kevin-netearth.net

Issue History

Date Modified Username Field Change
2018-12-18 15:43 kevin-netearth.net New Issue
2018-12-18 15:48 kevin-netearth.net Note Added: 0033381
2018-12-18 16:10 kevin-netearth.net Note Added: 0033382
2018-12-18 17:04 toracat Summary Strang memory allocation problem upgrading from 7.5 to 7.5 => Strang memory allocation problem upgrading from 7.5 to 7.6
2018-12-18 17:04 toracat Note Added: 0033383
2019-04-15 08:53 coderhwz Note Added: 0034191