Ravenbrook / Projects / Memory Pool System / Issues


MPS issue job001669

Title:Developers can't debug MPS on OS X.
Status:closed
Priority:essential
Assigned user:Gareth Rees
Organization:Ravenbrook
Description:Cannot debug MPS on OS X.

It seems that once a process on OS X has taken a barrier hit, it is
impossible to continue the process from within gdb, the debugger.

Either this really is impossible (which is essentially a bug in OS X)
or we can't figure out how to.

Here's an example gdb session:

 (gdb) run
 Starting program: /Users/drj/info.ravenbrook.com/project/mps/master/code/xci3gc/ci/amcss
 Reading symbols for shared libraries . done
 Randomizing 28358 times.
 ...........
 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x005df6b8
 0x000046e9 in dylan_write (addr=0x5df6ac, refs=0x61780, nr_refs=180) at fmtdytst.c:165
 165 p[i] = (mps_word_t)refs[(r >> 1) % nr_refs]; /* random ptr */

Now at this point we ought to be able to type:
handle EXC_BAD_ACCESS nostop
into gdb, and have it observe the signal, but pass it through to the process
without stopping. (We could then continue the process being debugged
with "continue") Unfortunately what happens is that the process and
the debugger enter an infinite loop.

This makes it essentially impossible to use gdb to do any debugging of
the MPS on OS X.
Analysis:This can be solved in GDB by "set dont-handle-bad-access 1" and "handle SIGBUS pass nostop noprint" <http:/​/​stackoverflow.com/​questions/​2044179/​gdb-set-a-breakpoint-for-a-sigbus-...>. There does not seem to be an equivalent in LLDB. We must document this for people developing with the MPS.
How found:unknown
Evidence:See Description.
Observed in:1.107.0
Created by:David Jones
Created on:2007‑07‑09 16:56:34
Last modified by:Gareth Rees
Last modified on:2012‑10‑22 13:03:42
History:2007-07-09 DRJ Created.
2012-08-15 RB Added workaround and changed to documentation job.

Fixes

Change Effect Date User Description
180005 closed 2012‑10‑22 13:03:42 Gareth Rees Be clear that the "dont-handle-bad-access" workaround is Mac OS X specific.

Generated at 2013-05-21 10:14:15 by $Id: //info.ravenbrook.com/infosys/cgi/issue.cgi#476 $

Copyright © Ravenbrook Limited. This document is provided "as is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this document. You may not duplicate or reproduce this document in any form without the express permission of the copyright holder.

Ravenbrook / Projects / Memory Pool System / Issues