php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58298 Seg Fault on Apache if svn_repos_create() and svn_checkout() are consecutive
Submitted: 2008-07-31 06:47 UTC Modified: 2011-10-05 21:13 UTC
From: arty at lightenna dot com Assigned:
Status: No Feedback Package: svn (PECL)
PHP Version: 5_2 CVS-2008-07-31 (dev) OS: CentOS 5 64-bit 2.6.18-53.1.21
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arty at lightenna dot com
New email:
PHP Version: OS:

 

 [2008-07-31 06:47 UTC] arty at lightenna dot com
Description:
------------
Hello. I am running Apache on CentOS 64-bit (2.2.3-11.el5_1.centos.3.x86_64) with PHP (5.2.6).

I have a PHP script, which creates a repository using svn_repos_create, then sets up authentication details using svn_auth_set_parameter and finally checks out the new repo with svn_checkout. The function calls are consecutive, so they come one after another. For some reason, this function seg faults on the checkout stage. In an attempt to debug this, I have tried running svn_auth_set_parameter calls with svn_checkout not being carried out AND vice versa. In both situations there is no segmentation fault. Also, if carried out separately, i.e. if svn_repos_create is carried out and then svn_checkout is carried out later (by making another server request) seg fault doesn't occur. I don't know much about how SVN API works internally so I assumed that it might be a good idea to make the script sleep for a few seconds after repository creation just to see what happens. Unfortunately, that didn't help either.

The code works in CLI... Its just in Apache its a problem for some reason.

Reproduce code:
---------------
print "Create new repo\n";
$r = svn_repos_create('/var/www/svn/my_test_repo');

var_dump($r);

/** set up permissions for our new repo **/
$newline = "\n";
$acfp = fopen('/var/www/svn/access/.svn_access', 'w')
        or die('Opening access filed miserably failed...');

fwrite($acfp, '[my_test_repo:/]');
fwrite($acfp, '' . $newline);
fwrite($acfp, 'admin = rw');
fclose($acfp);
/** ok, now we can access our new repo **/

print "Set up authentication\n";
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, 'admin');
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, 'svnpasstest2222');

mkdir('my_test_wc');
$result = svn_checkout('http://localhost/svn/my_test_repo', 'my_test_wc');

var_dump($result);

if($result === TRUE) print "Successful!\n";
?>




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-14 06:22 UTC] rowan at sad dot ukrd dot com
I also have a segmentation fault with centos 64

If I open the repository with svn_repos_open the first instance returns a resource. If I run the same function again it returns a segmentation fault. Also occurs with svn_checkout once the resource has been created with svn_repos_open 

Unlike the first commenter my fault occurs with command line execution as well as apache. And also unlike the first commenter I am using 0.4 of csv
 [2008-09-02 08:10 UTC] scottmac@php.net
Can you try a version from CVS, I just patched a bug that may be causing this problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 23:01:27 2024 UTC