strace PHP 进程没输出 pstack 有输出 还有什么办法调试 centos6 系统 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhouyin
V2EX    问与答

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

  •  
  •   zhouyin 286 天前 767 次点击
    这是一个创建于 286 天前的主题,其中的信息可能已经有所发展或是发生改变。
    进程已经运行 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
       286 天前
    已解决 是一个 while 循环
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1021 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 25ms UTC 22:57 PVG 06:57 LAX 15:57 JFK 18:57
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86