代码之家  ›  专栏  ›  技术社区  ›  Petah

如何调试没有错误消息的错误?

  •  10
  • Petah  · 技术社区  · 14 年前

    加载PHP页面时,Firefox中出现了此错误。

    The connection to the server was reset while the page was loading.
    

    Apache错误日志显示:

    [Wed Nov 03 10:23:04 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting.
    [Wed Nov 03 10:23:06 2010] [notice] Digest: generating secret for digest authentication ...
    [Wed Nov 03 10:23:06 2010] [notice] Digest: done
    [Wed Nov 03 10:23:06 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
    [Wed Nov 03 10:23:06 2010] [notice] Server built: Nov 11 2009 14:29:03
    [Wed Nov 03 10:23:06 2010] [notice] Parent: Created child process 5100
    [Wed Nov 03 10:23:07 2010] [notice] Digest: generating secret for digest authentication ...
    [Wed Nov 03 10:23:07 2010] [notice] Digest: done
    [Wed Nov 03 10:23:07 2010] [notice] Child 5100: Child process is running
    [Wed Nov 03 10:23:07 2010] [notice] Child 5100: Acquired the start mutex.
    [Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting 150 worker threads.
    [Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting thread to listen on port 80.
    [Wed Nov 03 10:23:07 2010] [notice] Child 5100: Starting thread to listen on port 80.
    

    我试着搜索了3221225477代码,但没有找到任何有效的。

    Faulting application name: httpd.exe, version: 2.2.14.0, time stamp: 0x4aeb9704
    Faulting module name: php5ts.dll, version: 5.3.1.0, time stamp: 0x4b06c41d
    Exception code: 0xc0000005
    Fault offset: 0x00082391
    Faulting process id: 0x8f4
    Faulting application start time: 0x01cb7b85fa74bf83
    Faulting application path: C:\xampp\apache\bin\httpd.exe
    Faulting module path: C:\xampp\php\php5ts.dll
    Report Id: 73996201-e779-11df-938f-e0cb4e5b154a
    

    当我打电话给:

    return mysql_fetch_object($result, $class_name);
    

    当我使用 $_SESSION

    php5ts.dll php5apache2_2.dll 我得到:

    Premature end of script headers: php-cgi.exe
    

    • 没有出现PHP错误或异常。错误报告设置为 E_ALL & ~E_NOTICE & ~E_DEPRECATED . display_errors 正在打开。
    • 内存使用量约16MB,最大限制为256MB。
    • PHP5.3.1,Windows764位。

    6 回复  |  直到 14 年前
        1
  •  2
  •   Halil Özgür    14 年前

    你可以从阅读开始 "Generating a Backtrace" 搜索与您类似的注册PHP错误报告,如果您真的没有发现错误,则提交一个错误。如果你真的感兴趣,你可以检查 PHP Source 提出一个补丁。

        2
  •  2
  •   StasM    14 年前

    看起来您在PHP中遇到了一个错误,导致了崩溃。尝试升级到最新的夜间版本(http://snaps.php.net/)。如果那没用,试着 get a backtrace

        3
  •  0
  •   MANCHUCK    14 年前

    似乎脚本需要很长时间才能执行,因此浏览器正在超时。尝试使用php函数set_time_limit来防止脚本死亡。

    set_time_limit(0); // no time limit

        4
  •  0
  •   selfsimilar    14 年前

    如果apache崩溃,可能是由于.htaccess损坏。在错误消息/崩溃之前是否有任何日志条目来指示Apache认为它在做什么?

        5
  •  0
  •   Petah    14 年前

    (这就是我所做的,现在看来它似乎是可行的,但是我的问题仍然存在:如何有效地调试这些问题?)

        6
  •  0
  •   c0rnh0li0    14 年前

    http://bugs.php.net/bugs-getting-valgrind-log.php

    http://en.wikipedia.org/wiki/Strace 也可以很方便地找到让你的系统崩溃的地方。

    你是如何监控内存使用的?