无法“strace -p”在正在运行的 JBoss 进程上

发布于 2024-08-19 02:08:52 字数 833 浏览 2 评论 0原文

我正在尝试使用“strace -p”附加到已经运行的 JBoss 进程。 JBoss 使用的是 1.5.0_15 Java JDK。不幸的是,这不起作用 - 我只得到一个 futex() 结果:

# strace -p 3388
Process 3388 attached - interrupt to quit
[ Process PID=3388 runs in 32 bit mode. ]
futex(0x8f18f7c, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>

Strace 适用于所有其他程序,但不适用于 JBoss。当我通过 strace 启动该进程时,它似乎工作正常。当我尝试附加到已经运行的进程时,它不起作用。

我使用的是 64 位 Linux 2.6.18 和 32 位 Java JDK(RedHat Enterprise Linux 5.3,如果有的话)。

更新#1:

我确实尝试使用“-d”运行它,但输出似乎并没有更具洞察力,至少对我来说:


[root@]# strace -d -e verbose=all -p 3388
Process 3388 attached - interrupt to quit
 [wait(0x137f) = 3388]
pid 3388 stopped, [SIGSTOP]
 [wait(0x57f) = 3388]
pid 3388 stopped, [SIGTRAP]
[ Process PID=3388 runs in 32 bit mode. ]
futex(0x8f18f7c, FUTEX_WAIT_PRIVATE, 1, NULL

I am trying to use "strace -p" to attach to an already running JBoss process. JBoss is using the 1.5.0_15 Java JDK. Unfortunately, this doesn't work - I only get a single futex() result:

# strace -p 3388
Process 3388 attached - interrupt to quit
[ Process PID=3388 runs in 32 bit mode. ]
futex(0x8f18f7c, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>

Strace works for all other programs but not JBoss. It appears to work fine when I launch the process through strace. It just doesn't work when I try to attach to an already running process.

I'm using 64-bit Linux 2.6.18 with a 32 bit Java JDK (RedHat Enterprise Linux 5.3 if it matters).

Update #1:

I did try running it with "-d", but the output doesn't appear to be any more insightful, at least to me:


[root@]# strace -d -e verbose=all -p 3388
Process 3388 attached - interrupt to quit
 [wait(0x137f) = 3388]
pid 3388 stopped, [SIGSTOP]
 [wait(0x57f) = 3388]
pid 3388 stopped, [SIGTRAP]
[ Process PID=3388 runs in 32 bit mode. ]
futex(0x8f18f7c, FUTEX_WAIT_PRIVATE, 1, NULL

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

活泼老夫 2024-08-26 02:08:52

也许你可以尝试这个:

strace -F -p PID

Maybe you can try this:

strace -F -p PID

掩饰不了的爱 2024-08-26 02:08:52

如果该进程中有多个线程,则需要为 strace 提供多个 -p 选项,并指定每个线程的 ID。看起来您已成功跟踪原始父线程,并且它除了等待其他线程完成之外什么也没做。

(当您从 strace 启动命令时它起作用的原因是,默认情况下,strace 也会选取创建的新子进程并跟踪它们)。

If there's multiple threads within that process, you'll need to give strace multiple -p options, specifying the ID of each one. It looks like you're successfully tracing the original parent thread, and it's doing nothing but waiting for some other threads to finish.

(The reason it works when you start the command from strace is that by default, strace picks up the new child processes created and traces them, too).

扬花落满肩 2024-08-26 02:08:52

您是否尝试过使用 strace -d -p NNN 来获取一些 strace 调试输出?

也许添加一个 -e 详细?

strace 是否已将 setuid 安装到 root 以便您可以查看任何进程?

Have you tried using strace -d -p NNN to get some strace debugging output?

Maybe add a -e verbose?

Has strace been installed setuid to root so you can look into any process?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文