V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhouyin
V2EX  ›  问与答

strace PHP 进程没输出 pstack 有输出 还有什么办法调试 centos6 系统

  •  
  •   zhouyin · 2 天前 · 165 次点击
    进程已经运行 7 个小时了 想搞明白它为什么不退出 把关键代码抽出来放到另一个 php 文件 能成功执行

    pstack 每次输出不一样

    ```go
    #0 0x000000000068de22 in php_escape_html_entities_ex ()
    #1 0x000000000068ea30 in php_escape_html_entities ()
    #2 0x0000000000714e6b in php_verror ()
    #3 0x00000000007152ff in php_error_docref0 ()
    #4 0x00000000006a500d in zif_implode ()
    #5 0x00000000007f2a52 in zend_do_fcall_common_helper_SPEC ()
    #6 0x00000000007e22e0 in execute_ex ()
    #7 0x0000000000773569 in zend_execute_scripts ()
    #8 0x00000000007124aa in php_execute_script ()
    #9 0x000000000081ad3c in main ()
    ```

    ```go
    #0 0x00000000007ac345 in zend_send_by_var_helper_SPEC_VAR ()
    #1 0x00000000007e22e0 in execute_ex ()
    #2 0x0000000000773569 in zend_execute_scripts ()
    #3 0x00000000007124aa in php_execute_script ()
    #4 0x000000000081ad3c in main ()
    ```


    ```go
    #0 0x000000000074c6fc in _efree ()
    #1 0x0000000000714e3a in php_verror ()
    #2 0x00000000007152ff in php_error_docref0 ()
    #3 0x00000000006a500d in zif_implode ()
    #4 0x00000000007f2a52 in zend_do_fcall_common_helper_SPEC ()
    #5 0x00000000007e22e0 in execute_ex ()
    #6 0x0000000000773569 in zend_execute_scripts ()
    #7 0x00000000007124aa in php_execute_script ()
    #8 0x000000000081ad3c in main ()

    ```
    strace 很久都没输出
    ```go
    Process 4159 attached
    ```

    ```go
    cat /proc/4159/sched
    php (4159, #threads: 1)
    ---------------------------------------------------------
    se.exec_start : 45376218582.155470
    se.vruntime : 4884028180.155270
    se.sum_exec_runtime : 29447940.796867
    se.wait_start : 0.000000
    se.sleep_start : 0.000000
    se.block_start : 0.000000
    se.sleep_max : 1001.042987
    se.block_max : 11.987454
    se.exec_max : 120.862807
    se.slice_max : 877.976638
    se.wait_max : 13.431891
    se.wait_sum : 13376.411793
    se.wait_count : 376462
    se.iowait_sum : 67.627900
    se.iowait_count : 173
    sched_info.bkl_count : 0
    se.nr_migrations : 898
    se.nr_migrations_cold : 0
    se.nr_failed_migrations_affine : 0
    se.nr_failed_migrations_running : 6787
    se.nr_failed_migrations_hot : 43055
    se.nr_forced_migrations : 40
    se.nr_wakeups : 20086
    se.nr_wakeups_sync : 19530
    se.nr_wakeups_migrate : 60
    se.nr_wakeups_local : 20001
    se.nr_wakeups_remote : 85
    se.nr_wakeups_affine : 1
    se.nr_wakeups_affine_attempts : 86
    se.nr_wakeups_passive : 0
    se.nr_wakeups_idle : 0
    avg_atom : 78.774458
    avg_per_cpu : 32792.807123
    nr_switches : 373826
    nr_voluntary_switches : 20086
    nr_involuntary_switches : 353740
    se.load.weight : 1024
    policy : 0
    prio : 120
    clock-delta : 190
    ```
    zhouyin
        1
    zhouyin  
    OP
       2 天前
    已解决 是一个 while 循环
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   986 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 22:49 · PVG 06:49 · LAX 14:49 · JFK 17:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.