[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye
Change by Xavier de Gaye : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye
Xavier de Gaye added the comment: New changeset aaf6a3dbbdb9754f98d480b468adfcae0f66e3a2 by xdegaye (Miss Islington (bot)) in branch '3.6': [3.6] bpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406) (#4083)

[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4053 stage: -> patch review ___ Python tracker ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-10-23 Thread Xavier de Gaye
Xavier de Gaye added the comment: Test cases in issues #30697 and #30817, back ported to 3.6, need _testcapi.set_nomemory(). -- versions: +Python 3.6 ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-07-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: New changeset 85f643023fed3d4e2fb8e399f9ad57f3a65ef237 by xdegaye in branch 'master': bpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406) https://github.com/python/cpython/commit/85f643023fed3d4e2fb8e399f9ad57f3a65ef237 --

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-30 Thread Xavier de Gaye
Xavier de Gaye added the comment: > Oh, I'm curious about that one :-) This is issue 30817. -- ___ Python tracker ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-26 Thread STINNER Victor
STINNER Victor added the comment: 2017-06-26 15:34 GMT+02:00 Xavier de Gaye : > python: Objects/call.c:89: _PyObject_FastCallDict: Assertion > `!PyErr_Occurred()' failed. > Aborted (core dumped) > > I will create a new issue when the current issue is closed. Oh, I'm

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-26 Thread Xavier de Gaye
Xavier de Gaye added the comment: > But is it useful to test N memory allocation failures in a row? I think it is useful. See my previous post. -- ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-26 Thread Xavier de Gaye
Xavier de Gaye added the comment: For the record, while working on the test case of PR 2406, I found by chance that the following script: # Script start. import _testcapi class C(): pass _testcapi.set_nomemory(0, 5) C() # Script end. fails with: python: Objects/call.c:89:

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-26 Thread STINNER Victor
STINNER Victor added the comment: I prefer your new PR. But is it useful to test N memory allocation failures in a row? The API and the code would be simpler if we would only test a single failure. What do you think? I know that pyfailmalloc is different, but I'm not sure that pyfailmalloc

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-26 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- pull_requests: +2454 ___ Python tracker ___ ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-25 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- pull_requests: -2415 ___ Python tracker ___ ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- pull_requests: +2415 ___ Python tracker ___ ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- pull_requests: -2406 ___ Python tracker ___ ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- pull_requests: +2406 ___ Python tracker ___ ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: Good point. Not freeing the memory made the implementation of set_nomemory_allocator() simpler, no need to call PyMem_GetAllocator(). Forget about this point, sorry :-) -- ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread STINNER Victor
STINNER Victor added the comment: > I am not sure, failmalloc.enable(range) accepts only range > 1, hook_malloc() > fails only once instead of permanently and hook_free() does free memory. All these things can change :-) > Also what happens then after this call is not very close to real life

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: I am not sure, failmalloc.enable(range) accepts only range > 1, hook_malloc() fails only once instead of permanently and hook_free() does free memory. -- ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread STINNER Victor
STINNER Victor added the comment: Your code can be reproduced with pyfailmalloc using N=0 :-) -- ___ Python tracker ___

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: The chain of events following a call to set_nomemory_allocator() is deterministic, this is another difference with pyfailmalloc. Also what happens then after this call is not very close to real life as memory is never freed. Having the possibility to trigger

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread STINNER Victor
STINNER Victor added the comment: The main difference between your change and pyfailmalloc is the ability in pyfailmalloc to only fail in N allocations. If you want to test various code paths, you need to allow N allocations to reach the deep code that you want to test. My code is something

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: > I think the allocators must just return NULL, without setting the error. You are right, thanks. -- ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-19 Thread Xavier de Gaye
Xavier de Gaye added the comment: Yes, actually I thought first about re-opening issue 19817 instead of opening this new issue. -- ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread STINNER Victor
STINNER Victor added the comment: Nice. Do you know my https://pypi.python.org/pypi/pyfailmalloc project? It helped me to identify and fix dozens of code which didn't handle properly memory allocation failures. Seach for "pyfailmalloc" in the bug tracker (closed issues) ;-) --

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the allocators must just return NULL, without setting the error. -- nosy: +serhiy.storchaka ___ Python tracker

[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-18 Thread Xavier de Gaye
New submission from Xavier de Gaye: Add the set_nomemory_allocator() function to _testcapi that sets a no memory allocator. -- components: Tests files: nomemory_allocator.patch keywords: patch messages: 296266 nosy: haypo, xdegaye priority: normal severity: normal status: open title: