美文网首页Linux
htop运行卡住不显示没输出

htop运行卡住不显示没输出

作者: 欧悦服务 | 来源:发表于2016-04-14 16:15 被阅读219次

    今天在使用hop的时候,刚开始还可以正常显示,但Kill了一个图形程序进程后就不能正常使用了,表现为运行htop后直接卡住了。

    1.检查是程序问题还是输出问题

    htop > htop_dump.txt
    

    查看,内容可以正常输出,说明只是显示的问题

    2.使用strace检查卡在哪一步上

    strace -o htop_strace.log -s 2000 htop
    

    log显示原因为:

    socket(PF_FILE, SOCK_STREAM, 0)         = 4
    connect(4, {sa_family=AF_FILE, path="/dev/gpmctl"...}, 13) = ? ERESTARTSYS (To be restarted)
    --- SIGINT (Interrupt) @ 0 (0) ---
    rt_sigaction(SIGINT, {0x1, [], SA_RESTORER, 0x3fc0c302d0}, NULL, 8) = 0
    

    正常的时候应该是:

    connect(4, {sa_family=AF_FILE, path="/dev/gpmctl"...}, 13) = 0
    write(4, "\f\0\363\376\0\0\316\377OD\0\0\0\0\0\0", 16) = 16
    

    学习到使用strace来检查程序运行时系统调用出现的问题。

    NAME
           strace - trace system calls and signals
    
    SYNOPSIS
           strace  [ -dffhiqrtttTvxx ] [ -acolumn ] [ -eexpr ] ...  [ -ofile ] [ -ppid ] ...  [ -sstrsize ] [ -uusername ] [ -Evar=val ] ...  [ -Evar ] ...  [
           command [ arg ...  ] ]
    
           strace -c [ -eexpr ] ...  [ -Ooverhead ] [ -Ssortby ] [ command [ arg ...  ] ]
    

    3.重启gpm

    gpm是用来控制虚拟鼠标的

    service gpm restart
    

    相关文章

      网友评论

        本文标题:htop运行卡住不显示没输出

        本文链接:https://www.haomeiwen.com/subject/jmbglttx.html