|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-05-04 18:23 UTC] stamp at stamp dot se
Description:
------------
From aptitude show php5-svn:
Package: php5-svn
Version: 1.0.0-1
Section: devel
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Depends: libapr1 (>= 1.2.7), libc6 (>= 2.4), libsvn1 (>= 1.6), phpapi-20090626+lfs, ucf
I have a simple php script that fetches the content of a file in the svn repository. Everything works fine with ascii chars but when there is a file with none ascii chars the apache process segfaults.
Php5 is installed with standard config. Mysql, gd, cli, xcache, xmlrpc, snmp, mcrypt and curl are the modules installed.
Reproduce code:
---------------
cat ../../svn.php
<?php
$_GET['path'] = trim(ltrim($_GET['path'],'/'));
if ($repo = svn_repos_open('/var/svn/wsj'))
if ($repo_fs = svn_repos_fs($repo))
if ($head = svn_fs_youngest_rev($repo_fs))
if ($repo_fs_root = svn_fs_revision_root($repo_fs,$head)) {
header('Content-Type: '.svn_fs_node_prop($repo_fs_root,$_GET['path'],'svn:mime-type'));
header('Content-Length: '.svn_fs_file_length($repo_fs_root,$_GET['path']));
$f = svn_fs_file_contents($repo_fs_root,$_GET['path']);
echo stream_get_contents($f);
}
?>
svn.php?path=pdfFiles/145_Duschtalt_44_A.pdf <-- DO work
svn.php?path=pdfFiles/145_Duscht?lt_44_A.pdf <-- Causes segfault
Expected result:
----------------
The content of the requested file
Actual result:
--------------
Blank page
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 19:00:02 2025 UTC |
I've now built it and still the same problem. compiled this version from : svn client version 1.6.12 svn extension version 1.0.2-dev Revision: 311349 Its still segfaulting when ran through apache2. php cli works. [Mon May 23 14:35:44 2011] [notice] child pid 18826 exit signal Segmentation fault (11) We did those test on a fresh installer virtual machine running ubuntu server 11.04 with the following php script: <?php error_reporting(E_ALL); ini_set('display_errors',true); if (is_dir('/var/svn/test') && $repo = svn_repos_open('/var/svn/test')) if ($repo_fs = svn_repos_fs($repo)) if ($head = svn_fs_youngest_rev($repo_fs)) if ($repo_fs_root = svn_fs_revision_root($repo_fs,$head)) { $data = svn_fs_dir_entries($repo_fs_root,'./'); print_r($data); foreach($data as $file=> $line){ $rev = svn_fs_node_created_rev($repo_fs_root,'/'.$file); echo $rev; } } echo "hej"; ?>