Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29132 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15779 invoked by uid 1010); 2 May 2007 19:27:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15763 invoked from network); 2 May 2007 19:27:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 May 2007 19:27:13 -0000 Authentication-Results: pb1.pair.com header.from=info@adaniels.nl; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=info@adaniels.nl; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain adaniels.nl from 82.94.236.173 cause and error) X-PHP-List-Original-Sender: info@adaniels.nl X-Host-Fingerprint: 82.94.236.173 loco.helderhosting.nl Linux 2.5 (sometimes 2.4) (4) Received: from [82.94.236.173] ([82.94.236.173:60708] helo=loco.helderhosting.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/01-10138-E06E8364 for ; Wed, 02 May 2007 15:27:12 -0400 Received: from [192.168.1.170] (a80-126-54-132.adsl.xs4all.nl [80.126.54.132]) by loco (Postfix) with ESMTP id DA10011D0259 for ; Wed, 2 May 2007 21:27:07 +0200 (CEST) Message-ID: <4638E608.2090202@adaniels.nl> Date: Wed, 02 May 2007 21:27:04 +0200 User-Agent: Thunderbird 1.5.0.10 (X11/20070403) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------080706070107020705080809" Subject: How to find a bug: is_link troubles From: info@adaniels.nl (Arnold Daniels) --------------080706070107020705080809 Content-Type: multipart/alternative; boundary="------------010903060807070404050702" --------------010903060807070404050702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I've got a bug with is_link and lstats. Any symlinks not created in the current session, will not be read. This only occurs in the Apache 2 SAPI version, not in the CLI version. Script: /\n"; $symlink = '/tmp/link-persist'; if (!file_exists($symlink)) symlink('/tmp/pear', $symlink); echo (file_exists($symlink) ? is_link($symlink) ? "Correct" : "ERROR" : "Couldn't create the link"), "
\n"; ?>/ First run: / Correct Correct / Second run: / Correct ERROR/ Next runs: / Correct ERROR /I've recently start using the daily snapshots op PHP, but I also tried it on version 5.2.1, which shows the same result. It used to work just fine, so I'm sure this isn't the expected result. I've recently upgraded from Ubuntu Edgy (6.10) to Feisty (7.04), with kernel and apache update, so I believe that the problem is related to that. I've straced the process (see attachment), but I can't pinpoint the problem. This is a big issue for me, can anyone point me in the right direction to find the source of this problem. Thanks, Arnold --------------010903060807070404050702 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,

I've got a bug with is_link and lstats. Any symlinks not created in the current session, will not be read. This only occurs in the Apache 2 SAPI version, not in the CLI version.

Script:
<?
    $symlink = '/tmp/link-test';
    if (file_exists($symlink)) unlink($symlink);
    symlink('/tmp/pear', $symlink);
    echo (file_exists($symlink) ? is_link($symlink) ? "Correct" : "ERROR" : "Couldn't create the link"), "<br/>\n";

    $symlink = '/tmp/link-persist';
    if (!file_exists($symlink)) symlink('/tmp/pear', $symlink);
    echo (file_exists($symlink) ? is_link($symlink) ? "Correct" : "ERROR" : "Couldn't create the link"), "<br/>\n";
?>


First run:
    Correct
    Correct

Second run:
    Correct
    ERROR


Next runs:
    Correct
    ERROR

I've recently start using the daily snapshots op PHP, but I also tried it on version 5.2.1, which shows the same result. It used to work just fine, so I'm sure this isn't the expected result. I've recently upgraded from Ubuntu Edgy (6.10) to Feisty (7.04), with kernel and apache update, so I believe that the problem is related to that.

I've straced the process (see attachment), but I can't pinpoint the problem. This is a big issue for me, can anyone point me in the right direction to find the source of this problem.

Thanks,
Arnold
--------------010903060807070404050702-- --------------080706070107020705080809 Content-Type: text/plain; name="php_link_problem.trace" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="php_link_problem.trace" Process 1190 attached - interrupt to quit restart_syscall(<... resuming interrupted call ...>) = 0 time(NULL) = 1178133076 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=808, ...}) = 0 lstat64("/tmp/link-test", {st_mode=S_IFLNK|0777, st_size=9, ...}) = 0 readlink("/tmp/link-test", "/tmp/pear", 4096) = 9 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=808, ...}) = 0 lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=72, ...}) = 0 access("/tmp/pear", F_OK) = 0 unlink("/tmp/link-test") = 0 time(NULL) = 1178133076 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=776, ...}) = 0 lstat64("/tmp/link-test", 0xbf989bfc) = -1 ENOENT (No such file or directory) time(NULL) = 1178133076 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=776, ...}) = 0 lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=72, ...}) = 0 symlink("/tmp/pear", "/tmp/link-test") = 0 time(NULL) = 1178133076 access("/tmp/link-test", F_OK) = 0 time(NULL) = 1178133076 lstat64("/tmp/link-test", {st_mode=S_IFLNK|0777, st_size=9, ...}) = 0 time(NULL) = 1178133076 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=808, ...}) = 0 lstat64("/tmp/link-persist", {st_mode=S_IFLNK|0777, st_size=9, ...}) = 0 readlink("/tmp/link-persist", "/tmp/pear", 4096) = 9 lstat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=808, ...}) = 0 lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=72, ...}) = 0 access("/tmp/pear", F_OK) = 0 time(NULL) = 1178133076 access("/tmp/pear", F_OK) = 0 time(NULL) = 1178133076 lstat64("/tmp/pear", {st_mode=S_IFDIR|0755, st_size=72, ...}) = 0 time(NULL) = 1178133076 stat64("/", {st_mode=S_IFDIR|0755, st_size=720, ...}) = 0 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 writev(16, [{"18\r\n", 4}, {"Correct
\nERROR
\n", 24}, {"\r\n", 2}, {"0\r\n\r\n", 5}], 4) = 35 read(16, "", 8000) = 0 gettimeofday({1178133076, 170817}, NULL) = 0 write(13, "127.0.0.1 - - [02/May/2007:21:10"..., 181) = 181 gettimeofday({1178133076, 171007}, NULL) = 0 times({tms_utime=905, tms_stime=2096, tms_cutime=0, tms_cstime=0}) = 1746189524 gettimeofday({1178133076, 171152}, NULL) = 0 gettimeofday({1178133076, 171224}, NULL) = 0 gettimeofday({1178133076, 171283}, NULL) = 0 shutdown(16, 1 /* send */) = 0 poll([{fd=16, events=POLLIN, revents=POLLIN|POLLHUP}], 1, 2000) = 1 read(16, "", 512) = 0 close(16) = 0 read(4, 0xbf991507, 1) = -1 EAGAIN (Resource temporarily unavailable) gettimeofday({1178133076, 171700}, NULL) = 0 accept(3, Process 1190 detached --------------080706070107020705080809--