[pypy-dev] Debugging Blocked Block exceptions

Armin Rigo arigo at tunes.org
Sat Feb 22 08:18:20 CET 2014


Hi Timothy,

On 21 February 2014 15:45, Timothy Baldridge <tbaldridge at gmail.com> wrote:
> In an interpreter I'm writing I'm often running into Blocked block
> exceptions. I've been able to solve several of these errors but the problem
> is always figuring out what exactly I've done to cause the error. Most of
> the time it seems to come down to some sort of missing assertions that cause
> the translator to think that there is no way for an operation to succeed,
> but I just can't find it.

Welcome to RPython :-(  There is no general nice solution to these problems.

> [translation:ERROR]     v1 = getattr(v0, ('data'))
> [translation:ERROR] ==>         return self.data[idx]

The error is that the class Array has no attribute 'data'.  Obviously,
you see that it has; but that requires the annotator to have already
analyzed its __init__() method in order to know this.  Usually, when
you get blocked-block errors, you get a whole bunch of them, and only
one or two of them actually make sense.  In this case, the error above
might be caused by another blocked block that prevents annotation from
entering Array.__init__().  (Of course there is also the less-likely
possibility that you really never see Array.__init__() in your
program.)


A bientôt,

Armin.


More information about the pypy-dev mailing list