pgdbg fails on Mac OS X

Hello!
Recently I downloaded a trial version of the compiler for evaluation purposes and had problems making the debugger work in mountain lion even after checking/following all the things mentioned in this thread. The only way that I managed to make the debugger work is by launching it with sudo: I didn’ t test it a lot as I was more interested in the GPU stuff and had limited time but it seemed to at least work(aside from some messages from the debugger itself)…obviously this is not an optimal solution but in the meantime that a proper solution is found you can try it…
Cheers!

This posting provides a summary of how to troubleshoot problems running PGDBG on Mac OS X. This applies to PGI 12.x and before. We are actively working on addressing the task_for_pid issues for PGI 2013, but it is not clear at this time when a fix will be available.

I. Troubleshooting task_for_pid failures:

  • (1) make sure that the PGI software is installed on a local drive (not a network drive)
    (2) make sure that the pgdebug, pgserv, and pgsampt executables have setgid ‘procmod’ permissions
-rwxrwsr-x  1 root  procmod  23031904 Oct 19 16:35 pgdebug
-rwxrwsr-x  1 root  procmod   1715760 Oct 19 16:35 pgsampt
-rwxrwsr-x  1 root  procmod    135816 Oct 19 16:35 pgserv

(3) make sure that the debugger user is a member of the Unix group ‘procmod’

$ id
uid=1010(myuser) gid=1004(users) groups=1004(users),9(procmod)

(4) make sure that the taskgated(8) daemon is configured to use the ‘-p’ option in /System/Library/LaunchDaemons/com.apple.taskgated.plist. Find the ‘ProgramArguments’ section and make sure that ‘-p’ is listed as shown below.

        <key>ProgramArguments</key>
        <array>
                <string>/usr/libexec/taskgated</string>
                <string>-p</string>
                <string>-s</string>
        </array>

II. Troubleshooting dynamic library issues

  • PGDBG does not currently support debugging dynamic libraries on Mac OS X

III. Troubleshooting CANNOT LOAD errors:

  • (1) make sure that the main executable of the program has been built with ASLR disabled
      • this is the default when using the PGI compiler driver with ‘-g’ to link
  • if not using the PGI compiler driver to link, link with ‘-no_pie’