Skip to content

Instantly share code, notes, and snippets.

@timfel
Created April 29, 2013 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timfel/5481905 to your computer and use it in GitHub Desktop.
Save timfel/5481905 to your computer and use it in GitHub Desktop.
failures on ubuntu precise 32bit
Started by upstream project "ha:AAAAmR+LCAAAAAAAAABb85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAz2EgZe/az8JP2Q/ILEKmMjfQCcHZdXwgAAAA==Topaz32" build number ha:AAAAmx+LCAAAAAAAAABb85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAymEgZ+/az8JP2Q/ILEKmMjfSNLAAeYdPTEAAAA29
originally caused by:
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on Precise32 in workspace /home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/Precise32
Checkout:Precise32 / /home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/Precise32 - hudson.remoting.Channel@60be9782:Precise32
Using strategy: Default
Last Built Revision: Revision 1363b8df311f1fe703259143fa4d3074ac1ae2c2 (origin/master)
Cloning the remote Git repository
Cloning repository git://github.com/topazproject/topaz.git
git --version
git version 1.7.9.5
Fetching upstream changes from origin
Cleaning workspace
Resetting working tree
Commencing build of Revision 70b72b428204fe4ed8156392c3d54739110c24ba (origin/master)
Checking out Revision 70b72b428204fe4ed8156392c3d54739110c24ba (origin/master)
Cleaning workspace
Resetting working tree
[Precise32] $ /bin/sh -xe /tmp/hudson4631733466178831953.sh
+ sudo chown -R vagrant /usr/local/lib/python2.7/ /usr/lib/python2.7/ /usr/local/
+ pip install --use-mirrors requests invoke
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): invoke in /usr/local/lib/python2.7/dist-packages
Cleaning up...
+ invoke travis.install_requirements
--2013-04-28 22:56:33-- https://bitbucket.org/pypy/pypy/get/default.tar.bz2
Resolving bitbucket.org (bitbucket.org)... 207.223.240.182, 207.223.240.181
Connecting to bitbucket.org (bitbucket.org)|207.223.240.182|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14617044 (14M) [application/x-bzip-compressed-tar]
Saving to: `/home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/Precise32/../pypy.tar.bz2'
0K .......... .......... .......... .......... .......... 0% 222K 64s
50K .......... .......... .......... .......... .......... 0% 216K 65s
100K .......... .......... .......... .......... .......... 1% 326K 57s
150K .......... .......... .......... .......... .......... 1% 256K 57s
200K .......... .......... .......... .......... .......... 1% 628K 50s
250K .......... .......... .......... .......... .......... 2% 1.12M 43s
300K .......... .......... .......... .......... .......... 2% 426K 42s
350K .......... .......... .......... .......... .......... 2% 460K 40s
400K .......... .......... .......... .......... .......... 3% 446K 39s
450K .......... .......... .......... .......... .......... 3% 3.20M 35s
500K .......... .......... .......... .......... .......... 3% 503K 34s
550K .......... .......... .......... .......... .......... 4% 2.90M 32s
600K .......... .......... .......... .......... .......... 4% 781K 31s
650K .......... .......... .......... .......... .......... 4% 283K 32s
700K .......... .......... .......... .......... .......... 5% 4.32M 30s
750K .......... .......... .......... .......... .......... 5% 474K 30s
800K .......... .......... .......... .......... .......... 5% 4.46M 28s
850K .......... .......... .......... .......... .......... 6% 26.4M 26s
900K .......... .......... .......... .......... .......... 6% 512K 26s
950K .......... .......... .......... .......... .......... 7% 4.50M 25s
1000K .......... .......... .......... .......... .......... 7% 10.8M 24s
1050K .......... .......... .......... .......... .......... 7% 464K 24s
1100K .......... .......... .......... .......... .......... 8% 5.25M 23s
1150K .......... .......... .......... .......... .......... 8% 23.7M 22s
1200K .......... .......... .......... .......... .......... 8% 30.1K 38s
1250K .......... .......... .......... .......... .......... 9% 4.49M 37s
1300K .......... .......... .......... .......... .......... 9% 14.9M 35s
1350K .......... .......... .......... .......... .......... 9% 4.34M 34s
1400K .......... .......... .......... .......... .......... 10% 18.9M 33s
1450K .......... .......... .......... .......... .......... 10% 4.07M 32s
1500K .......... .......... .......... .......... .......... 10% 8.17M 30s
1550K .......... .......... .......... .......... .......... 11% 4.57M 29s
1600K .......... .......... .......... .......... .......... 11% 5.59M 29s
1650K .......... .......... .......... .......... .......... 11% 7.30M 28s
1700K .......... .......... .......... .......... .......... 12% 4.46M 27s
1750K .......... .......... .......... .......... .......... 12% 31.3K 37s
1800K .......... .......... .......... .......... .......... 12% 3.90M 36s
1850K .......... .......... .......... .......... .......... 13% 7.93M 35s
1900K .......... .......... .......... .......... .......... 13% 4.34M 34s
1950K .......... .......... .......... .......... .......... 14% 4.60M 33s
2000K .......... .......... .......... .......... .......... 14% 10.8M 32s
2050K .......... .......... .......... .......... .......... 14% 30.6K 41s
2100K .......... .......... .......... .......... .......... 15% 4.63M 40s
2150K .......... .......... .......... .......... .......... 15% 3.48M 39s
2200K .......... .......... .......... .......... .......... 15% 3.43M 38s
2250K .......... .......... .......... .......... .......... 16% 9.59M 37s
2300K .......... .......... .......... .......... .......... 16% 3.85M 36s
2350K .......... .......... .......... .......... .......... 16% 6.96M 35s
2400K .......... .......... .......... .......... .......... 17% 4.92M 34s
2450K .......... .......... .......... .......... .......... 17% 18.1M 33s
2500K .......... .......... .......... .......... .......... 17% 3.47M 33s
2550K .......... .......... .......... .......... .......... 18% 3.97M 32s
2600K .......... .......... .......... .......... .......... 18% 33.1M 31s
2650K .......... .......... .......... .......... .......... 18% 32.0K 37s
2700K .......... .......... .......... .......... .......... 19% 9.41M 36s
2750K .......... .......... .......... .......... .......... 19% 6.81M 36s
2800K .......... .......... .......... .......... .......... 19% 32.1K 41s
2850K .......... .......... .......... .......... .......... 20% 4.28M 40s
2900K .......... .......... .......... .......... .......... 20% 22.8M 39s
2950K .......... .......... .......... .......... .......... 21% 3.67M 39s
3000K .......... .......... .......... .......... .......... 21% 11.0M 38s
3050K .......... .......... .......... .......... .......... 21% 4.39M 37s
3100K .......... .......... .......... .......... .......... 22% 4.90M 36s
3150K .......... .......... .......... .......... .......... 22% 26.6M 36s
3200K .......... .......... .......... .......... .......... 22% 32.7K 40s
3250K .......... .......... .......... .......... .......... 23% 7.02M 39s
3300K .......... .......... .......... .......... .......... 23% 4.94M 39s
3350K .......... .......... .......... .......... .......... 23% 15.6M 38s
3400K .......... .......... .......... .......... .......... 24% 3.78M 37s
3450K .......... .......... .......... .......... .......... 24% 18.7M 37s
3500K .......... .......... .......... .......... .......... 24% 19.3M 36s
3550K .......... .......... .......... .......... .......... 25% 32.3K 40s
3600K .......... .......... .......... .......... .......... 25% 3.85M 39s
3650K .......... .......... .......... .......... .......... 25% 14.2M 38s
3700K .......... .......... .......... .......... .......... 26% 3.41M 38s
3750K .......... .......... .......... .......... .......... 26% 16.0M 37s
3800K .......... .......... .......... .......... .......... 26% 3.20M 37s
3850K .......... .......... .......... .......... .......... 27% 3.04M 36s
3900K .......... .......... .......... .......... .......... 27% 14.9M 35s
3950K .......... .......... .......... .......... .......... 28% 3.53M 35s
4000K .......... .......... .......... .......... .......... 28% 4.80M 34s
4050K .......... .......... .......... .......... .......... 28% 6.99M 34s
4100K .......... .......... .......... .......... .......... 29% 32.0K 37s
4150K .......... .......... .......... .......... .......... 29% 5.66M 36s
4200K .......... .......... .......... .......... .......... 29% 4.14M 36s
4250K .......... .......... .......... .......... .......... 30% 32.0K 39s
4300K .......... .......... .......... .......... .......... 30% 8.57M 38s
4350K .......... .......... .......... .......... .......... 30% 4.59M 37s
4400K .......... .......... .......... .......... .......... 31% 32.1K 40s
4450K .......... .......... .......... .......... .......... 31% 13.1M 40s
4500K .......... .......... .......... .......... .......... 31% 4.78M 39s
4550K .......... .......... .......... .......... .......... 32% 32.0K 42s
4600K .......... .......... .......... .......... .......... 32% 5.30M 41s
4650K .......... .......... .......... .......... .......... 32% 32.1K 44s
4700K .......... .......... .......... .......... .......... 33% 3.89M 43s
4750K .......... .......... .......... .......... .......... 33% 3.29M 42s
4800K .......... .......... .......... .......... .......... 33% 22.4M 42s
4850K .......... .......... .......... .......... .......... 34% 13.6M 41s
4900K .......... .......... .......... .......... .......... 34% 4.71M 40s
4950K .......... .......... .......... .......... .......... 35% 21.2M 40s
5000K .......... .......... .......... .......... .......... 35% 6.09M 39s
5050K .......... .......... .......... .......... .......... 35% 5.20M 39s
5100K .......... .......... .......... .......... .......... 36% 6.11M 38s
5150K .......... .......... .......... .......... .......... 36% 32.9K 40s
5200K .......... .......... .......... .......... .......... 36% 8.65M 40s
5250K .......... .......... .......... .......... .......... 37% 5.39M 39s
5300K .......... .......... .......... .......... .......... 37% 31.9K 41s
5350K .......... .......... .......... .......... .......... 37% 2.98M 40s
5400K .......... .......... .......... .......... .......... 38% 9.04M 40s
5450K .......... .......... .......... .......... .......... 38% 6.10M 39s
5500K .......... .......... .......... .......... .......... 38% 25.3M 39s
5550K .......... .......... .......... .......... .......... 39% 3.11M 38s
5600K .......... .......... .......... .......... .......... 39% 4.18M 38s
5650K .......... .......... .......... .......... .......... 39% 45.9M 37s
5700K .......... .......... .......... .......... .......... 40% 32.2K 39s
5750K .......... .......... .......... .......... .......... 40% 7.93M 38s
5800K .......... .......... .......... .......... .......... 40% 6.19M 38s
5850K .......... .......... .......... .......... .......... 41% 31.9K 39s
5900K .......... .......... .......... .......... .......... 41% 3.21M 39s
5950K .......... .......... .......... .......... .......... 42% 32.1K 40s
6000K .......... .......... .......... .......... .......... 42% 3.18M 40s
6050K .......... .......... .......... .......... .......... 42% 5.22M 39s
6100K .......... .......... .......... .......... .......... 43% 4.40M 39s
6150K .......... .......... .......... .......... .......... 43% 10.5M 38s
6200K .......... .......... .......... .......... .......... 43% 5.31M 38s
6250K .......... .......... .......... .......... .......... 44% 18.2M 37s
6300K .......... .......... .......... .......... .......... 44% 3.87M 37s
6350K .......... .......... .......... .......... .......... 44% 7.31M 36s
6400K .......... .......... .......... .......... .......... 45% 3.65M 36s
6450K .......... .......... .......... .......... .......... 45% 4.51M 35s
6500K .......... .......... .......... .......... .......... 45% 13.0M 35s
6550K .......... .......... .......... .......... .......... 46% 4.14M 34s
6600K .......... .......... .......... .......... .......... 46% 25.7M 34s
6650K .......... .......... .......... .......... .......... 46% 16.7M 33s
6700K .......... .......... .......... .......... .......... 47% 4.76M 33s
6750K .......... .......... .......... .......... .......... 47% 32.3K 34s
6800K .......... .......... .......... .......... .......... 47% 4.72M 34s
6850K .......... .......... .......... .......... .......... 48% 3.56M 33s
6900K .......... .......... .......... .......... .......... 48% 12.0M 33s
6950K .......... .......... .......... .......... .......... 49% 3.93M 32s
7000K .......... .......... .......... .......... .......... 49% 4.07M 32s
7050K .......... .......... .......... .......... .......... 49% 31.2M 31s
7100K .......... .......... .......... .......... .......... 50% 2.64M 31s
7150K .......... .......... .......... .......... .......... 50% 14.2M 31s
7200K .......... .......... .......... .......... .......... 50% 226M 30s
7250K .......... .......... .......... .......... .......... 51% 220M 30s
7300K .......... .......... .......... .......... .......... 51% 2.77M 29s
7350K .......... .......... .......... .......... .......... 51% 11.1M 29s
7400K .......... .......... .......... .......... .......... 52% 4.42M 29s
7450K .......... .......... .......... .......... .......... 52% 32.1K 30s
7500K .......... .......... .......... .......... .......... 52% 3.49M 29s
7550K .......... .......... .......... .......... .......... 53% 4.84M 29s
7600K .......... .......... .......... .......... .......... 53% 28.2M 28s
7650K .......... .......... .......... .......... .......... 53% 3.66M 28s
7700K .......... .......... .......... .......... .......... 54% 18.8M 28s
7750K .......... .......... .......... .......... .......... 54% 4.75M 27s
7800K .......... .......... .......... .......... .......... 54% 3.96M 27s
7850K .......... .......... .......... .......... .......... 55% 28.4M 26s
7900K .......... .......... .......... .......... .......... 55% 13.5M 26s
7950K .......... .......... .......... .......... .......... 56% 33.0K 27s
8000K .......... .......... .......... .......... .......... 56% 5.04M 27s
8050K .......... .......... .......... .......... .......... 56% 4.01M 26s
8100K .......... .......... .......... .......... .......... 57% 19.8M 26s
8150K .......... .......... .......... .......... .......... 57% 3.05M 25s
8200K .......... .......... .......... .......... .......... 57% 13.7M 25s
8250K .......... .......... .......... .......... .......... 58% 2.51M 25s
8300K .......... .......... .......... .......... .......... 58% 3.67M 24s
8350K .......... .......... .......... .......... .......... 58% 32.3K 25s
8400K .......... .......... .......... .......... .......... 59% 8.07M 25s
8450K .......... .......... .......... .......... .......... 59% 3.67M 24s
8500K .......... .......... .......... .......... .......... 59% 3.73M 24s
8550K .......... .......... .......... .......... .......... 60% 14.1M 24s
8600K .......... .......... .......... .......... .......... 60% 3.56M 23s
8650K .......... .......... .......... .......... .......... 60% 37.1M 23s
8700K .......... .......... .......... .......... .......... 61% 116M 23s
8750K .......... .......... .......... .......... .......... 61% 32.0K 23s
8800K .......... .......... .......... .......... .......... 61% 12.8M 23s
8850K .......... .......... .......... .......... .......... 62% 24.8K 24s
8900K .......... .......... .......... .......... .......... 62% 5.72M 24s
8950K .......... .......... .......... .......... .......... 63% 4.84M 23s
9000K .......... .......... .......... .......... .......... 63% 32.0K 24s
9050K .......... .......... .......... .......... .......... 63% 11.0M 23s
9100K .......... .......... .......... .......... .......... 64% 3.44M 23s
9150K .......... .......... .......... .......... .......... 64% 4.37M 23s
9200K .......... .......... .......... .......... .......... 64% 5.94M 22s
9250K .......... .......... .......... .......... .......... 65% 4.41M 22s
9300K .......... .......... .......... .......... .......... 65% 23.2M 22s
9350K .......... .......... .......... .......... .......... 65% 20.9M 21s
9400K .......... .......... .......... .......... .......... 66% 2.83M 21s
9450K .......... .......... .......... .......... .......... 66% 25.0M 21s
9500K .......... .......... .......... .......... .......... 66% 56.2M 20s
9550K .......... .......... .......... .......... .......... 67% 6.23M 20s
9600K .......... .......... .......... .......... .......... 67% 6.20M 20s
9650K .......... .......... .......... .......... .......... 67% 27.1K 20s
9700K .......... .......... .......... .......... .......... 68% 4.64M 20s
9750K .......... .......... .......... .......... .......... 68% 5.55M 20s
9800K .......... .......... .......... .......... .......... 69% 25.2K 20s
9850K .......... .......... .......... .......... .......... 69% 4.51M 20s
9900K .......... .......... .......... .......... .......... 69% 17.2M 20s
9950K .......... .......... .......... .......... .......... 70% 3.21M 19s
10000K .......... .......... .......... .......... .......... 70% 4.55M 19s
10050K .......... .......... .......... .......... .......... 70% 24.9M 19s
10100K .......... .......... .......... .......... .......... 71% 12.1M 18s
10150K .......... .......... .......... .......... .......... 71% 4.10M 18s
10200K .......... .......... .......... .......... .......... 71% 25.6K 18s
10250K .......... .......... .......... .......... .......... 72% 12.5M 18s
10300K .......... .......... .......... .......... .......... 72% 5.54M 18s
10350K .......... .......... .......... .......... .......... 72% 32.0K 18s
10400K .......... .......... .......... .......... .......... 73% 5.52M 18s
10450K .......... .......... .......... .......... .......... 73% 32.1K 18s
10500K .......... .......... .......... .......... .......... 73% 4.01M 18s
10550K .......... .......... .......... .......... .......... 74% 3.45M 17s
10600K .......... .......... .......... .......... .......... 74% 4.07M 17s
10650K .......... .......... .......... .......... .......... 74% 30.1M 17s
10700K .......... .......... .......... .......... .......... 75% 22.6M 16s
10750K .......... .......... .......... .......... .......... 75% 2.92M 16s
10800K .......... .......... .......... .......... .......... 76% 61.6M 16s
10850K .......... .......... .......... .......... .......... 76% 32.3K 16s
10900K .......... .......... .......... .......... .......... 76% 3.85M 16s
10950K .......... .......... .......... .......... .......... 77% 12.3M 15s
11000K .......... .......... .......... .......... .......... 77% 31.9K 16s
11050K .......... .......... .......... .......... .......... 77% 3.99M 15s
11100K .......... .......... .......... .......... .......... 78% 19.2M 15s
11150K .......... .......... .......... .......... .......... 78% 32.0K 15s
11200K .......... .......... .......... .......... .......... 78% 6.39M 15s
11250K .......... .......... .......... .......... .......... 79% 3.85M 14s
11300K .......... .......... .......... .......... .......... 79% 23.0M 14s
11350K .......... .......... .......... .......... .......... 79% 20.8M 14s
11400K .......... .......... .......... .......... .......... 80% 3.25M 14s
11450K .......... .......... .......... .......... .......... 80% 11.3M 13s
11500K .......... .......... .......... .......... .......... 80% 4.35M 13s
11550K .......... .......... .......... .......... .......... 81% 6.43M 13s
11600K .......... .......... .......... .......... .......... 81% 6.27M 12s
11650K .......... .......... .......... .......... .......... 81% 13.0M 12s
11700K .......... .......... .......... .......... .......... 82% 31.7K 12s
11750K .......... .......... .......... .......... .......... 82% 5.14M 12s
11800K .......... .......... .......... .......... .......... 83% 31.4M 12s
11850K .......... .......... .......... .......... .......... 83% 32.7K 12s
11900K .......... .......... .......... .......... .......... 83% 5.31M 11s
11950K .......... .......... .......... .......... .......... 84% 32.0K 11s
12000K .......... .......... .......... .......... .......... 84% 3.90M 11s
12050K .......... .......... .......... .......... .......... 84% 7.41M 11s
12100K .......... .......... .......... .......... .......... 85% 3.53M 10s
12150K .......... .......... .......... .......... .......... 85% 7.37M 10s
12200K .......... .......... .......... .......... .......... 85% 7.54M 10s
12250K .......... .......... .......... .......... .......... 86% 30.8M 10s
12300K .......... .......... .......... .......... .......... 86% 10.8M 9s
12350K .......... .......... .......... .......... .......... 86% 31.9K 9s
12400K .......... .......... .......... .......... .......... 87% 10.3M 9s
12450K .......... .......... .......... .......... .......... 87% 6.84M 9s
12500K .......... .......... .......... .......... .......... 87% 32.8K 9s
12550K .......... .......... .......... .......... .......... 88% 8.83M 8s
12600K .......... .......... .......... .......... .......... 88% 7.62M 8s
12650K .......... .......... .......... .......... .......... 88% 32.0K 8s
12700K .......... .......... .......... .......... .......... 89% 4.88M 8s
12750K .......... .......... .......... .......... .......... 89% 3.36M 7s
12800K .......... .......... .......... .......... .......... 90% 12.2M 7s
12850K .......... .......... .......... .......... .......... 90% 10.0M 7s
12900K .......... .......... .......... .......... .......... 90% 5.95M 7s
12950K .......... .......... .......... .......... .......... 91% 27.2M 6s
13000K .......... .......... .......... .......... .......... 91% 32.1K 6s
13050K .......... .......... .......... .......... .......... 91% 4.66M 6s
13100K .......... .......... .......... .......... .......... 92% 5.74M 6s
13150K .......... .......... .......... .......... .......... 92% 15.1M 5s
13200K .......... .......... .......... .......... .......... 92% 4.82M 5s
13250K .......... .......... .......... .......... .......... 93% 26.5M 5s
13300K .......... .......... .......... .......... .......... 93% 25.9M 5s
13350K .......... .......... .......... .......... .......... 93% 3.12M 4s
13400K .......... .......... .......... .......... .......... 94% 32.4K 4s
13450K .......... .......... .......... .......... .......... 94% 5.20M 4s
13500K .......... .......... .......... .......... .......... 94% 4.28M 4s
13550K .......... .......... .......... .......... .......... 95% 4.54M 3s
13600K .......... .......... .......... .......... .......... 95% 26.7M 3s
13650K .......... .......... .......... .......... .......... 95% 14.3M 3s
13700K .......... .......... .......... .......... .......... 96% 8.37M 3s
13750K .......... .......... .......... .......... .......... 96% 6.27M 2s
13800K .......... .......... .......... .......... .......... 97% 32.2K 2s
13850K .......... .......... .......... .......... .......... 97% 4.78M 2s
13900K .......... .......... .......... .......... .......... 97% 22.4M 2s
13950K .......... .......... .......... .......... .......... 98% 4.24M 1s
14000K .......... .......... .......... .......... .......... 98% 25.9M 1s
14050K .......... .......... .......... .......... .......... 98% 14.1M 1s
14100K .......... .......... .......... .......... .......... 99% 3.52M 1s
14150K .......... .......... .......... .......... .......... 99% 4.61M 0s
14200K .......... .......... .......... .......... .......... 99% 25.4M 0s
14250K .......... .......... .... 100% 16.2K=71s
2013-04-28 22:57:44 (202 KB/s) - `/home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/Precise32/../pypy.tar.bz2' saved [14617044/14617044]
Requirement already satisfied (use --upgrade to upgrade): rply in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): pytest in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): invoke in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.12 in /usr/local/lib/python2.7/dist-packages (from pytest->-r requirements.txt (line 3))
Cleaning up...
+ invoke travis.run_tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-2.2.4.dev2
collecting ... collected 1059 items
spec/tags/core/kernel/test_tags.txt .
tests/test_celldict.py ...
tests/test_compiler.py ................................................................................
tests/test_executioncontext.py .
tests/test_interpreter.py .........................................................................................................................
tests/test_main.py ..........................x......
tests/test_mapdict.py ...................
tests/test_parser.py .............................................................................................................
tests/jit/test_array.py s
tests/jit/test_basic.py ss
tests/jit/test_closure.py s
tests/jit/test_instance_vars.py s
tests/modules/test_comparable.py ...........
tests/modules/test_enumerable.py ...................
tests/modules/test_kernel.py .......................................x..
tests/modules/test_math.py ............................F
tests/modules/test_objectspace.py ..
tests/modules/test_process.py ..........
tests/modules/test_signal.py .
tests/objects/test_arrayobject.py ......................................................
tests/objects/test_bignumobject.py ............
tests/objects/test_bindingobject.py .....
tests/objects/test_boolobject.py ................
tests/objects/test_classobject.py ....x........
tests/objects/test_dirobject.py .........
tests/objects/test_encodingobject.py .
tests/objects/test_envobject.py .....
tests/objects/test_exceptionobject.py .........
tests/objects/test_fiberobject.py .FFFFFFFFFFFFFFF
tests/objects/test_fileobject.py ................................
tests/objects/test_floatobject.py ...........................
tests/objects/test_hashobject.py .............................
tests/objects/test_integerobject.py .
tests/objects/test_intobject.py ............................................
tests/objects/test_ioobject.py .........................Fx
tests/objects/test_methodobject.py ..............
tests/objects/test_moduleobject.py ...........................x......
tests/objects/test_nilobject.py ...........
tests/objects/test_numericobject.py ......
tests/objects/test_objectobject.py ............................
tests/objects/test_procobject.py .....
tests/objects/test_randomobject.py FFF
tests/objects/test_rangeobject.py ...........
tests/objects/test_regexpobject.py ............................
tests/objects/test_stringobject.py ....................................................
tests/objects/test_symbolobject.py ............
tests/objects/test_threadobject.py .....
tests/objects/test_timeobject.py xx
tests/utils/test_glob.py ..................
tests/utils/test_ordereddict.py ............................................
=================================== FAILURES ===================================
______________________________ TestMath.test_erfc ______________________________
self = <tests.modules.test_math.TestMath object at 0x2348060c>
space = <topaz.objspace.ObjectSpace object at 0x234806ac>
def test_erfc(self, space):
w_res = space.execute("return [Math.erfc(-1), Math.erfc(0), Math.erfc(1.5)]")
> assert self.unwrap(space, w_res) == [math.erfc(-1), 1.0, math.erfc(1.5)]
E assert [1.8427007929...9485352468928] == [1.84270079294...4853524689274]
E At index 0 diff: 1.842700792949715 != 1.8427007929497148
tests/modules/test_math.py:213: AssertionError
_________________________ TestFiberObject.test_resume __________________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2a8598ac>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
def test_resume(self, space):
w_res = space.execute("""
f = Fiber.new { 2 }
return f.resume
> """)
tests/objects/test_fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a85994c>
source = '\n f = Fiber.new { 2 }\n return f.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a85994c>
frame = <topaz.frame.Frame object at 0x2a9a07cc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2a9a0c6c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
frame = <topaz.frame.Frame object at 0x2a9a07cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2a9a0c6c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>, pc = 25
frame = <topaz.frame.Frame object at 0x2a9a07cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2a9a0c6c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>, pc = 26
frame = <topaz.frame.Frame object at 0x2a9a07cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2a9a0c6c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
frame = <topaz.frame.Frame object at 0x2a9a07cc>, pc = 30
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2a9a0c6c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2a9a0cec>
frame = <topaz.frame.Frame object at 0x2a9a07cc>, pc = 30, meth_idx = 3
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a85994c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2a9a07ec>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2a8f466c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a85994c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2a8f466c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2a8a8c0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2a9a07ec>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2a8a8a6c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2a8a8c0c>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2a9a07ec>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2a9a07ec>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2a9a07ec>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2a9a0cac>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2a9a05ac>
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a05ac>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2a85994c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a05ac>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2a9a0b8c>
config = <rpython.config.config.Config object at 0x2a91574c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a05ac>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2a9a0b8c>
config = <rpython.config.config.Config object at 0x2a91574c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
------------------------------- Captured stderr --------------------------------
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused -I/home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/pypy-pypy-d84133e3e346/rpython/translator/c /home/vagrant/workspace/Topaz32/TEST_TYPE/own/label/pypy-pypy-d84133e3e346/rpython/translator/c/src/stacklet/stacklet.c -o /tmp/usession-default-1/rpython/translator/c/src/stacklet/stacklet.o
[platform:execute] gcc -shared /tmp/usession-default-1/rpython/translator/c/src/stacklet/stacklet.o -pthread -lrt -o /tmp/usession-default-1/shared_cache/externmod_2.so
______________________ TestFiberObject.test_nested_resume ______________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2a95b68c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
def test_nested_resume(self, space):
space.execute("""
$f = Fiber.new {
$f.resume
}
""")
with self.raises(space, "FiberError", "double resume"):
> space.execute("$f.resume")
tests/objects/test_fiberobject.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, source = '$f.resume'
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
frame = <topaz.frame.Frame object at 0x2aa5decc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aa6436c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
frame = <topaz.frame.Frame object at 0x2aa5decc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aa6436c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, pc = 3
frame = <topaz.frame.Frame object at 0x2aa5decc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aa6436c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, pc = 4
frame = <topaz.frame.Frame object at 0x2aa5decc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aa6436c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
frame = <topaz.frame.Frame object at 0x2aa5decc>, pc = 8
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aa6436c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aa6440c>
frame = <topaz.frame.Frame object at 0x2aa5decc>, pc = 8, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aa640ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2aa15ccc>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2aa15ccc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2a9f328c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aa640ac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2a9f30ec>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2a9f328c>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aa640ac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2aa640ac>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2aa640ac>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2aa643ac>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2a9a40cc>
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a40cc>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2a95b72c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a40cc>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2aa6438c>
config = <rpython.config.config.Config object at 0x2aa58dac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2a9a40cc>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2aa6438c>
config = <rpython.config.config.Config object at 0x2aa58dac>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
_________________________ TestFiberObject.test_closure _________________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2aa9808c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
def test_closure(self, space):
w_res = space.execute("""
a = 2
f = Fiber.new { a = 5 }
f.resume
return a
> """)
tests/objects/test_fiberobject.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
source = '\n a = 2\n f = Fiber.new { a = 5 }\n f.resume\n return a\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
frame = <topaz.frame.Frame object at 0x2ab2eb2c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ab2ecec>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
frame = <topaz.frame.Frame object at 0x2ab2eb2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ab2ecec>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>, pc = 35
frame = <topaz.frame.Frame object at 0x2ab2eb2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ab2ecec>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>, pc = 36
frame = <topaz.frame.Frame object at 0x2ab2eb2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ab2ecec>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
frame = <topaz.frame.Frame object at 0x2ab2eb2c>, pc = 40
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ab2ecec>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ab3424c>
frame = <topaz.frame.Frame object at 0x2ab2eb2c>, pc = 40, meth_idx = 4
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ab2ec8c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ab089cc>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ab089cc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2aabad6c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ab2ec8c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2aababcc>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2aabad6c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ab2ec8c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ab2ec8c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ab2ec8c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2ab2ef2c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2ab2e90c>
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ab2e90c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2aa9812c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ab2e90c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ab2eb4c>
config = <rpython.config.config.Config object at 0x2ab29aac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ab2e90c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ab2eb4c>
config = <rpython.config.config.Config object at 0x2ab29aac>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
________________________ TestFiberObject.test_exception ________________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2ab52c6c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
def test_exception(self, space):
space.execute("""
$f = Fiber.new { 1 / 0 }
""")
with self.raises(space, "ZeroDivisionError"):
> space.execute("$f.resume")
tests/objects/test_fiberobject.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, source = '$f.resume'
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
frame = <topaz.frame.Frame object at 0x2ac246cc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ac2472c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
frame = <topaz.frame.Frame object at 0x2ac246cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ac2472c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, pc = 3
frame = <topaz.frame.Frame object at 0x2ac246cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ac2472c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, pc = 4
frame = <topaz.frame.Frame object at 0x2ac246cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ac2472c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
frame = <topaz.frame.Frame object at 0x2ac246cc>, pc = 8
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ac2472c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ac24b6c>
frame = <topaz.frame.Frame object at 0x2ac246cc>, pc = 8, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ac248ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2abd64cc>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2abd64cc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2abb4a8c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ac248ac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2abb48ec>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2abb4a8c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ac248ac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ac248ac>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ac248ac>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2ac24b0c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2ac2440c>
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ac2440c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ab52d0c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ac2440c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ac24aec>
config = <rpython.config.config.Config object at 0x2ac1e5ac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2ac2440c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ac24aec>
config = <rpython.config.config.Config object at 0x2ac1e5ac>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
__________________________ TestFiberObject.test_yield __________________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2ac4f14c>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
def test_yield(self, space):
w_res = space.execute("""
r = []
f = Fiber.new {
r << 1
Fiber.yield 3
r << 2
}
r << "a"
res = f.resume
r << res
r << "b"
f.resume
r << "c"
return r
> """)
tests/objects/test_fiberobject.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
source = '\n r = []\n f = Fiber.new {\n r << 1\n Fiber.yield 3\n r << 2\n }\n ... res = f.resume\n r << res\n r << "b"\n f.resume\n r << "c"\n return r\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
frame = <topaz.frame.Frame object at 0x2acf7ccc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2acf7dcc>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
frame = <topaz.frame.Frame object at 0x2acf7ccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2acf7dcc>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>, pc = 51
frame = <topaz.frame.Frame object at 0x2acf7ccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2acf7dcc>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>, pc = 52
frame = <topaz.frame.Frame object at 0x2acf7ccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2acf7dcc>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
frame = <topaz.frame.Frame object at 0x2acf7ccc>, pc = 56
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2acf7dcc>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2acfdccc>
frame = <topaz.frame.Frame object at 0x2acf7ccc>, pc = 56, meth_idx = 5
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2acf7dac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ac97b6c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ac97b6c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ac75f0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2acf7dac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2ac75d6c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ac75f0c>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2acf7dac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2acf7dac>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2acf7dac>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2acf7f8c>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2acf7aac>
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2acf7aac>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ac4f04c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2acf7aac>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2acf7e0c>
config = <rpython.config.config.Config object at 0x2acf1c4c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2acf7aac>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2acf7e0c>
config = <rpython.config.config.Config object at 0x2acf1c4c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
_____________________ TestFiberObject.test_yield_multiarg ______________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2ad0c6ac>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
def test_yield_multiarg(self, space):
w_res = space.execute("""
f = Fiber.new {
Fiber.yield 1, 2, 3
}
return f.resume
> """)
tests/objects/test_fiberobject.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
source = '\n f = Fiber.new {\n Fiber.yield 1, 2, 3\n }\n return f.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
frame = <topaz.frame.Frame object at 0x2ae4914c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ae4978c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
frame = <topaz.frame.Frame object at 0x2ae4914c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ae4978c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>, pc = 25
frame = <topaz.frame.Frame object at 0x2ae4914c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ae4978c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>, pc = 26
frame = <topaz.frame.Frame object at 0x2ae4914c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ae4978c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
frame = <topaz.frame.Frame object at 0x2ae4914c>, pc = 30
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2ae4978c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2ae4968c>
frame = <topaz.frame.Frame object at 0x2ae4914c>, pc = 30, meth_idx = 3
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ae4916c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ada314c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ada314c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ad576ec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ae4916c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2ad5754c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ad576ec>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2ae4916c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ae4916c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2ae4916c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2ae4948c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2adbef0c>
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2adbef0c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ad0c80c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2adbef0c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ae4954c>
config = <rpython.config.config.Config object at 0x2adbe0cc>
ec = <topaz.executioncontext.ExecutionContext object at 0x2adbef0c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2ae4954c>
config = <rpython.config.config.Config object at 0x2adbe0cc>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
___________________ TestFiberObject.test_yield_with_no_value ___________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2ae549ac>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
def test_yield_with_no_value(self, space):
w_res = space.execute("""
f = Fiber.new {
Fiber.yield
}
return f.resume
> """)
tests/objects/test_fiberobject.py:77:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
source = '\n f = Fiber.new {\n Fiber.yield\n }\n return f.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
frame = <topaz.frame.Frame object at 0x2aebd5ac>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aebdaec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
frame = <topaz.frame.Frame object at 0x2aebd5ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aebdaec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>, pc = 25
frame = <topaz.frame.Frame object at 0x2aebd5ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aebdaec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>, pc = 26
frame = <topaz.frame.Frame object at 0x2aebd5ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aebdaec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
frame = <topaz.frame.Frame object at 0x2aebd5ac>, pc = 30
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2aebdaec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2aebdb2c>
frame = <topaz.frame.Frame object at 0x2aebd5ac>, pc = 30, meth_idx = 3
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aebd5cc>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ae3644c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2ae3644c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ae0e9ec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aebd5cc>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2ae0e84c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2ae0e9ec>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2aebd5cc>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2aebd5cc>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2aebd5cc>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2aebd88c>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2aebd38c>
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2aebd38c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2ae54b0c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2aebd38c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2aebd90c>
config = <rpython.config.config.Config object at 0x2aeb652c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2aebd38c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2aebd90c>
config = <rpython.config.config.Config object at 0x2aeb652c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
_____________________ TestFiberObject.test_yield_from_main _____________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2aec5fec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
def test_yield_from_main(self, space):
with self.raises(space, "FiberError", "can't yield from root fiber"):
> space.execute("Fiber.yield")
tests/objects/test_fiberobject.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aef522c>, source = 'Fiber.yield'
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aef522c>
frame = <topaz.frame.Frame object at 0x2af8ba6c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2af8baec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
frame = <topaz.frame.Frame object at 0x2af8ba6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2af8baec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>, pc = 4
frame = <topaz.frame.Frame object at 0x2af8ba6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2af8baec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>, pc = 5
frame = <topaz.frame.Frame object at 0x2af8ba6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2af8baec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
frame = <topaz.frame.Frame object at 0x2af8ba6c>, pc = 9
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2af8baec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2af8bc4c>
frame = <topaz.frame.Frame object at 0x2af8ba6c>, pc = 9, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aef522c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x2af12c6c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2af6a84c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2aef522c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2af6a84c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2af12cec>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x2af12c6c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2af12c8c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2af12cec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x2af12c6c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x2af12c6c>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x2af12c6c>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>, args_w = []
@classdef.singleton_method("yield")
def singleton_method_yield(self, space, args_w):
> current = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2af8bbec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2af8b7ec>
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2af8b7ec>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2aef522c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2af8b7ec>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2af8bb2c>
config = <rpython.config.config.Config object at 0x2af86d4c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2af8b7ec>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2af8bb2c>
config = <rpython.config.config.Config object at 0x2af86d4c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
____________________ TestFiberObject.test_resume_dead_fiber ____________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2afd106c>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
def test_resume_dead_fiber(self, space):
space.execute("""
$f = Fiber.new {}
$f.resume
> """)
tests/objects/test_fiberobject.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
source = '\n $f = Fiber.new {}\n $f.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
frame = <topaz.frame.Frame object at 0x2b083c6c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b083cec>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
frame = <topaz.frame.Frame object at 0x2b083c6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b083cec>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>, pc = 22
frame = <topaz.frame.Frame object at 0x2b083c6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b083cec>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>, pc = 23
frame = <topaz.frame.Frame object at 0x2b083c6c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b083cec>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
frame = <topaz.frame.Frame object at 0x2b083c6c>, pc = 27
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b083cec>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b08910c>
frame = <topaz.frame.Frame object at 0x2b083c6c>, pc = 27, meth_idx = 4
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b083ecc>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b035aec>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b035aec>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b0130ac>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b083ecc>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2afefeec>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b0130ac>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b083ecc>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b083ecc>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b083ecc>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b083d8c>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b083a2c>
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b083a2c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2afd11cc>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b083a2c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b083fcc>
config = <rpython.config.config.Config object at 0x2b07ebcc>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b083a2c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b083fcc>
config = <rpython.config.config.Config object at 0x2b07ebcc>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
______________ TestFiberObject.test_first_resume_block_arguments _______________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b09468c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
def test_first_resume_block_arguments(self, space):
w_res = space.execute("""
f = Fiber.new { |x, y| Fiber.yield(x + y) }
return f.resume(2, 5)
> """)
tests/objects/test_fiberobject.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
source = '\n f = Fiber.new { |x, y| Fiber.yield(x + y) }\n return f.resume(2, 5)\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
frame = <topaz.frame.Frame object at 0x2b15f28c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b15f90c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
frame = <topaz.frame.Frame object at 0x2b15f28c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b15f90c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>, pc = 31
frame = <topaz.frame.Frame object at 0x2b15f28c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b15f90c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>, pc = 32
frame = <topaz.frame.Frame object at 0x2b15f28c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b15f90c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
frame = <topaz.frame.Frame object at 0x2b15f28c>, pc = 36
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b15f90c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b15f96c>
frame = <topaz.frame.Frame object at 0x2b15f28c>, pc = 36, meth_idx = 5
num_args = 2
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b15f66c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b13712c>
args_w = [<topaz.objects.intobject.W_FixnumObject object at 0x2b15f7ec>, <topaz.objects.intobject.W_FixnumObject object at 0x2b15f62c>]
block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b13712c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b0eb6cc>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b15f66c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b0eb52c>
args_w = [<topaz.objects.intobject.W_FixnumObject object at 0x2b15f7ec>, <topaz.objects.intobject.W_FixnumObject object at 0x2b15f62c>]
block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b0eb6cc>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b15f66c>
args_w = [<topaz.objects.intobject.W_FixnumObject object at 0x2b15f7ec>, <topaz.objects.intobject.W_FixnumObject object at 0x2b15f62c>]
block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b15f66c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
args_w = [<topaz.objects.intobject.W_FixnumObject object at 0x2b15f7ec>, <topaz.objects.intobject.W_FixnumObject object at 0x2b15f62c>]
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b15f66c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
args_w = [<topaz.objects.intobject.W_FixnumObject object at 0x2b15f7ec>, <topaz.objects.intobject.W_FixnumObject object at 0x2b15f62c>]
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b15f6ac>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b15f06c>
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b15f06c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b0947ec>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b15f06c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b15f5cc>
config = <rpython.config.config.Config object at 0x2b15720c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b15f06c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b15f5cc>
config = <rpython.config.config.Config object at 0x2b15720c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
_____________________ TestFiberObject.test_return_in_block _____________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b166bec>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
def test_return_in_block(self, space):
space.execute("""
$f = Fiber.new { return }
""")
with self.raises(space, "LocalJumpError", "unexpected return"):
> space.execute("$f.resume")
tests/objects/test_fiberobject.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b166cec>, source = '$f.resume'
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b166cec>
frame = <topaz.frame.Frame object at 0x2b22c7cc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b22c96c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
frame = <topaz.frame.Frame object at 0x2b22c7cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b22c96c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>, pc = 3
frame = <topaz.frame.Frame object at 0x2b22c7cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b22c96c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>, pc = 4
frame = <topaz.frame.Frame object at 0x2b22c7cc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b22c96c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
frame = <topaz.frame.Frame object at 0x2b22c7cc>, pc = 8
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b22c96c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b22cbec>
frame = <topaz.frame.Frame object at 0x2b22c7cc>, pc = 8, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b166cec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b22c9ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b2055cc>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b166cec>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b2055cc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b1b2b6c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b22c9ac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b1b29cc>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b1b2b6c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b22c9ac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b22c9ac>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b22c9ac>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b22cb8c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b22c50c>
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b22c50c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b166cec>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b22c50c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b22cb6c>
config = <rpython.config.config.Config object at 0x2b2266ac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b22c50c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b22cb6c>
config = <rpython.config.config.Config object at 0x2b2266ac>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
_____________________ TestFiberObject.test_break_in_block ______________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b2d938c>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
def test_break_in_block(self, space):
space.execute("""
$f = Fiber.new { break }
""")
with self.raises(space, "LocalJumpError", "break from proc-closure"):
> space.execute("$f.resume")
tests/objects/test_fiberobject.py:111:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, source = '$f.resume'
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
frame = <topaz.frame.Frame object at 0x2b320f2c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3262ac>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
frame = <topaz.frame.Frame object at 0x2b320f2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3262ac>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, pc = 3
frame = <topaz.frame.Frame object at 0x2b320f2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3262ac>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, pc = 4
frame = <topaz.frame.Frame object at 0x2b320f2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3262ac>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
frame = <topaz.frame.Frame object at 0x2b320f2c>, pc = 8
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3262ac>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b32628c>
frame = <topaz.frame.Frame object at 0x2b320f2c>, pc = 8, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b320eec>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b294c4c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b294c4c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b27120c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b320eec>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b27106c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b27120c>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b320eec>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b320eec>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b320eec>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b32622c>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b320b8c>
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b320b8c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b2d912c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b320b8c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b32620c>
config = <rpython.config.config.Config object at 0x2b31ad2c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b320b8c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b32620c>
config = <rpython.config.config.Config object at 0x2b31ad2c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
____________________ TestFiberObject.test_resume_with_value ____________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b32d64c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
def test_resume_with_value(self, space):
w_res = space.execute("""
r = []
f = Fiber.new {
r << (Fiber.yield)
}
f.resume
f.resume(10)
return r
> """)
tests/objects/test_fiberobject.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
source = '\n r = []\n f = Fiber.new {\n r << (Fiber.yield)\n }\n f.resume\n f.resume(10)\n return r\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
frame = <topaz.frame.Frame object at 0x2b3f644c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3f6a8c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
frame = <topaz.frame.Frame object at 0x2b3f644c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3f6a8c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>, pc = 35
frame = <topaz.frame.Frame object at 0x2b3f644c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3f6a8c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>, pc = 36
frame = <topaz.frame.Frame object at 0x2b3f644c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3f6a8c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
frame = <topaz.frame.Frame object at 0x2b3f644c>, pc = 40
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b3f6a8c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b3f6d6c>
frame = <topaz.frame.Frame object at 0x2b3f644c>, pc = 40, meth_idx = 3
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b3f6b4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b3cf2ec>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b3cf2ec>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b37288c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b3f6b4c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b3726ec>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b37288c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b3f6b4c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b3f6b4c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b3f6b4c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b3f6a0c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b3f622c>
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b3f622c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b32d7ac>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b3f622c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b3f64ec>
config = <rpython.config.config.Config object at 0x2b3f03cc>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b3f622c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b3f64ec>
config = <rpython.config.config.Config object at 0x2b3f03cc>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
___________________ TestFiberObject.test_nested_resume_yield ___________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b3fdeec>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
def test_nested_resume_yield(self, space):
space.execute("""
f2 = Fiber.new { Fiber.yield }
f1 = Fiber.new { f2.resume }
f1.resume
f2.resume
> """)
tests/objects/test_fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b43706c>
source = '\n f2 = Fiber.new { Fiber.yield }\n f1 = Fiber.new { f2.resume }\n f1.resume\n f2.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b43706c>
frame = <topaz.frame.Frame object at 0x2b4e88ac>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b4e8f6c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
frame = <topaz.frame.Frame object at 0x2b4e88ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b4e8f6c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>, pc = 53
frame = <topaz.frame.Frame object at 0x2b4e88ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b4e8f6c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>, pc = 54
frame = <topaz.frame.Frame object at 0x2b4e88ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b4e8f6c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
frame = <topaz.frame.Frame object at 0x2b4e88ac>, pc = 58
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b4e8f6c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b4ed3ac>
frame = <topaz.frame.Frame object at 0x2b4e88ac>, pc = 58, meth_idx = 4
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b43706c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b4e8a2c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b49c74c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b43706c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b49c74c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b451cec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b4e8a2c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b451b4c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b451cec>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b4e8a2c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b4e8a2c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b4e8a2c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b4e8f0c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b4e868c>
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b4e868c>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b43706c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b4e868c>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b4e8dec>
config = <rpython.config.config.Config object at 0x2b4e282c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b4e868c>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b4e8dec>
config = <rpython.config.config.Config object at 0x2b4e282c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
________________ TestFiberObject.test_multiple_resume_exception ________________
self = <tests.objects.test_fiberobject.TestFiberObject object at 0x2b5122ac>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
def test_multiple_resume_exception(self, space):
space.execute("""
$f = Fiber.new { Fiber.yield; raise "error" }
$f.resume
> """)
tests/objects/test_fiberobject.py:137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b51238c>
source = '\n $f = Fiber.new { Fiber.yield; raise "error" }\n $f.resume\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b51238c>
frame = <topaz.frame.Frame object at 0x2b5bbccc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b5bbd4c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
frame = <topaz.frame.Frame object at 0x2b5bbccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b5bbd4c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>, pc = 22
frame = <topaz.frame.Frame object at 0x2b5bbccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b5bbd4c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>, pc = 23
frame = <topaz.frame.Frame object at 0x2b5bbccc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b5bbd4c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
frame = <topaz.frame.Frame object at 0x2b5bbccc>, pc = 27
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x2b5bbd4c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x2b5c108c>
frame = <topaz.frame.Frame object at 0x2b5bbccc>, pc = 27, meth_idx = 4
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b51238c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b5bbdac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b56db6c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x2b51238c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x2b56db6c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b4e8aec>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b5bbdac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x2b4e8d0c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x2b4e8aec>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
w_receiver = <topaz.objects.fiberobject.W_FiberObject object at 0x2b5bbdac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b5bbdac>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.W_FiberObject object at 0x2b5bbdac>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>, args_w = []
@classdef.method("resume")
def method_resume(self, space, args_w):
if self.parent_fiber is not None:
raise space.error(space.w_FiberError, "double resume")
if self.sthread is not None and self.sthread.is_empty_handle(self.h):
raise space.error(space.w_FiberError, "dead fiber called")
> self.parent_fiber = space.fromcache(State).get_current(space)
topaz/objects/fiberobject.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.State object at 0x2b5bbf2c>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
def get_current(self, space):
> return self.current or space.getexecutioncontext().getmainfiber(space)
topaz/objects/fiberobject.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.executioncontext.ExecutionContext object at 0x2b5bbaac>
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
def getmainfiber(self, space):
if self.w_main_fiber is None:
> self.w_main_fiber = W_FiberObject.build_main_fiber(space, self)
topaz/executioncontext.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b5bbaac>
@staticmethod
def build_main_fiber(space, ec):
w_fiber = W_FiberObject(space)
> w_fiber.sthread = W_FiberObject.get_sthread(space, ec)
topaz/objects/fiberobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
space = <topaz.objspace.ObjectSpace object at 0x2b51238c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b5bbaac>
@staticmethod
def get_sthread(space, ec):
sthread = ec.fiber_thread
if not sthread:
> sthread = ec.fiber_thread = SThread(space.config, ec)
topaz/objects/fiberobject.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b5bbf4c>
config = <rpython.config.config.Config object at 0x2b5b6c4c>
ec = <topaz.executioncontext.ExecutionContext object at 0x2b5bbaac>
def __init__(self, config, ec):
> StackletThread.__init__(self, config)
topaz/objects/fiberobject.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.fiberobject.SThread object at 0x2b5bbf4c>
config = <rpython.config.config.Config object at 0x2b5b6c4c>
@jit.dont_look_inside
def __init__(self, config):
self._gcrootfinder = _getgcrootfinder(config, we_are_translated())
> self._thrd = _c.newthread()
../pypy-pypy-d84133e3e346/rpython/rlib/rstacklet.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <* fn stacklet_newthread>
def __call__(self, *args):
from rpython.rtyper.lltypesystem import rffi
if isinstance(self._T, FuncType):
if len(args) != len(self._T.ARGS):
raise TypeError,"calling %r with wrong argument number: %r" % (self._T, args)
for i, a, ARG in zip(range(len(self._T.ARGS)), args, self._T.ARGS):
if typeOf(a) != ARG:
# ARG could be Void
if ARG == Void:
try:
value = getattr(self._obj, '_void' + str(i))
except AttributeError:
pass
else:
assert a == value
# None is acceptable for any pointer
elif isinstance(ARG, Ptr) and a is None:
pass
# Any pointer is convertible to void*
elif ARG is rffi.VOIDP and isinstance(typeOf(a), Ptr):
pass
# special case: ARG can be a container type, in which
# case a should be a pointer to it. This must also be
# special-cased in the backends.
elif (isinstance(ARG, ContainerType) and
typeOf(a) == Ptr(ARG)):
pass
else:
args_repr = [typeOf(arg) for arg in args]
raise TypeError, ("calling %r with wrong argument "
"types: %r" % (self._T, args_repr))
callb = self._obj._callable
if callb is None:
raise RuntimeError,"calling undefined function"
> return callb(*args)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/lltype.py:1291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.rtyper.lltypesystem.ll2ctypes.LL2CtypesCallable object at 0xd24328c>
def __call__(self, *argvalues):
with rlock:
if self.trampoline is None:
# lazily build the corresponding ctypes function object
> cfunc = get_ctypes_callable(self.funcptr, self.calling_conv)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
funcptr = <* fn stacklet_newthread>, calling_conv = 'c'
def get_ctypes_callable(funcptr, calling_conv):
if not ctypes:
raise ImportError("ctypes is needed to use ll2ctypes")
def get_on_lib(lib, elem):
""" Wrapper to always use lib[func] instead of lib.func
"""
try:
return lib[elem]
except AttributeError:
pass
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
try:
eci = _eci_cache[old_eci]
except KeyError:
eci = old_eci.compile_shared_lib(ignore_a_files=True)
_eci_cache[old_eci] = eci
libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
FUNCTYPE = lltype.typeOf(funcptr).TO
cfunc = None
if libraries:
not_found = []
for libname in libraries:
libpath = None
ext = platform.so_ext
prefixes = platform.so_prefixes
for dir in eci.library_dirs:
if libpath:
break
for prefix in prefixes:
tryfile = os.path.join(dir, prefix + libname + '.' + ext)
if os.path.isfile(tryfile):
libpath = tryfile
break
if not libpath:
> libpath = ctypes.util.find_library(libname)
../pypy-pypy-d84133e3e346/rpython/rtyper/lltypesystem/ll2ctypes.py:1140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def find_library(name):
> return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
/usr/lib/python2.7/ctypes/util.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = '/tmp/usession-default-1/shared_cache/externmod_2.so'
def _findSoname_ldconfig(name):
import struct
# XXX this code assumes that we know all unames and that a single
# ABI is supported per uname; instead we should find what the
# ABI is (e.g. check ABI of current process) or simply ask libc
# to load the library for us
uname = os.uname()[4]
# ARM has a variety of unames, e.g. armv7l
if uname.startswith("arm"):
uname = "arm"
if struct.calcsize('l') == 4:
machine = uname + '-32'
else:
machine = uname + '-64'
mach_map = {
'x86_64-64': 'libc6,x86-64',
'ppc64-64': 'libc6,64bit',
'sparc64-64': 'libc6,64bit',
's390x-64': 'libc6,64bit',
'ia64-64': 'libc6,IA-64',
# this actually breaks on biarch or multiarch as the first
# library wins; uname doesn't tell us which ABI we're using
'arm-32': 'libc6(,hard-float)?',
}
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
expr = r'\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type)
> f = os.popen('/sbin/ldconfig -p 2>/dev/null')
E OSError: [Errno 12] Cannot allocate memory
/usr/lib/python2.7/ctypes/util.py:213: OSError
____________________________ TestIO.test_popen_read ____________________________
self = <tests.objects.test_ioobject.TestIO object at 0x3382dbac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
def test_popen_read(self, space):
w_res = space.execute("""
io = IO.popen("echo foo", "r")
return io.pid.is_a?(Fixnum), io.read
> """)
tests/objects/test_ioobject.py:334:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
source = '\n io = IO.popen("echo foo", "r")\n return io.pid.is_a?(Fixnum), io.read\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
frame = <topaz.frame.Frame object at 0x338f6bcc>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6e8c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
frame = <topaz.frame.Frame object at 0x338f6bcc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6e8c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, pc = 12
frame = <topaz.frame.Frame object at 0x338f6bcc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6e8c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, pc = 13
frame = <topaz.frame.Frame object at 0x338f6bcc>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6e8c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
frame = <topaz.frame.Frame object at 0x338f6bcc>, pc = 17
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6e8c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3397b1ec>
frame = <topaz.frame.Frame object at 0x338f6bcc>, pc = 17, meth_idx = 3
num_args = 2
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x338e3cec>
args_w = [<topaz.objects.stringobject.W_StringObject object at 0x338f6c4c>, <topaz.objects.stringobject.W_StringObject object at 0x338f6f8c>]
block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x338e3cec>
raw_method = <topaz.objects.functionobject.W_UserFunction object at 0x3386b88c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x33850d4c>
args_w = [<topaz.objects.stringobject.W_StringObject object at 0x338f6c4c>, <topaz.objects.stringobject.W_StringObject object at 0x338f6f8c>]
block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_UserFunction object at 0x3386b88c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
args_w = [<topaz.objects.stringobject.W_StringObject object at 0x338f6c4c>, <topaz.objects.stringobject.W_StringObject object at 0x338f6f8c>]
block = None
def call(self, space, w_receiver, args_w, block):
frame = space.create_frame(
self.bytecode,
w_self=w_receiver,
lexical_scope=self.lexical_scope,
block=block,
)
with space.getexecutioncontext().visit_frame(frame):
frame.handle_args(space, self.bytecode, args_w, block)
> return space.execute_frame(frame, self.bytecode)
topaz/objects/functionobject.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
frame = <topaz.frame.Frame object at 0x338f6bac>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6fac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
frame = <topaz.frame.Frame object at 0x338f6bac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6fac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, pc = 129
frame = <topaz.frame.Frame object at 0x338f6bac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6fac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, pc = 130
frame = <topaz.frame.Frame object at 0x338f6bac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6fac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, name = 'SEND_BLOCK'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
frame = <topaz.frame.Frame object at 0x338f6bac>, pc = 134
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x338f6fac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x3386b8ac>
frame = <topaz.frame.Frame object at 0x338f6bac>, pc = 134, meth_idx = 13
num_args = 1
def SEND_BLOCK(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
w_block = frame.pop()
args_w = frame.popitemsreverse(num_args - 1)
w_receiver = frame.pop()
if w_block is space.w_nil:
w_block = None
else:
assert isinstance(w_block, W_ProcObject)
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w, block=w_block)
topaz/interpreter.py:527:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x3386bacc>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x3386bacc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x338e39ac>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x33850d4c>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x338e39ac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x33850d2c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
@moduledef.function("fork")
def method_fork(self, space, block):
return space.send(
space.getmoduleobject(Process.moduledef),
space.newsymbol("fork"),
> block=block
topaz/modules/kernel.py:219:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.moduleobject.W_ModuleObject object at 0x338e774c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x3386bacc>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x3386bacc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x338e77ac>
w_receiver = <topaz.objects.moduleobject.W_ModuleObject object at 0x338e774c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x338e776c>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x338e77ac>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
w_receiver = <topaz.objects.moduleobject.W_ModuleObject object at 0x338e774c>
args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.moduleobject.W_ModuleObject object at 0x338e774c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>, args_w = []
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.moduleobject.W_ModuleObject object at 0x338e774c>
space = <topaz.objspace.ObjectSpace object at 0x3382dc4c>
block = <topaz.objects.procobject.W_ProcObject object at 0x338f6d2c>
@moduledef.function("fork")
def method_fork(self, space, block):
> pid = fork()
E OSError: [Errno 12] Cannot allocate memory
topaz/modules/process.py:58: OSError
__________________________ TestRandomObject.test_new ___________________________
self = <tests.objects.test_randomobject.TestRandomObject object at 0x38c9340c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
def test_new(self, space):
> w_res = space.execute("return Random.new")
tests/objects/test_randomobject.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
source = 'return Random.new', w_self = None, lexical_scope = None
filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
frame = <topaz.frame.Frame object at 0x38d1d60c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38d1d68c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
frame = <topaz.frame.Frame object at 0x38d1d60c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38d1d68c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, pc = 4
frame = <topaz.frame.Frame object at 0x38d1d60c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38d1d68c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, pc = 5
frame = <topaz.frame.Frame object at 0x38d1d60c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38d1d68c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
frame = <topaz.frame.Frame object at 0x38d1d60c>, pc = 9
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38d1d68c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38d1d7cc>
frame = <topaz.frame.Frame object at 0x38d1d60c>, pc = 9, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38cac32c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38cac32c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38ca27cc>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dec>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38ca27cc>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, args_w = []
block = None
@classdef.method("new")
def method_new(self, space, args_w, block):
w_obj = space.send(self, space.newsymbol("allocate"), args_w, block)
> space.send(w_obj, space.newsymbol("initialize"), args_w, block)
topaz/objects/classobject.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38d11d8c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38d11d8c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38cf9f4c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38cf9dcc>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38cf9f4c>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, w_seed = None
@classdef.method("initialize")
def method_initialize(self, space, w_seed=None):
> self.srand(space, w_seed)
topaz/objects/randomobject.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38d1d7ac>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>, seed = 4094936129L
def srand(self, space, seed=None):
previous_seed = self.w_seed
if seed is None:
seed = self._generate_seed()
else:
seed = Coerce.int(space, seed)
> self.w_seed = space.newint(seed)
topaz/objects/randomobject.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38c9352c>, intvalue = 4094936129L
@signature(types.any(), types.int(), returns=types.instance(W_FixnumObject))
def newint(self, intvalue):
> return W_FixnumObject(self, intvalue)
topaz/objspace.py:340:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.intobject.W_FixnumObject object at 0x38d1d6ec>
space = <topaz.objspace.ObjectSpace object at 0x38c9352c>
intvalue = 4094936129L
def __init__(self, space, intvalue):
> check_regular_int(intvalue)
topaz/objects/intobject.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = 4094936129L
def check_regular_int(x):
"""Give a translation-time error if 'x' is not a plain int
(e.g. if it's a r_longlong or an r_uint).
"""
> assert is_valid_int(x)
E assert is_valid_int(4094936129L)
../pypy-pypy-d84133e3e346/rpython/rlib/debug.py:349: AssertionError
__________________________ TestRandomObject.test_rand __________________________
self = <tests.objects.test_randomobject.TestRandomObject object at 0x38d3c50c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
def test_rand(self, space):
> w_res = space.execute("return Random.new.rand")
tests/objects/test_randomobject.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
source = 'return Random.new.rand', w_self = None, lexical_scope = None
filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
frame = <topaz.frame.Frame object at 0x38ddaf2c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ddafac>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
frame = <topaz.frame.Frame object at 0x38ddaf2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ddafac>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, pc = 4
frame = <topaz.frame.Frame object at 0x38ddaf2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ddafac>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, pc = 5
frame = <topaz.frame.Frame object at 0x38ddaf2c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ddafac>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
frame = <topaz.frame.Frame object at 0x38ddaf2c>, pc = 9
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ddafac>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ddaf6c>
frame = <topaz.frame.Frame object at 0x38ddaf2c>, pc = 9, meth_idx = 1
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38d569ec>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38d569ec>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38d4ce4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38dbd72c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38d4ce4c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, args_w = []
block = None
@classdef.method("new")
def method_new(self, space, args_w, block):
w_obj = space.send(self, space.newsymbol("allocate"), args_w, block)
> space.send(w_obj, space.newsymbol("initialize"), args_w, block)
topaz/objects/classobject.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38dd46cc>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38dd46cc>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38dbd88c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38dbd70c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38dbd88c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, w_seed = None
@classdef.method("initialize")
def method_initialize(self, space, w_seed=None):
> self.srand(space, w_seed)
topaz/objects/randomobject.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38de104c>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, seed = 4855168115L
def srand(self, space, seed=None):
previous_seed = self.w_seed
if seed is None:
seed = self._generate_seed()
else:
seed = Coerce.int(space, seed)
> self.w_seed = space.newint(seed)
topaz/objects/randomobject.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>, intvalue = 4855168115L
@signature(types.any(), types.int(), returns=types.instance(W_FixnumObject))
def newint(self, intvalue):
> return W_FixnumObject(self, intvalue)
topaz/objspace.py:340:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.intobject.W_FixnumObject object at 0x38de10ec>
space = <topaz.objspace.ObjectSpace object at 0x38d3c5ac>
intvalue = 4855168115L
def __init__(self, space, intvalue):
> check_regular_int(intvalue)
topaz/objects/intobject.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = 4855168115L
def check_regular_int(x):
"""Give a translation-time error if 'x' is not a plain int
(e.g. if it's a r_longlong or an r_uint).
"""
> assert is_valid_int(x)
E assert is_valid_int(4855168115L)
../pypy-pypy-d84133e3e346/rpython/rlib/debug.py:349: AssertionError
________________________ TestRandomObject.test_subclass ________________________
self = <tests.objects.test_randomobject.TestRandomObject object at 0x38e0eacc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
def test_subclass(self, space):
w_res = space.execute("""
class SubRandom < Random
def better_rand
# http://xkcd.com/221/
4
end
end
c = SubRandom.new
return [c.rand, c.better_rand]
> """)
tests/objects/test_randomobject.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
source = '\n class SubRandom < Random\n def better_rand\n # http://xkcd.com/221/\n 4\n end\n end\n c = SubRandom.new\n return [c.rand, c.better_rand]\n '
w_self = None, lexical_scope = None, filepath = '-e', initial_lineno = 1
def execute(self, source, w_self=None, lexical_scope=None, filepath="-e",
initial_lineno=1):
bc = self.compile(source, filepath, initial_lineno=initial_lineno)
frame = self.create_frame(bc, w_self=w_self, lexical_scope=lexical_scope)
with self.getexecutioncontext().visit_frame(frame):
> return self.execute_frame(frame, bc)
topaz/objspace.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
frame = <topaz.frame.Frame object at 0x38ed150c>
bc = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
def execute_frame(self, frame, bc):
> return Interpreter().interpret(self, frame, bc)
topaz/objspace.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ed19cc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
frame = <topaz.frame.Frame object at 0x38ed150c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
def interpret(self, space, frame, bytecode):
pc = 0
try:
while True:
self.jitdriver.jit_merge_point(
self=self, bytecode=bytecode, frame=frame, pc=pc,
block_bytecode=self.get_block_bytecode(frame.block),
w_trace_proc=space.getexecutioncontext().gettraceproc(),
)
> pc = self._interpret(space, pc, frame, bytecode)
topaz/interpreter.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ed19cc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, pc = 18
frame = <topaz.frame.Frame object at 0x38ed150c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
def _interpret(self, space, pc, frame, bytecode):
prev_instr = frame.last_instr
frame.last_instr = pc
if (space.getexecutioncontext().hastraceproc() and
bytecode.lineno_table[pc] != bytecode.lineno_table[prev_instr]):
space.getexecutioncontext().invoke_trace_proc(space, "line", None, None, frame=frame)
try:
> pc = self.handle_bytecode(space, pc, frame, bytecode)
topaz/interpreter.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ed19cc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, pc = 19
frame = <topaz.frame.Frame object at 0x38ed150c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
def handle_bytecode(self, space, pc, frame, bytecode):
instr = ord(bytecode.code[pc])
pc += 1
if we_are_translated():
for i, name in consts.UNROLLING_BYTECODES:
if i == instr:
pc = self.run_instr(space, name, consts.BYTECODE_NUM_ARGS[i], bytecode, frame, pc)
break
else:
raise SystemError
else:
> pc = self.run_instr(space, consts.BYTECODE_NAMES[instr], consts.BYTECODE_NUM_ARGS[instr], bytecode, frame, pc)
topaz/interpreter.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ed19cc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, name = 'SEND'
num_args = 2
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
frame = <topaz.frame.Frame object at 0x38ed150c>, pc = 23
@specialize.arg(2, 3)
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 2:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
args += (v,)
pc += 2
if num_args >= 3:
raise NotImplementedError
method = getattr(self, name)
try:
> res = method(space, bytecode, frame, pc, *args)
topaz/interpreter.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.interpreter.Interpreter object at 0x38ed19cc>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
bytecode = <topaz.objects.codeobject.W_CodeObject object at 0x38ed1e6c>
frame = <topaz.frame.Frame object at 0x38ed150c>, pc = 23, meth_idx = 3
num_args = 0
def SEND(self, space, bytecode, frame, pc, meth_idx, num_args):
space.getexecutioncontext().last_instr = pc
args_w = frame.popitemsreverse(num_args)
w_receiver = frame.pop()
> w_res = space.send(w_receiver, bytecode.consts_w[meth_idx], args_w)
topaz/interpreter.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38e20f8c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38e20f8c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38e1c40c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38ed1d6c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38e1c40c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_receiver = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, args_w = []
block = None
@classdef.method("new")
def method_new(self, space, args_w, block):
w_obj = space.send(self, space.newsymbol("allocate"), args_w, block)
> space.send(w_obj, space.newsymbol("initialize"), args_w, block)
topaz/objects/classobject.py:88:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38e9ec8c>
args_w = [], block = None
def send(self, w_receiver, w_method, args_w=None, block=None):
if args_w is None:
args_w = []
name = self.symbol_w(w_method)
w_cls = self.getclass(w_receiver)
raw_method = w_cls.find_method(self, name)
> return self._send_raw(w_method, raw_method, w_receiver, w_cls, args_w, block)
topaz/objspace.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_method = <topaz.objects.symbolobject.W_SymbolObject object at 0x38e9ec8c>
raw_method = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38e87e4c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
w_cls = <topaz.objects.classobject.W_ClassObject object at 0x38ed162c>
args_w = [], block = None
def _send_raw(self, w_method, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, w_method)
return method_missing.call(self, w_receiver, args_w, block)
> return raw_method.call(self, w_receiver, args_w, block)
topaz/objspace.py:592:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.functionobject.W_BuiltinFunction object at 0x38e87e4c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
w_receiver = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
args_w = [], block = None
def call(self, space, w_receiver, args_w, block):
frame = BuiltinFrame(self.name)
ec = space.getexecutioncontext()
ec.invoke_trace_proc(space, "c-call", self.name, self.w_class.name)
with ec.visit_frame(frame):
> w_res = self.func(w_receiver, space, args_w, block)
topaz/objects/functionobject.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, args_w = []
block = None
@functools.wraps(self.func)
def wrapper(self, space, args_w, block):
if (len(args_w) < min_args or
(not takes_args_w and len(args_w) > argcount)):
raise space.error(space.w_ArgumentError,
"wrong number of arguments (%d for %d)" % (len(args_w), min_args)
)
args = ()
arg_count = 0
args_w_seen = False
for i, argname in unrolling_argnames:
if argname == "self":
assert isinstance(self, self_cls)
args += (self,)
elif argname == "args_w":
if args_w_seen:
raise SystemError("args_w cannot be repeated")
args += (args_w[arg_count:],)
args_w_seen = True
elif argname == "block":
args += (block,)
elif argname == "space":
args += (space,)
elif argname.startswith("w_") or argname in argspec:
if args_w_seen:
raise SystemError("args_w must be the last argument accepted")
if len(args_w) > arg_count:
if argname.startswith("w_"):
args += (args_w[arg_count],)
elif argname in argspec:
args += (getattr(Coerce, argspec[argname])(space, args_w[arg_count]),)
elif default_start is not None and i >= default_start:
args += (defaults[i - default_start],)
else:
raise SystemError("bad arg count")
arg_count += 1
else:
raise SystemError("%r not implemented" % argname)
> w_res = func(*args)
topaz/gateway.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, w_seed = None
@classdef.method("initialize")
def method_initialize(self, space, w_seed=None):
> self.srand(space, w_seed)
topaz/objects/randomobject.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.randomobject.W_RandomObject object at 0x38ed190c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, seed = 3090902886L
def srand(self, space, seed=None):
previous_seed = self.w_seed
if seed is None:
seed = self._generate_seed()
else:
seed = Coerce.int(space, seed)
> self.w_seed = space.newint(seed)
topaz/objects/randomobject.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>, intvalue = 3090902886L
@signature(types.any(), types.int(), returns=types.instance(W_FixnumObject))
def newint(self, intvalue):
> return W_FixnumObject(self, intvalue)
topaz/objspace.py:340:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <topaz.objects.intobject.W_FixnumObject object at 0x38ed158c>
space = <topaz.objspace.ObjectSpace object at 0x38e0eb4c>
intvalue = 3090902886L
def __init__(self, space, intvalue):
> check_regular_int(intvalue)
topaz/objects/intobject.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = 3090902886L
def check_regular_int(x):
"""Give a translation-time error if 'x' is not a plain int
(e.g. if it's a r_longlong or an r_uint).
"""
> assert is_valid_int(x)
E assert is_valid_int(3090902886L)
../pypy-pypy-d84133e3e346/rpython/rlib/debug.py:349: AssertionError
======== 20 failed, 1027 passed, 5 skipped, 7 xfailed in 306.21 seconds ========
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment