Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2014 23:45:34 GMT
From:      Nick Zivkovic <zivkovic.nick@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/187912: Getting Stack Traces of Xorg with DTrace Causes Hang
Message-ID:  <201403242345.s2ONjY4i061148@cgiserv.freebsd.org>
Resent-Message-ID: <201403242350.s2ONo0rg056083@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187912
>Category:       kern
>Synopsis:       Getting Stack Traces of Xorg with DTrace Causes Hang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 24 23:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Nick Zivkovic
>Release:        10.0 (r260789)
>Organization:
N/A
>Environment:
FreeBSD Stalingrad 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When executing the following DTrace script:

sudo dtrace -n 'syscall:::entry /execname == "Xorg"/ {@[ustack()] = count();}'

and pressing ^C, the Xserver freezes. The machine (a laptop) is unresponsive.

So I ssh'd into the laptop (from a different laptop), and did:

pgrep dtrace

Sure enough the dtrace exec was still alive, but not doing anything (that I can tell).

Firefox still did IO and stuff, but Xorg didn't have _any_ activity (according to top).

So I did a `kill -9 $(my-dtrace-pid)`

This caused Xorg to restart.

Bottom line: running that simple (and common) DTrace script froze Xorg. I don't mean to be inflammatory but, this should _never_ happen, especially not in production --- which means that the FreeBSD DTrace implementation is violating DTrace's original design constraints. This is a critical error, and shows that FreeBSD's DTrace may not be suitable for production use, yet.

So far I've only been able to replicate this on Xorg.

It may be of importance that I did `make buildworld` and `make installworld` with the following options:

CFLAGS+=-fno-omit-frame-pointer
STRIP=
WITH_CTF=1

In other words I made all of my installed packages dtrace-friendly.


>How-To-Repeat:
When running Xorg (not stripped, no frame-pointer optimization, and with CTF) run:

sudo dtrace -n 'syscall:::entry /execname == "Xorg"/ {@[ustack] = count();}'

resize windows, click around, etc.

go back to terminal and hit ^C.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403242345.s2ONjY4i061148>