These are chat archives for dropbox/pyston

2nd
Sep 2015
Sun
@Daetalus
Sep 02 2015 00:15

Hi, in CPython, list_repeat use

(Py_SIZE(a) > PY_SSIZE_T_MAX / n)

to check whether the new list is "out of memory", where a is a list object, n is a number that multipled to list.

For example, [1,2] * 9999999999should get MemoryError.
But here, Py_SIZE(a) is 2, n is 9999999999, PY_SSIZE_T_MAX defined in pyport.h, which is 9223372036854775807.

In Pyston, my check in pesudocode is BoxedList->size > PY_SSIZE_T_MAX / n.

How could the expression evaluated as True in this situation(Both CPython and Pyston)?

PS1: I assume BoxedList->size and Py_SIZE(PyListObject*) is same thing.
PS2: I solved the problem before, but after I lost the code accidentally. I just forgot how to solved it again...

Kevin Modzelewski
@kmod
Sep 02 2015 00:27
are you sure that that's the check that's throwing the MemoryError?
ie could it be getting past that and then throwing a memory error when it actually tries to allocate the memory?
Sun
@Daetalus
Sep 02 2015 00:32
Thanks, I think that's the point. Checking.
Rudi Chen
@rudi-c
Sep 02 2015 06:43
Has anyone seen something like this before?
../../src/core/thread_utils.h:196: static void pyston::threading::PerThreadSet<pyston::gc::SmallArena::ThreadBlockCache, pyston::gc::Heap *, pyston::gc::SmallArena *>::dtor(void *) [T = pyston::gc::SmallArena::ThreadBlockCache, CtorArgs = <pyston::gc::Heap *, pyston::gc::SmallArena *>]: Assertionself->map.size() == self->map_elts' failed: 0 2`
../../src/core/thread_utils.h:196: static void pyston::threading::PerThreadSet<pyston::gc::SmallArena::ThreadBlockCache, pyston::gc::Heap *, pyston::gc::SmallArena *>::dtor(void *) [T = pyston::gc::SmallArena::ThreadBlockCache, CtorArgs = <pyston::gc::Heap *, pyston::gc::SmallArena *>]: Assertion `self->map.size() == self->map_elts' failed: 0 2
For some reason it happens only on my local machine (not jitdev).
Marius Wachtler
@undingen
Sep 02 2015 09:38
mmh isn't this the error we encounter sometimes on travis ci while running threading_local.py but can not reproduce locally?
Kevin Modzelewski
@kmod
Sep 02 2015 10:19
whoa you hit the jackpot!
we've been seeing that on travis-ci for a while but haven't been able to reproduce it
maybe we can take a look at it together tomorrow
Rudi Chen
@rudi-c
Sep 02 2015 15:40
I can get it to happen consistently but only with make check_generator_thread_sharing