Bug #71709 [Ver]: make test ext/curl/tests/curl_setopt_basic003.phpt never completes

From: Date: Tue, 26 Jul 2016 13:12:01 +0000
Subject: Bug #71709 [Ver]: make test ext/curl/tests/curl_setopt_basic003.phpt never completes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202606@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71709&edit=1 ID: 71709 Updated by: cmb@php.net Reported by: kspen72 at gmail dot com Summary: make test ext/curl/tests/curl_setopt_basic003.phpt never completes Status: Verified Type: Bug Package: cURL related Operating System: Debian 3.2.73-2+deb7u2 x86_64 PHP Version: 7.0.4 Assigned To: pierrick Block user comment: N Private report: N New Comment: > -f-tree-tail-merge Should of course have been -ftree-tail-merge. Previous Comments: ------------------------------------------------------------------------ [2016-07-26 12:22:26] cmb@php.net > Using Debian 7.10 and 7.0.8 built with gcc 4.7.2, this minimal > test case would crash: I can reproduce this (same environment). > Our fix was to edit the Makefile to compile ext/curl/interface.c > with -O0. -O1 also works for me, and also -O2 -fno-tree-tail-merge. Not sure if there's really an issue with -f-tree-tail-merge in gcc 4.7.2, but at least disabling this option might be a viable workaround. ------------------------------------------------------------------------ [2016-07-26 02:52:16] chrisbolt at gmail dot com Just to add another data point, we ran into this in our production environment, not just a test failure (see also https://bugs.php.net/bug.php?id=71703). Using Debian 7.10 and 7.0.8 built with gcc 4.7.2, this minimal test case would crash: <?php $ch = curl_init('http://www.google.com/'); curl_setopt($ch, CURLOPT_HTTPHEADER, array()); ?> Our fix was to edit the Makefile to compile ext/curl/interface.c with -O0. ------------------------------------------------------------------------ [2016-06-24 18:19:20] cmb@php.net I can confirm the issue on a bento/debian-7.10 vagrant box with the official PHP 7.0.8. Running ./configure --disable-all --enabli-cli --with-curl make and then running the test stalls. Setting a breakpoint on _php_curl_setopt shows erratic program flow in gdb (might be due to wrong macro expansion). After make clean ./configure --disable-all --enabli-cli --with-curl --enable-debug make the test runs as expected. ------------------------------------------------------------------------ [2016-06-24 13:03:03] cmb@php.net Thanks for the backtrace and for testing the patch. Indeed, there appears to be something terribly wrong, because the segfault is happening when PHP is processing curl_setopt(…, CURLOPT_PROGRESSFUNCTION)[1], which is not supposed to happen during this test. I'll try to reproduce the issue. [1] <https://github.com/php/php-src/blob/php-7.0.8/ext/curl/interface.c#L2822> ------------------------------------------------------------------------ [2016-06-24 12:32:05] klaus dot keppler at googlemail dot com Patch 71709 doesn't help, still crashing with SEGFAULT. Error occurs at PHP line "curl_setopt($ch, CURLOPT_HTTPHEADER, array());" ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=71709 -- Edit this bug report at https://bugs.php.net/bug.php?id=71709&edit=1

« previous php.bugs (#202606) next »