Author: Antonio Cuni <anto.c...@gmail.com>
Branch: gc-hooks
Changeset: r94350:8711cbc8d281
Date: 2018-04-16 12:36 +0000
http://bitbucket.org/pypy/pypy/changeset/8711cbc8d281/

Log:    hg merge default

diff --git a/pypy/doc/how-to-release.rst b/pypy/doc/how-to-release.rst
--- a/pypy/doc/how-to-release.rst
+++ b/pypy/doc/how-to-release.rst
@@ -40,6 +40,8 @@
   sure things are ported back to the trunk and to the branch as
   necessary.
 
+* Make sure the RPython builds on the buildbot pass with no failures
+
 * Maybe bump the SOABI number in module/imp/importing. This has many
   implications, so make sure the PyPy community agrees to the change.
 
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -3,16 +3,10 @@
 ==========================
 
 .. this is a revision shortly after release-pypy-6.0.0
-.. startrev: 2e04adf1b89f
+.. startrev: f22145c34985
 
-.. branch: cpyext-subclass-setattr
 
-Fix for python-level classes that inherit from C-API types, previously the
-`w_obj` was not necessarily preserved throughout the lifetime of the `pyobj`
-which led to cases where instance attributes were lost. Fixes issue #2793
+.. branch: issue2752
 
-
-.. branch: pyparser-improvements-2
-
-Improve line offsets that are reported by SyntaxError. Improve error messages
-for a few situations, including mismatched parenthesis.
+Fix a rare GC bug that was introduced more than one year ago, but was
+not diagnosed before issue #2752.
diff --git a/pypy/doc/whatsnew-pypy2-6.0.0.rst 
b/pypy/doc/whatsnew-pypy2-6.0.0.rst
--- a/pypy/doc/whatsnew-pypy2-6.0.0.rst
+++ b/pypy/doc/whatsnew-pypy2-6.0.0.rst
@@ -97,3 +97,15 @@
 Work around possible bugs in upstream ioctl users, like CPython allocate at
 least 1024 bytes for the arg in calls to ``ioctl(fd, request, arg)``. Fixes
 issue #2776
+
+.. branch: cpyext-subclass-setattr
+
+Fix for python-level classes that inherit from C-API types, previously the
+`w_obj` was not necessarily preserved throughout the lifetime of the `pyobj`
+which led to cases where instance attributes were lost. Fixes issue #2793
+
+
+.. branch: pyparser-improvements-2
+
+Improve line offsets that are reported by SyntaxError. Improve error messages
+for a few situations, including mismatched parenthesis.
diff --git a/pypy/module/cpyext/test/test_bufferobject.py 
b/pypy/module/cpyext/test/test_bufferobject.py
--- a/pypy/module/cpyext/test/test_bufferobject.py
+++ b/pypy/module/cpyext/test/test_bufferobject.py
@@ -4,6 +4,7 @@
 from pypy.module.cpyext.api import PyObject
 
 class AppTestBufferObject(AppTestCpythonExtensionBase):
+
     def test_FromMemory(self):
         module = self.import_extension('foo', [
             ("get_FromMemory", "METH_NOARGS",
@@ -62,3 +63,61 @@
         a = array.array('c', 'text')
         b = buffer(a)
         assert module.roundtrip(b) == 'text'
+
+
+    def test_issue2752(self):
+        iterations = 10
+        if self.runappdirect:
+            iterations = 2000
+        module = self.import_extension('foo', [
+            ("test_mod", 'METH_VARARGS',
+            """
+                PyObject *obj;
+                Py_buffer bp;
+                if (!PyArg_ParseTuple(args, "O", &obj))
+                    return NULL;
+
+                if (PyObject_GetBuffer(obj, &bp, PyBUF_SIMPLE) == -1)
+                    return NULL;
+                
+                if (((unsigned char*)bp.buf)[0] != '0') {
+                    void * buf = (void*)bp.buf;
+                    unsigned char val[4];
+                    char * s = PyString_AsString(obj);
+                    memcpy(val, bp.buf, 4);
+                    PyBuffer_Release(&bp);
+                    if (PyObject_GetBuffer(obj, &bp, PyBUF_SIMPLE) == -1)
+                        return NULL;
+                    PyErr_Format(PyExc_ValueError,
+                            "mismatch: %p [%x %x %x %x...] now %p [%x %x %x 
%x...] as str '%s'",
+                            buf, val[0], val[1], val[2], val[3],
+                            (void *)bp.buf,
+                            ((unsigned char*)bp.buf)[0],
+                            ((unsigned char*)bp.buf)[1],
+                            ((unsigned char*)bp.buf)[2],
+                            ((unsigned char*)bp.buf)[3],
+                            s);
+                    PyBuffer_Release(&bp);
+                    return NULL;
+                }
+
+                PyBuffer_Release(&bp);
+                Py_RETURN_NONE;
+            """),
+            ])
+        bufsize = 4096
+        def getdata(bufsize):
+            data = b'01234567'
+            for x in range(18):
+                data += data
+                if len(data) >= bufsize:
+                    break
+            return data
+        for j in range(iterations):
+            block = getdata(bufsize)
+            assert block[:8] == '01234567'
+            try:
+                module.test_mod(block)
+            except ValueError as e:
+                print("%s at it=%d" % (e, j))
+                assert False
diff --git a/pypy/tool/pytest/genreportdata.py 
b/pypy/tool/pytest/genreportdata.py
deleted file mode 100755
--- a/pypy/tool/pytest/genreportdata.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /usr/bin/env python
-import py
-import sys
-        
-mydir = py.path.local(__file__).dirpath().realpath()
-from pypy.tool.pytest import htmlreport 
-from pypy.tool.pytest import confpath 
-
-if __name__ == '__main__':
-    if len(sys.argv) > 1:
-        testresultdir = py.path.local(sys.argv[1])
-        assert testresultdir.check(dir=1)        
-    else:
-        testresultdir = confpath.testresultdir 
-        assert testresultdir.check(dir=1)
-        try:
-            resultwc = py.path.svnwc(testresultdir)
-            print "updating", resultwc
-            resultwc.update()
-        except (KeyboardInterrupt, RuntimeError):
-            raise
-        except Exception as e: #py.process.ExecutionFailed,e:
-            print >> sys.stderr, "Warning: ",e #Subversion update failed"
-
-    print "traversing", mydir 
-    rep = htmlreport.HtmlReport(testresultdir)
-    rep.parselatest()
-
-    print "making html files"
-    rep.makeindex(testresultdir.join('index.html'))
diff --git a/pypy/tool/pytest/htmlreport.py b/pypy/tool/pytest/htmlreport.py
deleted file mode 100644
--- a/pypy/tool/pytest/htmlreport.py
+++ /dev/null
@@ -1,239 +0,0 @@
-#! /usr/bin/env python
-
-"""
-the html test reporter 
-
-"""
-import sys, os, re
-import pprint
-import py 
-from pypy.tool.pytest import result
-from pypy.tool.pytest.overview import ResultCache 
-
-# 
-# various interesting path objects 
-#
-
-html = py.xml.html
-NBSP = py.xml.raw("&nbsp;")
-
-class HtmlReport(object): 
-    def __init__(self, resultdir): 
-        self.resultcache = ResultCache(resultdir)
-
-    def parselatest(self): 
-        self.resultcache.parselatest()
-
-    # 
-    # rendering 
-    # 
-
-    def render_latest_table(self, results): 
-        table = html.table(
-                    [html.th(x, align='left') 
-                        for x in ("failure", "filename", "revision", 
-                                  "user", "platform", "elapsed", 
-                                  "options", "last error line"
-                                  )], 
-                )
-        r = results[:]
-        def f(x, y): 
-            xnum = x.isok() and 1 or (x.istimeout() and 2 or 3)
-            ynum = y.isok() and 1 or (y.istimeout() and 2 or 3)
-            res = -cmp(xnum, ynum)
-            if res == 0: 
-                return cmp(x['execution-time'], y['execution-time'])
-            return res 
-        r.sort(f) 
-        for result in r: 
-            table.append(self.render_result_row(result))
-        return table 
-
-    def render_result_row(self, result): 
-        dp = py.path.local(result['fspath']) 
-
-        options = " ".join([x for x in result.get('options', []) if x!= 
'core'])
-        if not options: 
-            options = NBSP
-
-        failureratio = 100 * (1.0 - result.ratio_of_passed())
-        self.data[result.testname] = failureratio
-        return html.tr(
-                html.td("%.2f%%" % failureratio, 
-                    style = "background-color: %s" % 
(getresultcolor(result),)), 
-                html.td(self.render_test_references(result)),
-                html.td(result['pypy-revision']),
-                html.td(result['userhost'][:15]), 
-                html.td(result['platform']), 
-                html.td("%.2fs" % result['execution-time']),
-                html.td(options), 
-                html.td(result.repr_short_error() or NBSP)
-        )
-
-    def getrelpath(self, p): 
-        return p.relto(self.indexpath.dirpath())
-
-    def render_test_references(self, result): 
-        dest = self.make_single_test_result(result)
-        #XXX: ask hg for differences between test and vendor branch
-        modified = result.ismodifiedtest() and " [mod]" or ""
-        return html.div(html.a(result.path.purebasename + modified, 
-                      href=self.getrelpath(dest)),
-                      style="background-color: transparent")
-
-    def make_single_test_result(self, result): 
-        cache = self.indexpath.dirpath('.cache', result['userhost'][:15])
-        cache.ensure(dir=1)
-        dest = cache.join(result.path.basename).new(ext='.html')
-        doc = ViewResult(result)
-        doc.writetopath(dest)
-        return dest
-
-    def getcorelists(self): 
-        def iscore(result): 
-            return 'core' in result.get('options', []) 
-        coretests = []
-        noncoretests = []
-        for name in self.resultcache.getnames(): 
-            result = self.resultcache.getlatestrelevant(name)
-            if iscore(result): 
-                coretests.append(result)
-            else: 
-                noncoretests.append(result) 
-        return coretests, noncoretests 
-    
-    # generate html files 
-    #
-    def makeindex(self, indexpath, detail="PyPy - latest"): 
-        self.indexpath = indexpath
-        self.data = {}
-        doc = Document(title='pypy test results')
-        body = doc.body
-        coretests, noncoretests = self.getcorelists()
-        body.append(html.h2("%s compliance test results - "
-                            "core tests" % detail))
-
-        body.append(self.render_test_summary('core', coretests))
-        body.append(self.render_latest_table(coretests))
-        body.append(
-            html.h2("%s compliance test results - non-core tests" % detail))
-        body.append(self.render_test_summary('noncore', noncoretests))
-        body.append(self.render_latest_table(noncoretests))
-        doc.writetopath(indexpath)
-        datapath = indexpath.dirpath().join('data')
-        d = datapath.open('w')
-        print >>d, "data = ",
-        pprint.pprint(self.data, stream=d)
-        d.close()
-        self.data = None
-        
-    def render_test_summary(self, tag, tests):
-        ok = len([x for x in tests if x.isok()])
-        err = len([x for x in tests if x.iserror()])
-        to = len([x for x in tests if x.istimeout()])
-        numtests = ok + err + to
-        assert numtests == len(tests)
-        assert numtests
-
-        t = html.table()
-        sum100 = numtests / 100.0
-        def row(*args):
-            return html.tr(*[html.td(arg) for arg in args])
-
-        sum_passed = sum([x.ratio_of_passed() for x in tests])
-        compliancy = sum_passed/sum100
-        self.data['%s-compliancy' % tag] = compliancy 
-        t.append(row(html.b("tests compliancy"), 
-                     html.b("%.2f%%" % (compliancy,))))
-
-        passed = ok/sum100
-        self.data['%s-passed' % tag] = passed
-        t.append(row("testmodules passed completely", "%.2f%%" % passed))
-        failed = err/sum100
-        self.data['%s-failed' % tag] = failed
-        t.append(row("testmodules (partially) failed", "%.2f%%" % failed))
-        timedout = to/sum100
-        self.data['%s-timedout' % tag] = timedout
-        t.append(row("testmodules timeout", "%.2f%%" % timedout))
-        return t
-
-class Document(object): 
-    def __init__(self, title=None): 
-        self.body = html.body()
-        self.head = html.head()
-        self.doc = html.html(self.head, self.body)
-        if title is not None: 
-            self.head.append(
-                html.meta(name="title", content=title))
-        self.head.append(
-            html.link(rel="Stylesheet", type="text/css", 
href="/pypy/default.css"))
-
-    def writetopath(self, p): 
-        assert p.ext == '.html'
-        self.head.append(
-            html.meta(name="Content-Type", content="text/html;charset=UTF-8")
-        )
-        s = self.doc.unicode().encode('utf-8')
-        p.write(s) 
-       
-def getresultcolor(result): 
-    if result.isok(): 
-        color = "#00ee00"
-    elif result.iserror(): 
-        color = "#ee0000" 
-    elif result.istimeout: 
-        color = "#0000ee"
-    else: 
-        color = "#444444"
-    return color 
-
-class ViewResult(Document): 
-    def __init__(self, result): 
-        title = "%s testresult" % (result.path.purebasename,)
-        super(ViewResult, self).__init__(title=title)
-        color = getresultcolor(result)
-        self.body.append(html.h2(title, 
-                    style="background-color: %s" % color))
-        self.body.append(self.render_meta_info(result))
-
-        for name in ('reportdiff', 'stdout', 'stderr'): 
-            try: 
-                text = result.getnamedtext(name)
-            except KeyError: 
-                continue
-            self.body.append(html.h3(name))
-            self.body.append(html.pre(text))
-
-    def render_meta_info(self, result):
-        t = html.table()
-        items = result.items()
-        items.sort()
-        for name, value in items: 
-            if name.lower() == name:
-                t.append(html.tr(
-                    html.td(name), html.td(value)))
-        return t 
- 
-class TestOfHtmlReportClass: 
-    def setup_class(cls): 
-        py.test.skip('needs move to own test file')
-        cls.testresultdir = confpath.testresultdir 
-        cls.rep = rep = HtmlReport()
-        rep.parse_all(cls.testresultdir)
-
-    def test_pickling(self): 
-        # test pickling of report 
-        tempdir = py.test.ensuretemp('reportpickle')
-        picklepath = tempdir.join('report.pickle')
-        picklepath.dump(self.rep)
-        x = picklepath.load()
-        assert len(x.results) == len(self.rep.results)
-    
-    def test_render_latest(self): 
-        t = self.rep.render_latest_table(self.rep.results)
-        assert unicode(t)
-
-mydir = py.path.local(__file__).dirpath()
-
-def getpicklepath(): 
-    return mydir.join('.htmlreport.pickle')
diff --git a/pypy/tool/pytest/overview.py b/pypy/tool/pytest/overview.py
deleted file mode 100644
--- a/pypy/tool/pytest/overview.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from pypy.tool.pytest import result 
-import sys
-
-class ResultCache: 
-    def __init__(self, resultdir):
-        self.resultdir = resultdir
-        self.name2result = {}
-
-    def parselatest(self): 
-        def filefilter(p): 
-            return p.check(fnmatch='test_*.txt', file=1)
-        def rec(p): 
-            return p.check(dotfile=0)
-        for x in self.resultdir.visit(filefilter, rec): 
-            self.parse_one(x)
-    
-    def parse_one(self, resultpath):
-        try: 
-            res = result.ResultFromMime(resultpath) 
-            ver = res['testreport-version']
-            if ver != "1.1" and ver != "1.1.1":
-                raise TypeError
-        except TypeError: # xxx
-            print >>sys.stderr, "could not parse %s" % resultpath
-            return
-        name = res.testname 
-        print name
-        self.name2result.setdefault(name, []).append(res) 
-        return res 
-
-    def getnames(self): 
-        return self.name2result.keys()
-
-    def getlatest(self, name, timeout=0, error=0, ok=0): 
-        l = []
-        resultlist = self.name2result[name]
-        maxrev = 0
-        maxresult = None
-        for res in resultlist:
-            resrev = res['pypy-revision']
-            if resrev == 'unknown': 
-                continue 
-            if resrev <= maxrev: 
-                continue 
-            if timeout or error or ok:
-                if not (timeout and res.istimeout() or
-                        error and res.iserror() or 
-                        ok and res.isok()): 
-                    continue 
-            maxrev = resrev 
-            maxresult = res 
-        return maxresult 
-
-    def getlatestrelevant(self, name):
-        # get the latest revision that did not time out.
-        return self.getlatest(name, error=1, ok=1) or self.getlatest(name)
diff --git a/pypy/tool/pytest/result.py b/pypy/tool/pytest/result.py
deleted file mode 100644
--- a/pypy/tool/pytest/result.py
+++ /dev/null
@@ -1,215 +0,0 @@
-import sys
-import py
-import re
-
-class Result(object):
-    def __init__(self, init=True):
-        self._headers = {}
-        self._blocks = {}
-        self._blocknames = []
-        if init:
-            stdinit(self)
-
-    def __setitem__(self, name, value):
-        self._headers[name.lower()] = value
-
-    def __getitem__(self, name):
-        return self._headers[name.lower()]
-
-    def get(self, name, default):
-        return self._headers.get(name, default)
-
-    def __delitem__(self, name):
-        del self._headers[name.lower()]
-
-    def items(self):
-        return self._headers.items()
-
-    def addnamedtext(self, name, text):
-        assert isinstance(text, basestring)
-        assert isinstance(name, str)
-        self._blocknames.append(name)
-        self._blocks[name] = text
-
-    def getnamedtext(self, name):
-        return self._blocks[name]
-
-    def repr_short_error(self):
-        if not self.isok():
-            if 'reportdiff' in self._blocks:
-                return "output comparison failed, see reportdiff"
-            else:
-                text = self.getnamedtext('stderr')
-                lines = text.strip().split('\n')
-                if lines:
-                    return lines[-1]
-
-    def repr_mimemessage(self):
-        from email.MIMEMultipart  import MIMEMultipart
-        from email.MIMEText  import MIMEText
-
-        outer = MIMEMultipart()
-        items = self._headers.items()
-        items.sort()
-        reprs = {}
-        for name, value in items:
-            assert ':' not in name
-            chars = map(ord, name)
-            assert min(chars) >= 33 and max(chars) <= 126
-            outer[name] = str(value)
-            if not isinstance(value, str):
-                typename = type(value).__name__
-                assert typename in vars(py.std.__builtin__)
-                reprs[name] = typename
-
-        outer['_reprs'] = repr(reprs)
-
-        for name in self._blocknames:
-            text = self._blocks[name]
-            m = MIMEText(text)
-            m.add_header('Content-Disposition', 'attachment', filename=name)
-            outer.attach(m)
-        return outer
-
-    def grep_nr(self,text,section='stdout'):
-        stdout = self._blocks[section]
-        find = re.search('%s(?P<nr>\d+)'%text,stdout)
-        if find:
-            return float(find.group('nr'))
-        return 0.
-
-    def ratio_of_passed(self):
-        if self.isok():
-            return 1.
-        elif self.istimeout():
-            return 0.
-        else:
-            nr = self.grep_nr('Ran ')
-            if nr > 0:
-                return (nr - (self.grep_nr('errors=') + 
self.grep_nr('failures=')))/nr
-            else:
-                passed = self.grep_nr('TestFailed: ',section='stderr')
-                run = self.grep_nr('TestFailed: \d+/',section='stderr')
-                if run > 0:
-                    return passed/run
-                else:
-                    run = self.grep_nr('TestFailed: \d+ of ',section='stderr')
-                    if run > 0 :
-                        return (run-passed)/run
-                    else:
-                        return 0.0
-
-    def isok(self):
-        return self['outcome'].lower() == 'ok'
-
-    def iserror(self):
-        return self['outcome'].lower()[:3] == 'err' or self['outcome'].lower() 
== 'fail'
-
-    def istimeout(self):
-        return self['outcome'].lower() == 't/o'
-
-# XXX backward compatibility
-def sanitize(msg, path):
-    if 'exit-status' in msg.keys():
-        return msg
-    f = open(str(path), 'r')
-    msg = f.read()
-    f.close()
-    for broken in ('exit status', 'cpu model', 'cpu mhz'):
-        valid = broken.replace(' ','-')
-        invalid = msg.find(broken+':')
-        msg = (msg[:invalid] + valid +
-               msg[invalid+len(valid):])
-    from email import message_from_string
-    msg = message_from_string(msg)
-    return msg
-
-def sanitize_reprs(reprs):
-    if 'exit status' in reprs:
-        reprs['exit-status'] = reprs.pop('exit status')
-
-class ResultFromMime(Result):
-    def __init__(self, path):
-        super(ResultFromMime, self).__init__(init=False)
-        f = open(str(path), 'r')
-        from email import message_from_file
-        msg = message_from_file(f)
-        f.close()
-        msg = sanitize(msg, path)
-        # XXX security wise evil (keep in mind once we accept reporsts
-        # from anonymous
-        #print msg['_reprs']
-        self._reprs = eval(msg['_reprs'])
-        del msg['_reprs']
-        sanitize_reprs(self._reprs)
-        for name, value in msg.items():
-            if name in self._reprs:
-                value = eval(value)  # XXX security
-            self._headers[name] = value
-        self.fspath = self['fspath']
-        if self['platform'] == 'win32' and '\\' in self.fspath:
-            self.testname = self.fspath.split('\\')[-1]
-        else:
-            self.testname = self.fspath.split('/')[-1]
-        #if sys.platform != 'win32' and '\\' in self.fspath:
-        #    self.fspath = py.path.local(self['fspath'].replace('\\'
-        self.path = path
-
-        payload = msg.get_payload()
-        if payload:
-            for submsg in payload:
-                assert submsg.get_content_type() == 'text/plain'
-                fn = submsg.get_filename()
-                assert fn
-                # XXX we need to deal better with encodings to
-                #     begin with
-                content = submsg.get_payload()
-                for candidate in 'utf8', 'latin1':
-                    try:
-                        text = unicode(content, candidate)
-                    except UnicodeDecodeError:
-                        continue
-                else:
-                    unicode(content, candidate)
-                self.addnamedtext(fn, text)
-
-    def ismodifiedtest(self):
-        # XXX we need proper cross-platform paths!
-        return 'modified' in self.fspath
-
-    def __repr__(self):
-        return '<%s (%s) %r rev=%s>' %(self.__class__.__name__,
-                                  self['outcome'],
-                                  self.fspath,
-                                  self['pypy-revision'])
-
-def stdinit(result):
-    import getpass
-    import socket
-    try:
-        username = getpass.getuser()
-    except:
-        username = 'unknown'
-    userhost = '%s@%s' % (username, socket.gethostname())
-    result['testreport-version'] = "1.1.1"
-    result['userhost'] = userhost
-    result['platform'] = sys.platform
-    result['python-version-info'] = sys.version_info
-    info = try_getcpuinfo()
-    if info is not None:
-        result['cpu-model'] = info.get('model name', "unknown")
-        result['cpu-mhz'] = info.get('cpu mhz', 'unknown')
-#
-#
-#
-def try_getcpuinfo():
-    if sys.platform.startswith('linux'):
-        cpuinfopath = py.path.local('/proc/cpuinfo')
-        if cpuinfopath.check(file=1):
-            d = {}
-            for line in cpuinfopath.readlines():
-                if line.strip():
-                    name, value = line.split(':', 1)
-                    name = name.strip().lower()
-                    d[name] = value.strip()
-            return d
diff --git a/pypy/tool/pytest/test/data/test___all__.txt 
b/pypy/tool/pytest/test/data/test___all__.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test___all__.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============0790678169=="
-MIME-Version: 1.0
-execution-time: 1445.14346004
-exit status: 1
-fspath: /Users/anderslehmann/pypy/lib-python/2.4.1/test/test___all__.py
-options: ['core', '_sre']
-outcome: T/O
-platform: darwin
-pypy-revision: 16114
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Wed Aug 17 23:51:59 2005
-testreport-version: 1.1
-timeout: 1369.0
-userhost: anderslehmann@anders-lehmanns-15-powerbook-g4.local
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============0790678169==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-test_all (__main__.AllTest) ... ERROR
-
-======================================================================
-ERROR: test_all (__main__.AllTest)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test___all__.py", line 
163, in test_all
-    self.check_all("tty")
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test___all__.py", line 
26, in check_all
-    "%s has no __all__ attribute" % modname)
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_support.py", line 
208, in verify
-    raise TestFailed(reason)
-TestFailed: tty has no __all__ attribute
-
-----------------------------------------------------------------------
-
---===============0790678169==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/Users/anderslehmann/pypy/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0x12068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0x120b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0x12020>
-faking <type '_socket.socket'>
-faking <type 'classobj'>
-faking <type 'PyCObject'>
-faking <type 'time.struct_time'>
-==========================timedout==========================
-Traceback (application-level):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test___all__.py", line 
192 in <module>
-    test_main()
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test___all__.py", line 
189 in test_main
-    test_support.run_unittest(AllTest)
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_support.py", line 
290 in run_unittest
-    run_suite(suite, testclass)
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_support.py", line 
262 in run_suite
-    result = runner.run(suite)
-Traceback (application-level):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/atexit.py", line 29 in 
_run_exitfuncs
-    print >> sys.stderr, "Error in atexit._run_exitfuncs:"
-KeyboardInterrupt
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/pypy/tool/alarm.py", line 43, in ?
-    execfile(_main_with_alarm(finished))
-  File "/Users/anderslehmann/pypy/pypy/bin/py.py", line 206, in ?
-    sys.exit(main_(sys.argv))
-  File "/Users/anderslehmann/pypy/pypy/bin/py.py", line 115, in main_
-    if not main.run_toplevel(space, doit, verbose=Options.verbose):
-  File "/Users/anderslehmann/pypy/pypy/interpreter/main.py", line 150, in 
run_toplevel
-    operationerr.print_application_traceback(space)
-  File "/Users/anderslehmann/pypy/pypy/interpreter/error.py", line 83, in 
print_application_traceback
-    self.print_app_tb_only(file)
-  File "/Users/anderslehmann/pypy/pypy/interpreter/error.py", line 104, in 
print_app_tb_only
-    l = linecache.getline(fname, lineno)
-  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/linecache.py", 
line 14, in getline
-    lines = getlines(filename)
-  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/linecache.py", 
line 40, in getlines
-    return updatecache(filename)
-  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/linecache.py", 
line 101, in updatecache
-    lines = fp.readlines()
-KeyboardInterrupt
-
---===============0790678169==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/data/test_compile.txt 
b/pypy/tool/pytest/test/data/test_compile.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test_compile.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============2137793924=="
-MIME-Version: 1.0
-execution-time: 34.8464071751
-exit status: 1
-fspath: /Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py
-options: ['core', '_sre']
-outcome: ERR
-platform: darwin
-pypy-revision: 16114
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Thu Aug 18 03:08:18 2005
-testreport-version: 1.1
-timeout: 1521.0
-userhost: anderslehmann@anders-lehmanns-15-powerbook-g4.local
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============2137793924==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-test_argument_handling (__main__.TestSpecifics) ... FAIL
-test_argument_order (__main__.TestSpecifics) ... FAIL
-test_complex_args (__main__.TestSpecifics) ... ok
-test_debug_assignment (__main__.TestSpecifics) ... FAIL
-test_duplicate_global_local (__main__.TestSpecifics) ... ok
-test_exec_with_general_mapping_for_locals (__main__.TestSpecifics) ... ok
-test_float_literals (__main__.TestSpecifics) ... ok
-test_for_distinct_code_objects (__main__.TestSpecifics) ... ok
-test_import (__main__.TestSpecifics) ... FAIL
-test_indentation (__main__.TestSpecifics) ... ok
-test_literals_with_leading_zeroes (__main__.TestSpecifics) ... ok
-test_none_assignment (__main__.TestSpecifics) ... FAIL
-test_sequence_unpacking_error (__main__.TestSpecifics) ... ok
-test_syntax_error (__main__.TestSpecifics) ... ok
-test_unary_minus (__main__.TestSpecifics) ... ok
-
-======================================================================
-FAIL: test_argument_handling (__main__.TestSpecifics)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
18, in test_argument_handling
-    self.assertRaises(SyntaxError, eval, 'lambda a,a:0')
-AssertionError: SyntaxError not raised
-
-======================================================================
-FAIL: test_argument_order (__main__.TestSpecifics)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
127, in test_argument_order
-    self.fail("non-default args after default")
-AssertionError: non-default args after default
-
-======================================================================
-FAIL: test_debug_assignment (__main__.TestSpecifics)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
10, in test_debug_assignment
-    self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
-AssertionError: SyntaxError not raised
-
-======================================================================
-FAIL: test_import (__main__.TestSpecifics)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
253, in test_import
-    self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'exec')
-AssertionError: SyntaxError not raised
-
-======================================================================
-FAIL: test_none_assignment (__main__.TestSpecifics)
-----------------------------------------------------------------------
-Traceback (most recent call last):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
211, in test_none_assignment
-    self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'single')
-AssertionError: SyntaxError not raised
-
-----------------------------------------------------------------------
-Ran 15 tests in 14.363s
-
-FAILED (failures=5)
-
---===============2137793924==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/Users/anderslehmann/pypy/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0x12068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0x120b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0x12020>
-Traceback (application-level):
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
268 in <module>
-    test_main()
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_compile.py", line 
265 in test_main
-    test_support.run_unittest(TestSpecifics)
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_support.py", line 
290 in run_unittest
-    run_suite(suite, testclass)
-  File "/Users/anderslehmann/pypy/lib-python/2.4.1/test/test_support.py", line 
274 in run_suite
-    raise TestFailed(msg)
-TestFailed: errors occurred in __main__.TestSpecifics
-
---===============2137793924==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/data/test_descr.txt 
b/pypy/tool/pytest/test/data/test_descr.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test_descr.txt
+++ /dev/null
@@ -1,233 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============1265023865=="
-MIME-Version: 1.0
-execution-time: 4098.8407588
-exit status: 1
-fspath: /Users/anderslehmann/pypy/lib-python/modified-2.4.1/test/test_descr.py
-options: ['oldstyle', 'core']
-outcome: ERR
-platform: darwin
-pypy-revision: 16388
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Wed Aug 24 16:54:12 2005
-testreport-version: 1.1
-timeout: 10000.0
-userhost: anderslehmann@anders-lehmanns-15-powerbook-g4.local
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============1265023865==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-****************************************
---> weakref_segfault FAILURE(0/92) _weakref
-****************************************
---> do_this_first OK(1/92)
-****************************************
---> class_docstrings OK(2/92)
-****************************************
---> lists FAILURE(2/92) type object 'list' has no attribute '__getslice__'
-****************************************
---> dicts FAILURE(2/92) type object 'dict' has no attribute '__cmp__'
-****************************************
---> dict_constructor OK(3/92)
-****************************************
---> test_dir OK(4/92)
-****************************************
---> ints OK(5/92)
-****************************************
---> longs OK(6/92)
-****************************************
---> floats OK(7/92)
-****************************************
---> complexes OK(8/92)
-****************************************
---> spamlists FAILURE(8/92) xxsubtype
-****************************************
---> spamdicts FAILURE(8/92) xxsubtype
-****************************************
---> pydicts OK(9/92)
-****************************************
---> pylists OK(10/92)
-****************************************
---> metaclass OK(11/92)
-****************************************
---> pymods OK(12/92)
-****************************************
---> multi OK(13/92)
-****************************************
---> mro_disagreement FAILURE(13/92) Message 'cycle among base classes: A < B < 
A', expected 'Cannot create a consistent method resolution\norder (MRO) for 
bases '
-****************************************
---> diamond OK(14/92)
-****************************************
---> ex5 OK(15/92)
-****************************************
---> monotonicity OK(16/92)
-****************************************
---> consistency_with_epg OK(17/92)
-****************************************
---> objects OK(18/92)
-****************************************
---> slots FAILURE(18/92) ['foo bar'] slots not caught
-****************************************
---> slotspecials FAILURE(18/92) test failed
-****************************************
---> dynamics OK(19/92)
-****************************************
---> errors FAILURE(19/92) inheritance from CFunction should be illegal
-****************************************
---> classmethods OK(20/92)
-****************************************
---> classmethods_in_c FAILURE(20/92) xxsubtype
-****************************************
---> staticmethods OK(21/92)
-****************************************
---> staticmethods_in_c FAILURE(21/92) xxsubtype
-****************************************
---> classic OK(22/92)
-****************************************
---> compattr OK(23/92)
-****************************************
---> newslot OK(24/92)
-****************************************
---> altmro OK(25/92)
-****************************************
---> overloading OK(26/92)
-****************************************
---> methods FAILURE(26/92) test failed
-****************************************
---> specials FAILURE(26/92) shouldn't allow <type 'unicode'>.__cmp__(u'123', 
'123')
-****************************************
---> weakrefs FAILURE(26/92) 'module' object has no attribute 'ref'
-****************************************
---> properties FAILURE(26/92) expected TypeError from trying to set readonly 
'__doc__' attr on a property
-****************************************
---> supers OK(27/92)
-****************************************
---> inherits FAILURE(27/92) test failed
-****************************************
---> keywords FAILURE(27/92) descr__new__() got an unexpected keyword argument 
'string'
-****************************************
---> restricted OK(28/92)
-****************************************
---> str_subclass_as_dict_key OK(29/92)
-****************************************
---> classic_comparisons OK(30/92)
-****************************************
---> rich_comparisons OK(31/92)
-****************************************
---> coercions OK(32/92)
-****************************************
---> descrdoc FAILURE(32/92) 'The most base type' == 'True if the file is 
closed'
-****************************************
---> setclass OK(33/92)
-****************************************
---> setdict OK(34/92)
-****************************************
---> pickles OK(35/92)
-****************************************
---> copies OK(36/92)
-****************************************
---> binopoverride OK(37/92)
-****************************************
---> subclasspropagation OK(38/92)
-****************************************
---> buffer_inherit OK(39/92)
-****************************************
---> str_of_str_subclass OK(40/92)
-****************************************
---> kwdargs OK(41/92)
-****************************************
---> delhook OK(42/92)
-****************************************
---> hashinherit OK(43/92)
-****************************************
---> strops OK(44/92)
-****************************************
---> deepcopyrecursive OK(45/92)
-****************************************
---> modules OK(46/92)
-****************************************
---> dictproxyiterkeys FAILURE(46/92) ['__dict__', '__module__', 'meth'] == 
['__dict__', '__doc__', '__module__', '__weakref__', 'meth']
-****************************************
---> dictproxyitervalues FAILURE(46/92) 3 == 5
-****************************************
---> dictproxyiteritems FAILURE(46/92) ['__dict__', '__module__', 'meth'] == 
['__dict__', '__doc__', '__module__', '__weakref__', 'meth']
-****************************************
---> pickleslots OK(47/92)
-****************************************
---> funnynew OK(48/92)
-****************************************
---> imulbug OK(49/92)
-****************************************
---> docdescriptor OK(50/92)
-****************************************
---> string_exceptions FAILURE(50/92) string subclass allowed as exception
-****************************************
---> copy_setstate OK(51/92)
-****************************************
---> slices OK(52/92)
-****************************************
---> subtype_resurrection OK(53/92)
-****************************************
---> slottrash OK(54/92)
-****************************************
---> slotmultipleinheritance FAILURE(54/92) type object 'C' has no attribute 
'__basicsize__'
-****************************************
---> testrmul OK(55/92)
-****************************************
---> testipow OK(56/92)
-****************************************
---> test_mutable_bases FAILURE(56/92) readonly attribute
-****************************************
---> test_mutable_bases_with_failing_mro FAILURE(56/92) readonly attribute
-****************************************
---> test_mutable_bases_catch_mro_conflict OK(57/92)
-****************************************
---> mutable_names OK(58/92)
-****************************************
---> subclass_right_op OK(59/92)
-****************************************
---> dict_type_with_metaclass OK(60/92)
-****************************************
---> meth_class_get FAILURE(60/92) shouldn't have allowed descr.__get__(None, 
None)
-****************************************
---> isinst_isclass OK(61/92)
-****************************************
---> proxysuper OK(62/92)
-****************************************
---> carloverre OK(63/92)
-****************************************
---> filefault OK(64/92)
-****************************************
---> vicious_descriptor_nonsense OK(65/92)
-****************************************
---> test_init FAILURE(65/92) did not test __init__() for None return
-
---===============1265023865==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/Users/anderslehmann/pypy/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0x12068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0x120b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0x12020>
-faking <type '_sre.SRE_Pattern'>
-faking <type '_sre.SRE_Match'>
-Traceback (application-level):
-  File "/Users/anderslehmann/pypy/pypy/tool/pytest/regrverbose.py", line 12 in 
<module>
-    indirect_test()
-  File 
"/Users/anderslehmann/pypy/lib-python/modified-2.4.1/test/test_descr.py", line 
4102 in test_main
-    raise TestFailed, "%d/%d" % (success, n)
-TestFailed: 65/92
-
---===============1265023865==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/data/test_generators.txt 
b/pypy/tool/pytest/test/data/test_generators.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test_generators.txt
+++ /dev/null
@@ -1,317 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============1565511160=="
-MIME-Version: 1.0
-cpu mhz: unknown
-cpu model: unknown
-execution-time: 671.678878069
-exit status: 1
-fspath: 
/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py
-options: ['core']
-outcome: ERR
-platform: linux2
-pypy-revision: 16123
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Thu Aug 18 02:08:13 2005
-testreport-version: 1.1
-timeout: 3136.0
-userhost: xoraxax@tick
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============1565511160==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    import weakref
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[0]>", line 1, in 
<interactive>
-        import weakref
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/weakref.py", line 
14, in <module>
-        from _weakref import (
-    ImportError: _weakref
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    wr = weakref.ref(gen)
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[2]>", line 1, in 
<interactive>
-        wr = weakref.ref(gen)
-    NameError: global name 'weakref' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    wr() is gen
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[3]>", line 1, in 
<interactive>
-        wr() is gen
-    NameError: global name 'wr' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    p = weakref.proxy(gen)
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[4]>", line 1, in 
<interactive>
-        p = weakref.proxy(gen)
-    NameError: global name 'weakref' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    wr = weakref.ref(gi)
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[6]>", line 1, in 
<interactive>
-        wr = weakref.ref(gi)
-    NameError: global name 'weakref' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    wr() is gi
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[7]>", line 1, in 
<interactive>
-        wr() is gi
-    NameError: global name 'wr' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    p = weakref.proxy(gi)
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[8]>", line 1, in 
<interactive>
-        p = weakref.proxy(gi)
-    NameError: global name 'weakref' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.weakref
-Failed example:
-    list(p)
-Exception raised:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.weakref[9]>", line 1, in 
<interactive>
-        list(p)
-    NameError: global name 'p' is not defined
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.pep
-Failed example:
-    k.next()
-Expected:
-    Traceback (most recent call last):
-      File "<stdin>", line 1, in ?
-      File "<stdin>", line 2, in g
-      File "<stdin>", line 2, in f
-    ZeroDivisionError: integer division or modulo by zero
-Got:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.pep[10]>", line 1, in 
<interactive>
-        k.next()
-      File "<doctest test.test_generators.__test__.pep[8]>", line 2, in g
-        yield f()  # the zero division exception propagates
-      File "<doctest test.test_generators.__test__.pep[7]>", line 2, in f
-        return 1//0
-    ZeroDivisionError: integer division by zero
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        return 22
-        yield 1
-Expected:
-    Traceback (most recent call last):
-      ..
-    SyntaxError: 'return' with argument inside generator (<doctest 
test.test_generators.__test__.syntax[0]>, line 2)
-Got nothing
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        yield 1
-        return 22
-Expected:
-    Traceback (most recent call last):
-      ..
-    SyntaxError: 'return' with argument inside generator (<doctest 
test.test_generators.__test__.syntax[1]>, line 3)
-Got nothing
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        yield 1
-        return None
-Expected:
-    Traceback (most recent call last):
-      ..
-    SyntaxError: 'return' with argument inside generator (<doctest 
test.test_generators.__test__.syntax[2]>, line 3)
-Got nothing
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        try:
-            yield 1
-        finally:
-            pass
-Expected:
-    Traceback (most recent call last):
-      ..
-    SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause 
(<doctest test.test_generators.__test__.syntax[4]>, line 3)
-Got nothing
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        try:
-            try:
-                1//0
-            except ZeroDivisionError:
-                yield 666  # bad because *outer* try has finally
-            except:
-                pass
-        finally:
-            pass
-Expected:
-    Traceback (most recent call last):
-      ...
-    SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause 
(<doctest test.test_generators.__test__.syntax[5]>, line 6)
-Got nothing
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-       yield
-Expected:
-    Traceback (most recent call last):
-    SyntaxError: invalid syntax
-Got:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.syntax[8]>", line 2
-         def f():
-                ^
-     SyntaxError: error
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-       if 0:
-           yield
-Expected:
-    Traceback (most recent call last):
-    SyntaxError: invalid syntax
-Got:
-    Traceback (most recent call last):
-      File "/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/doctest.py", line 
1243, in __run
-        compileflags, 1) in test.globs
-      File "<doctest test.test_generators.__test__.syntax[9]>", line 3
-         def f():
-                ^
-     SyntaxError: error
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    type(f())
-Expected:
-    <type 'generator'>
-Got:
-    <type 'NoneType'>
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    type(f())
-Expected:
-    <type 'generator'>
-Got:
-    <type 'NoneType'>
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    type(f())
-Expected:
-    <type 'generator'>
-Got:
-    <type 'NoneType'>
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    type(f())
-Expected:
-    <type 'generator'>
-Got:
-    <type 'NoneType'>
-**********************************************************************
-File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line ?, in test.test_generators.__test__.syntax
-Failed example:
-    def f():
-        if 0:
-            lambda x:  x        # shouldn't trigger here
-            return              # or here
-            def f(i):
-                return 2*i      # or here
-            if 0:
-                return 3        # but *this* sucks (line 8)
-        if 0:
-            yield 2             # because it's a generator
-Expected:
-    Traceback (most recent call last):
-    SyntaxError: 'return' with argument inside generator (<doctest 
test.test_generators.__test__.syntax[22]>, line 8)
-Got nothing
-**********************************************************************
-3 items had failures:
-   1 of  22 in test.test_generators.__test__.pep
-  12 of  29 in test.test_generators.__test__.syntax
-   8 of  10 in test.test_generators.__test__.weakref
-***Test Failed*** 21 failures.
-
---===============1565511160==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/home/contest/xoraxax/pypy-dist/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0xf7fa3068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0xf7fa30b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0xf7fa3020>
-faking <type '_sre.SRE_Pattern'>
-faking <type '_sre.SRE_Match'>
-faking <type 'callable-iterator'>
-Traceback (application-level):
-  File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line 1405 in <module>
-    test_main(1)
-  File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_generators.py", 
line 1401 in test_main
-    test_support.run_doctest(test_generators, verbose)
-  File 
"/home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_support.py", line 
319 in run_doctest
-    finally:
-TestFailed: 21 of 154 doctests failed
-
---===============1565511160==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/data/test_global.txt 
b/pypy/tool/pytest/test/data/test_global.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test_global.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============1988336873=="
-MIME-Version: 1.0
-cpu mhz: unknown
-cpu model: unknown
-execution-time: 12.6530230045
-exit status: 2
-fspath: /home/contest/xoraxax/pypy-dist/lib-python/2.4.1/test/test_global.py
-options: ['core']
-outcome: ERROUT
-platform: linux2
-pypy-revision: 16123
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Thu Aug 18 02:12:59 2005
-testreport-version: 1.1
-timeout: 3844.0
-userhost: xoraxax@tick
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============1988336873==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-should have raised SyntaxError: 
-def wrong1():
-    a = 1
-    b = 2
-    global a
-    global b
-
-should have raised SyntaxError: 
-def wrong2():
-    print x
-    global x
-
-should have raised SyntaxError: 
-def wrong3():
-    print x
-    x = 2
-    global x
-
-as expected, no SyntaxError
-
---===============1988336873==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/home/contest/xoraxax/pypy-dist/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0xf7fa3068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0xf7fa30b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0xf7fa3020>
-faking <type '_sre.SRE_Pattern'>
-
---===============1988336873==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="reportdiff"
-
-**********************************************************************
-*** mismatch between lines 2-4 of expected output and lines 2-19 of actual 
output:
-- got SyntaxError as expected
-- got SyntaxError as expected
-- got SyntaxError as expected
-+ should have raised SyntaxError: 
-+ def wrong1():
-+     a = 1
-+     b = 2
-+     global a
-+     global b
-+ 
-+ should have raised SyntaxError: 
-+ def wrong2():
-+     print x
-+     global x
-+ 
-+ should have raised SyntaxError: 
-+ def wrong3():
-+     print x
-+     x = 2
-+     global x
-+ 
-**********************************************************************
-
---===============1988336873==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/data/test_sys.txt 
b/pypy/tool/pytest/test/data/test_sys.txt
deleted file mode 100644
--- a/pypy/tool/pytest/test/data/test_sys.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-Content-Type: multipart/mixed; boundary="===============1380540766=="
-MIME-Version: 1.0
-cpu mhz: unknown
-cpu model: unknown
-execution-time: 22.5916008949
-exit status: 0
-fspath: 
/home/contest/xoraxax/pypy-dist/lib-python/modified-2.4.1/test/test_sys.py
-options: ['core']
-outcome: OK
-platform: linux2
-pypy-revision: 16123
-python-version-info: (2, 4, 1, 'final', 0)
-startdate: Thu Aug 18 04:16:48 2005
-testreport-version: 1.1
-timeout: 3364.0
-userhost: xoraxax@tick
-_reprs: {'execution-time': 'float', 'python-version-info': 'tuple',
-       'options': 'list', 'timeout': 'float', 'pypy-revision': 'int',
-       'exit status': 'int'}
-
---===============1380540766==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stdout"
-
-test_attributes (__main__.SysModuleTest) ... ok
-test_custom_displayhook (__main__.SysModuleTest) ... ok
-test_dlopenflags (__main__.SysModuleTest) ... ok
-test_exc_clear (__main__.SysModuleTest) ... ok
-test_exit (__main__.SysModuleTest) ... ok
-test_getdefaultencoding (__main__.SysModuleTest) ... ok
-test_getframe (__main__.SysModuleTest) ... ok
-test_getwindowsversion (__main__.SysModuleTest) ... ok
-test_lost_displayhook (__main__.SysModuleTest) ... ok
-test_original_displayhook (__main__.SysModuleTest) ... ok
-test_original_excepthook (__main__.SysModuleTest) ... ok
-test_recursionlimit (__main__.SysModuleTest) ... ok
-test_setcheckinterval (__main__.SysModuleTest) ... ok
-
-----------------------------------------------------------------------
-Ran 13 tests in 7.241s
-
-OK
-
---===============1380540766==
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Content-Disposition: attachment; filename="stderr"
-
-faking <type 'module'>
-Loading grammar 
/home/contest/xoraxax/pypy-dist/pypy/interpreter/pyparser/data/Grammar2.4
-faking <type 'file'>
-faking <type 'posix.stat_result'>
-faking <type 'posix.statvfs_result'>
-fake-wrapping interp file <open file '<stdout>', mode 'w' at 0xf7fa3068>
-fake-wrapping interp file <open file '<stderr>', mode 'w' at 0xf7fa30b0>
-fake-wrapping interp file <open file '<stdin>', mode 'r' at 0xf7fa3020>
-
---===============1380540766==--
\ No newline at end of file
diff --git a/pypy/tool/pytest/test/test_new_count.py 
b/pypy/tool/pytest/test/test_new_count.py
deleted file mode 100644
--- a/pypy/tool/pytest/test/test_new_count.py
+++ /dev/null
@@ -1,32 +0,0 @@
-
-import py
-#from pypy.tool.pytest.confpath import testresultdir
-from pypy.tool.pytest.result import ResultFromMime
-testpath = py.path.local(__file__).dirpath('data')
-
-class TestResultCache:
-
-    def test_timeout(self):
-        test = ResultFromMime(testpath.join('test___all__.txt'))
-        assert test.ratio_of_passed() == 0.
-
-    def test_passed(self):
-        test = ResultFromMime(testpath.join('test_sys.txt'))
-        assert test.ratio_of_passed() == 1.
-
-    def test_unittest_partial(self):
-        test = ResultFromMime(testpath.join('test_compile.txt'))
-        assert test.ratio_of_passed() == 10./15
-    
-    def test_doctest_of(self):
-        test = ResultFromMime(testpath.join('test_generators.txt'))
-        assert test.ratio_of_passed() == 133./154
-
-    def test_doctest_slash(self):
-        test = ResultFromMime(testpath.join('test_descr.txt'))
-        assert test.ratio_of_passed() == 65./92
-
-    def test_fail(self):
-        test = ResultFromMime(testpath.join('test_global.txt'))
-        assert test.ratio_of_passed() == 0.
-
diff --git a/pypy/tool/pytest/test/test_overview.py 
b/pypy/tool/pytest/test/test_overview.py
deleted file mode 100644
--- a/pypy/tool/pytest/test/test_overview.py
+++ /dev/null
@@ -1,23 +0,0 @@
-
-import py
-from pypy.tool.pytest.confpath import testresultdir 
-from pypy.tool.pytest.overview import ResultCache 
-
-class TestResultCache: 
-    def setup_class(cls): 
-        if not testresultdir.check(dir=1):
-            py.test.skip("testresult directory not checked out")
-        cls.rc = ResultCache(testresultdir) 
-        cls.rc.parselatest()
-
-    def test_getlatest_all(self): 
-        for type in 'error', 'timeout', 'ok': 
-            for name in self.rc.getnames(): 
-                result = self.rc.getlatest(name, **{type:1})
-                if result: 
-                    meth = getattr(result, 'is'+type)
-                    assert meth()
-
-    #def test_getlatest_datetime(self): 
-    #    result = self.rc.getlatest('test_datetime', ok=1) 
-    #    assert result
diff --git a/pypy/tool/release/force-builds.py 
b/pypy/tool/release/force-builds.py
--- a/pypy/tool/release/force-builds.py
+++ b/pypy/tool/release/force-builds.py
@@ -31,6 +31,9 @@
     'pypy-c-jit-linux-s390x',
     'build-pypy-c-jit-linux-armhf-raspbian',
     'build-pypy-c-jit-linux-armel',
+    'rpython-linux-x86-32',
+    'rpython-linux-x86-64'
+    'rpython-win-x86-32'
 ]
 
 def get_user():
diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -732,14 +732,16 @@
 
     def move_out_of_nursery(self, obj):
         # called twice, it should return the same shadow object,
-        # and not creating another shadow object
-        if self.header(obj).tid & GCFLAG_HAS_SHADOW:
-            shadow = self.nursery_objects_shadows.get(obj)
-            ll_assert(shadow != llmemory.NULL,
-                      "GCFLAG_HAS_SHADOW but no shadow found")
-            return shadow
-
-        return self._allocate_shadow(obj, copy=True)
+        # and not creating another shadow object.  As a safety feature,
+        # when called on a non-nursery object, do nothing.
+        if not self.is_in_nursery(obj):
+            return obj
+        shadow = self._find_shadow(obj)
+        if (self.header(obj).tid & GCFLAG_SHADOW_INITIALIZED) == 0:
+            self.header(obj).tid |= GCFLAG_SHADOW_INITIALIZED
+            totalsize = self.get_size(obj)
+            llmemory.raw_memcopy(obj, shadow, totalsize)
+        return shadow
 
     def collect(self, gen=2):
         """Do a minor (gen=0), start a major (gen=1), or do a full
@@ -2081,13 +2083,12 @@
             ll_assert(newobj != llmemory.NULL, "GCFLAG_HAS_SHADOW but no 
shadow found")
             newhdr = newobj - size_gc_header
             #
-            # Remove the flag GCFLAG_HAS_SHADOW, so that it doesn't get
-            # copied to the shadow itself.
-            self.header(obj).tid &= ~GCFLAG_HAS_SHADOW
+            # The flags GCFLAG_HAS_SHADOW and GCFLAG_SHADOW_INITIALIZED
+            # have no meaning in non-nursery objects.  We don't need to
+            # remove them explicitly here before doing the copy.
             tid = self.header(obj).tid
             if (tid & GCFLAG_SHADOW_INITIALIZED) != 0:
                 copy = False
-                self.header(obj).tid &= ~GCFLAG_SHADOW_INITIALIZED
             #
             totalsize = size_gc_header + self.get_size(obj)
             self.nursery_surviving_size += raw_malloc_usage(totalsize)
@@ -2665,8 +2666,7 @@
     # ----------
     # id() and identityhash() support
 
-    @specialize.arg(2)
-    def _allocate_shadow(self, obj, copy=False):
+    def _allocate_shadow(self, obj):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         size = self.get_size(obj)
         shadowhdr = self._malloc_out_of_nursery(size_gc_header +
@@ -2688,12 +2688,6 @@
         #
         self.header(obj).tid |= GCFLAG_HAS_SHADOW
         self.nursery_objects_shadows.setitem(obj, shadow)
-
-        if copy:
-            self.header(obj).tid |= GCFLAG_SHADOW_INITIALIZED
-            totalsize = size_gc_header + self.get_size(obj)
-            llmemory.raw_memcopy(obj - size_gc_header, shadow, totalsize)
-
         return shadow
 
     def _find_shadow(self, obj):
diff --git a/rpython/memory/gc/test/test_direct.py 
b/rpython/memory/gc/test/test_direct.py
--- a/rpython/memory/gc/test/test_direct.py
+++ b/rpython/memory/gc/test/test_direct.py
@@ -675,6 +675,25 @@
         self.gc.debug_gc_step_until(incminimark.STATE_SCANNING)
         assert self.stackroots[1].x == 13
 
+    def test_move_out_of_nursery(self):
+        obj0 = self.malloc(S)
+        obj0.x = 123
+        adr1 = self.gc.move_out_of_nursery(llmemory.cast_ptr_to_adr(obj0))
+        obj1 = llmemory.cast_adr_to_ptr(adr1, lltype.Ptr(S))
+        assert obj1.x == 123
+        #
+        import pytest
+        obj2 = self.malloc(S)
+        obj2.x = 456
+        adr3 = self.gc._find_shadow(llmemory.cast_ptr_to_adr(obj2))
+        obj3 = llmemory.cast_adr_to_ptr(adr3, lltype.Ptr(S))
+        with pytest.raises(lltype.UninitializedMemoryAccess):
+            obj3.x     # the shadow is not populated yet
+        adr4 = self.gc.move_out_of_nursery(llmemory.cast_ptr_to_adr(obj2))
+        assert adr4 == adr3
+        assert obj3.x == 456     # it is populated now
+
+
 class TestIncrementalMiniMarkGCFull(DirectGCTest):
     from rpython.memory.gc.incminimark import IncrementalMiniMarkGC as GCClass
     def test_malloc_fixedsize_no_cleanup(self):
diff --git a/rpython/rlib/rvmprof/src/shared/_vmprof.c 
b/rpython/rlib/rvmprof/src/shared/_vmprof.c
--- a/rpython/rlib/rvmprof/src/shared/_vmprof.c
+++ b/rpython/rlib/rvmprof/src/shared/_vmprof.c
@@ -36,6 +36,8 @@
     register PY_STACK_FRAME_T * callee_saved asm("rbx");
 #elif defined(X86_32)
     register PY_STACK_FRAME_T * callee_saved asm("edi");
+#elif defined(__arm__)
+    register PY_STACK_FRAME_T * callee_saved asm("r4");
 #else
 #    error "platform not supported"
 #endif
@@ -45,6 +47,8 @@
         "movq %1, %0\t\n"
 #elif defined(X86_32)
         "mov %1, %0\t\n"
+#elif defined(__arm__)
+       "mov %1, %0\t\n"
 #else
 #    error "platform not supported"
 #endif
diff --git a/rpython/rlib/rvmprof/src/shared/vmp_stack.c 
b/rpython/rlib/rvmprof/src/shared/vmp_stack.c
--- a/rpython/rlib/rvmprof/src/shared/vmp_stack.c
+++ b/rpython/rlib/rvmprof/src/shared/vmp_stack.c
@@ -16,7 +16,7 @@
 
 #ifdef VMP_SUPPORTS_NATIVE_PROFILING
 
-#ifdef VMPROF_LINUX
+#if defined(VMPROF_LINUX) || defined(VMPROF_BSD)
 #include "unwind/vmprof_unwind.h"
 typedef mcontext_t unw_context_t;
 
@@ -510,13 +510,15 @@
 static const char * vmprof_error = NULL;
 static void * libhandle = NULL;
 
-
 #ifdef VMPROF_LINUX
+#include <link.h>
 #define LIBUNWIND "libunwind.so"
 #ifdef __i386__
 #define PREFIX "x86"
+#define LIBUNWIND_SUFFIX ""
 #elif __x86_64__
 #define PREFIX "x86_64"
+#define LIBUNWIND_SUFFIX "-x86_64"
 #endif
 #define U_PREFIX "_U"
 #define UL_PREFIX "_UL"
@@ -524,10 +526,41 @@
 
 int vmp_native_enable(void) {
 #ifdef VMPROF_LINUX
+    void * oldhandle = NULL;
+    struct link_map * map = NULL;
     if (libhandle == NULL) {
+        // on linux, the wheel includes the libunwind shared object.
+        libhandle = dlopen(NULL, RTLD_NOW);
+        if (libhandle != NULL) {
+            // load the link map, it will contain an entry to
+            // .libs_vmprof/libunwind-...so, this is the file that is
+            // distributed with the wheel.
+            if (dlinfo(libhandle, RTLD_DI_LINKMAP, &map) != 0) {
+                (void)dlclose(libhandle);
+                libhandle = NULL;
+                goto bail_out;
+            }
+            // grab the new handle
+            do {
+                if (strstr(map->l_name, ".libs_vmprof/libunwind" 
LIBUNWIND_SUFFIX) != NULL) {
+                    oldhandle = libhandle;
+                    libhandle = dlopen(map->l_name, RTLD_LAZY|RTLD_LOCAL);
+                    (void)dlclose(oldhandle);
+                    oldhandle = NULL;
+                    goto loaded_libunwind;
+                }
+                map = map->l_next;
+            } while (map != NULL);
+            // did not find .libs_vmprof/libunwind...
+            (void)dlclose(libhandle);
+            libhandle = NULL;
+        }
+
+        // fallback! try to load the system's libunwind.so
         if ((libhandle = dlopen(LIBUNWIND, RTLD_LAZY | RTLD_LOCAL)) == NULL) {
             goto bail_out;
         }
+loaded_libunwind:
         if ((unw_get_reg = dlsym(libhandle, UL_PREFIX PREFIX "_get_reg")) == 
NULL) {
             goto bail_out;
         }
diff --git a/rpython/rlib/rvmprof/src/shared/vmprof_common.h 
b/rpython/rlib/rvmprof/src/shared/vmprof_common.h
--- a/rpython/rlib/rvmprof/src/shared/vmprof_common.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof_common.h
@@ -23,6 +23,10 @@
 #include <syscall.h>
 #endif
 
+#ifdef VMPROF_BSD
+#include <sys/syscall.h>
+#endif
+
 #define MAX_FUNC_NAME 1024
 
 #ifdef VMPROF_UNIX
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to