php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71703 Segfault when CURLOPT_HTTPHEADER empty array and reset
Submitted: 2016-03-02 16:14 UTC Modified: 2016-04-10 04:22 UTC
Votes:4
Avg. Score:2.0 ± 1.0
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: giel at cyclesoftware dot nl Assigned:
Status: No Feedback Package: cURL related
PHP Version: 7.0.3 OS: Ubuntu
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: giel at cyclesoftware dot nl
New email:
PHP Version: OS:

 

 [2016-03-02 16:14 UTC] giel at cyclesoftware dot nl
Description:
------------
When the following code is executed it segfaults. Removing curl_setopt($ch, CURLOPT_HTTPHEADER, array()); fixes the problem.

Test script:
---------------
<?php
$uri = "http://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array());
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36',));
?>

Actual result:
--------------
segfault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-02 17:03 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2016-03-02 17:03 UTC] laruence@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.

I can not reproduce this
 [2016-03-02 20:11 UTC] giel at cyclesoftware dot nl
-Status: Feedback +Status: Open
 [2016-03-02 20:11 UTC] giel at cyclesoftware dot nl
Unfortunately I cannot make the trace.
I tried this again with a new build (to enable debugging). Now the segfault is gone.

Must say that the segfault was during a prof-gen build.

Thanks!
 [2016-03-31 18:55 UTC] krakjoe@php.net
-Status: Open +Status: Feedback
 [2016-03-31 18:55 UTC] krakjoe@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.

I too cannot reproduce this.
 [2016-04-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Apr 10 10:01:24 2020 UTC