From: Greg Ercolano <erco@(email surpressed)>
Subject: [Q+A/OSX ADMIN] Want to trace a renderer with strace, but on OSX
   Date: Mon, 18 Mar 2013 18:33:01 -0400
Msg# 2313
View Complete Thread (2 articles) | All Threads
Last Next
> We need to trace a problem with one of our renderers on OSX 10.8.x
> while it's running through Rush.
>
> On linux we use 'strace our_cmd -arg -arg..'.
>
> Is there a way to do this under OSX with Rush?
> I think we can use 'dtruss', but it has to run as root..

    Right, rush doesn't let you run renders as root by default
    (you have to go out of your way to configure this, and it's NOT recommended)

    Yes, you can use dtruss IF you first make the *dtrace* executable setuid root.
    (dtruss is just a script that calls dtrace, at least in Mountain Lion/10.8.x)

    So:

	1) As root, run this command on the render node:

		chmod 4755 /usr/sbin/dtrace

	   This will make dtrace run as root, so that it can trace your renderer.

	2) Modify your rush job to only render on this machine, and insert 'dstruss -fl'
           in front of the render command you want to trace. So if your render command is:

		ffmpeg -arg1 -arg2

	   ..then change it to:

		dtruss -fl ffmpeg -arg1 -arg2

	   If you need your render to run as a normal user, you'll probably need:

		dtruss -fl su - NORMAL_USER ffmpeg -arg1 -arg2

	   ..where you'd replace NORMAL_USER with the username of the user you want
	   the command to run as.

    ..that should let you trace the executable within rush under OSX,
    and the output of dtruss will appear in the rush frame log.

    *Be sure* to restore the perms of dtrace back to normal when you're done
    doing your tests, ie:

	chmod 755 /usr/sbin/dtrace

    ..to avoid leaving a setuid loophole open.


Last Next