bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with apply-frame trap in 1.6 and 1.7


From: Neil Jerram
Subject: Problem with apply-frame trap in 1.6 and 1.7
Date: Wed, 03 Nov 2004 18:32:22 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3

Working on breakpoints for 1.6.x, I just discovered that the following ENTER_APPLY trap code in eval.c goes into a tight busy loop if (debug-enable 'trace) and (trap-set! apply-frame-handler non-#f).

 if (CHECK_APPLY && SCM_TRAPS_P)\
   if (SCM_APPLY_FRAME_P || (SCM_TRACE_P && PROCTRACEP (proc)))\

This is because PROCTRACEP uses scm_procedure_property, which itself uses apply if proc is not a closure.

I think the fix (which works for me in 1.6.5) is to redefine PROCTRACEP to use a more targeted function, like this:

#define PROCTRACEP(x) closure_traced_p (x)

SCM closure_traced_p (SCM p)
{
 if (!SCM_CLOSUREP (p))
   return 0;
 return SCM_NIMP (scm_sloppy_assq (scm_sym_trace, SCM_PROCPROPS (p)));
}

Thoughts? Once the fix is agreed, I suggest that this should go into 1.6.x as well as HEAD.

Regards,
          Neil






reply via email to

[Prev in Thread] Current Thread [Next in Thread]