cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-32/builds/6673 [mattip: force build, release-pypy3.6-v7.x]
oberstet has quit [Remote host closed the connection]
oberstet has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/rpython-linux-x86-64/builds/229 [mattip: force build, release-pypy3.6-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6492 [mattip: force build, release-pypy3.6-v7.x]
abrown__ has joined #pypy
abrown_ has quit [Ping timeout: 245 seconds]
i9zO5AP has quit [Quit: WeeChat 2.5]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/7718 [ronan: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/7719 [mattip: force build, release-pypy3.6-v7.x]
jcea has quit [Quit: jcea]
andi- has quit [Remote host closed the connection]
xcm has quit [Read error: Connection reset by peer]
andi- has joined #pypy
xcm has joined #pypy
abrown__ has quit [Quit: Leaving]
abrown has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-s390x/builds/1356 [mattip: force build, release-pypy3.6-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4861 [mattip: force build, release-pypy3.6-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/7719 [mattip: force build, release-pypy3.6-v7.x]
speeder39_ has quit [Quit: Connection closed for inactivity]
fryguybob has quit [Read error: Connection reset by peer]
fryguybob has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-aarch64/builds/101 [mattip: force build, release-pypy3.6-v7.x]
xcm has quit [Read error: Connection reset by peer]
xcm has joined #pypy
_aegis_ has quit [Ping timeout: 245 seconds]
_aegis_ has joined #pypy
xcm is now known as Guest14359
Guest14359 has quit [Killed (tolkien.freenode.net (Nickname regained by services))]
xcm has joined #pypy
dddddd has quit [Remote host closed the connection]
dmalcolm has quit [Ping timeout: 246 seconds]
dmalcolm has joined #pypy
mattip has quit [Ping timeout: 240 seconds]
mattip has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/99 [mattip: force build, release-pypy3.6-v7.x]
<kenaan> mattip default 51d5d7494591 /.hgtags: Added tag release-pypy3.6-v7.2.0rc1 for changeset 4d6761df14ff
<bbot2> Failure: http://buildbot.pypy.org/builders/rpython-win-x86-32/builds/201 [mattip: force build, release-pypy3.6-v7.x]
<tumbleweed> woo rc
<Dejan> Looks like number of failed 3.7 tests is going down too, brilliant
antocuni has joined #pypy
lesshaste has joined #pypy
oberstet has quit [Quit: Leaving]
Ai9zO5AP has joined #pypy
jvesely has quit [Quit: jvesely]
antocuni has quit [Ping timeout: 276 seconds]
<lesshaste> this code makes pypy segfault https://bpaste.net/show/6Ops
<lesshaste> is that expected?
<Dejan> I guess not
<Dejan> good news, pypy 3.7 works as expected ;)
<Dejan> it does not segfault
<Dejan> pypy 3.6 does
<lesshaste> Dejan, aha!
<lesshaste> Dejan, it would be awesome if pypy 3.7 were available at https://launchpad.net/~pypy/+archive/ubuntu/ppa
<Dejan> pypy 3.7 is "in development"
<lesshaste> Python 3.6.1 is the most recent ther
<lesshaste> Dejan, oh I see
<lesshaste> oh this is to support python 3.7?
<Dejan> PyPy 7.2.0 is going to be released soon, bringing stable 3.6
<Dejan> so this is a bug that should be reported anyway
<Dejan> and your code can easily become a test case
<lesshaste> Dejan, ok thanks. How should I report it?
<lesshaste> or is telling you enough :) ?
<Dejan> nope, i only recently started coming here as I got excited about the aarch64 support :)
<lesshaste> ah ok
<lesshaste> https://bitbucket.org/pypy/pypy/issues?status=new&status=open doesn't obviously provide a way to make a new issue
<Dejan> I think making an issue there is probably the first thing that comes to mind
<Dejan> it can also be a regression
<lesshaste> Dejan, I don't see a link for making an issue there
<Dejan> top-right
<Dejan> "Create issue"
<Dejan> I agree it is hard to find
<lesshaste> Dejan, https://imgur.com/a/oZPcMrV
<Dejan> maybe you must register
<Dejan> not maybe - most likely ;)
<lesshaste> Dejan, you are quite right
edd[m] has quit [Read error: Connection reset by peer]
agates[m] has quit [Write error: Connection reset by peer]
bendlas has quit [Write error: Connection reset by peer]
<lesshaste> reported.. for some reason indentation is not showing the report but hopefully it will be clear nonetheless
<cfbolz> lesshaste: if you set the recursionlimit super high it's expected that you segfault
<lesshaste> cfbolz, it doesn't segfault in python
<lesshaste> as in cpython
infinite has quit [Ping timeout: 240 seconds]
<cfbolz> yes, because slightly different stack uses is not covered by the language definition
<cfbolz> from the docs of setrecursionlimit: The highest possible limit is platform- dependent.
<lesshaste> cfbolz, so what is it for pypy?
<Dejan> cfbolz, how come pypy3.7 works, and pypy3.6 does not
<cfbolz> it depends on the OS and many details
<Dejan> on the same machine
<cfbolz> Dejan: did you try both pypy 3.6 and 3.7 on the same machine?
<Dejan> yep
<cfbolz> cool
<Dejan> that is why i wrote the above :)
<cfbolz> so probably due to some accidental reason 3.7 uses a bit less stack somewhere
<Dejan> "Dejan> good news, pypy 3.7 works as expected ;)"
infinite has joined #pypy
<lesshaste> cfbolz, how do you fix the indentation in https://bitbucket.org/pypy/pypy/issues/3083/segfault-in-recursive-code ?
<cfbolz> Dejan: yes, but that doesn.t mean you tried 3.6 ;-)
<lesshaste> when I try it doesn't stick when I save it
<Dejan> I did say that too
<Dejan> below
<lesshaste> 10**4 fails in pypy but 10**6 succeeds in python
<lesshaste> that's quite a big gap
<Dejan> anyway, you can say "it is an implementation detail" :D
speeder39_ has joined #pypy
<lesshaste> my main problem is the indentation currently
<cfbolz> lesshaste: it's markdown, so enclose it in ```...```. I fixed the indentation
<lesshaste> thanks!
<cfbolz> in backticks
<lesshaste> cfbolz, I just used the "code" button
<Dejan> or open it in your favourite editor and apend 4 spaces to each line
<lesshaste> Dejan, I did that and they were deleted!
<lesshaste> cfbolz, so.. can my code be made to run in pypy somehow?
<lesshaste> given that increasing the recursive depth appears to fail
<tumbleweed> revdb doesn't build on 2.7, in the rc
bendlas has joined #pypy
<tumbleweed> rpython/translator/revdb/src-revdb/revdb_include.h:120:9: no
<tumbleweed> te: in definition of macro 'RPY_REVDB_EMIT'
<tumbleweed> err no, not that
<tumbleweed> pypy_module_sys.c:956:58: error: expected expression before ')' token
<tumbleweed> 956 | OP_GC_INCREASE_ROOT_STACK_DEPTH(l_v414508, /* nothing */);
<tumbleweed> | ^
jcea has joined #pypy
<lesshaste> cfbolz, do you mean this line "sys.setrecursionlimit(n) sets the limit only approximately, by setting the usable stack space to n * 768 bytes. On Linux, depending on the compiler settings, the default of 768KB is enough for about 1400 calls."
agates[m] has joined #pypy
edd[m] has joined #pypy
Rhy0lite has joined #pypy
<mattip> tumbleweed: could you file an issue so we can track it?
<tumbleweed> yeah, sure
<mattip> i just now sent a mail with the release candidates and hashes
<Dejan> you rock
<lesshaste> hi mattip . I reported https://bitbucket.org/pypy/pypy/issues/3083/segfault-in-recursive-code today but there is some question over whether it is a bug or not
<lesshaste> what is your view?
<lesshaste> one suggestion is that recursive depth is undefined behaviour
<lesshaste> or something like that :)
<mattip> it seems segfaulting is not very user friendly, but not sure what else we can do.
<lesshaste> mattip, is it clear why pypy segfaults with sys.setrecursionlimit(10**4) (note the 4) but cpython doesn't with sys.setrecursionlimit(10**6) (note the 6)?
<lesshaste> and/or why pypy 3.7 doesn't segfault at all but pypy 3.6 does?
<mattip> with large enough values, everything would crash, right?
<lesshaste> mattip, cpython doesn't crash I think. At least what I see is a max recursive depth error
<lesshaste> maybe I should say I haven't managed to make it segfault yet
<mattip> an error would be friendlier, agreed
<mattip> it seems like a corner case, what happens if you do not call setrecursionlimit?
<lesshaste> mattip, then you get the error RuntimeError: maximum recursion depth exceeded
<lesshaste> I am not clear why it is segfaulting at all in fact
<lesshaste> mattip, do you know why it segfaults?
<mattip> lesshaste: could you try your script on the release candidates? I am not seeing a segfault on a pypy2 from Sept 26
<Dejan> lesshaste, works with pypy3.6 on aarch64 :)
<Dejan> Python 3.6.9 (16472df37081, Sep 27 2019, 10:39:48)
<Dejan> [PyPy 7.3.0-alpha0 with GCC 7.4.0]
<lesshaste> mattip, Dejan has release candidates and is kindly trying the code out
<Dejan> mattip, good news it works with rc1 PyPy 3.6
speeder39_ has quit [Quit: Connection closed for inactivity]
<Dejan> lesshaste, ^^
<mattip> lesshaste: what versions of pypy were you using?
<lesshaste> mattip, Python 3.6.1 (7.1.1+dfsg-1~ppa1~ubuntu16.04, Aug 09 2019, 16:05:52)
<lesshaste> [PyPy 7.1.1 with GCC 5.4.0 20160609
<lesshaste> Python 2.7.13 (7.1.1+dfsg-1~ppa1~ubuntu16.04, Aug 09 2019, 13:41:07)
<lesshaste> [PyPy 7.1.1 with GCC 5.4.0 20160609]
<Dejan> Python 3.6.9 (4d6761df14ff, Oct 01 2019, 22:38:29)
<Dejan> [PyPy 7.2.0 with GCC 6.2.0 20160901] on linux
<Dejan> this version works as expected
<Dejan> I did have an old PyPy 3.6 and that is why it failed
<Dejan> I had 7.1.1 beta
<lesshaste> looks like someone has fixed it.. somehow
<Dejan> :)
<atomizer> setrecursionlimit was a mistake
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<kenaan> arigo default cd96ab5b8d1e /rpython/translator/revdb/src-revdb/revdb_include.h: Issue #3084 Fix compilation error when building revdb
<mattip> arigato: could you take a look at this win32 translation failure on py3.6?
<mattip> maybe fall out from a55eb5aca533 changing unicode_encode_utf_8_impl?
<lesshaste> atomizer, what do you mean?
jvesely has joined #pypy
ronan__ has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1145 [mattip: force build, release-pypy3.6-v7.x]
gracinet has quit [Quit: WeeChat 1.6]
gracinet1 has joined #pypy
gracinet1 has left #pypy [#pypy]
gracinet1 has joined #pypy
gracinet1 has left #pypy [#pypy]
gracinet has joined #pypy
<gracinet> Hi there
<mattip> gracinet: hi
<atomizer> lesshaste, just my opinion of the api. hitting os/env stack limits should probably prompt rethinking of approach
<lesshaste> atomizer, got you
<lesshaste> atomizer, I don't think it's clear why it was segfaulting in the first place
<lesshaste> but yes, I should rewrite the code in an iterative style
<lesshaste> which would solve all of this
<cfbolz> lesshaste: it's clear why you segfault
<cfbolz> because you blow the C stack
antocuni has joined #pypy
<Dejan> why it does not segfault with CPython and recent PyPy
<Dejan> lesshaste, simply get PyPy 3.6 rc1
<Dejan> it works as expected
<atomizer> just because stars aligned. increase depth and it should
<kenaan> cfbolz release-pypy2.7-v7.x 6fe1105c1e17 /pypy/module/_pypyjson/: corner case in the json decoder: like regular object maps, don't make the json maps arbitrarily huge ...
<kenaan> arigo release-pypy2.7-v7.x 6a59a88053cc /rpython/translator/revdb/src-revdb/revdb_include.h: Issue #3084 Fix compilation error when building revdb (grafted from cd96ab5b8d1e4364105cb4a3c21a31b5d...
<kenaan> cfbolz release-pypy3.6-v7.x bd5961409c41 /pypy/module/_pypyjson/: corner case in the json decoder: like regular object maps, don't make the json maps arbitrarily huge ...
<kenaan> arigo release-pypy3.6-v7.x 7fbabb23dfec /rpython/translator/revdb/src-revdb/revdb_include.h: Issue #3084 Fix compilation error when building revdb (grafted from cd96ab5b8d1e4364105cb4a3c21a31b5d...
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<cfbolz> atomizer: exactly
<Dejan> nobody talked about increasing the depth
<Dejan> point is that with the depth lesshaste used in his code it should not segfault
<Dejan> i tried the code on 4 different machines, and it behaves the same - CPython 3.6 works, rc1 PyPy 3.6 works, latest PyPy 3 stable segfaults
<Dejan> i can't align the stars on all of them
<Dejan> I wish I had such powers
<Dejan> good thing is that it got fixed somehow
<lesshaste> cfbolz, shouldn't it report a max recursive depth warning rather than segfault?
<cfbolz> lesshaste: no, you disabled that by setting setrecursionlimit too high
<cfbolz> That's what the recursion limit is for
<lesshaste> cfbolz, I see what you mean. In that case the question is, why is the C stack so small in pypy compared to cpython
<lesshaste> is/was
<cfbolz> The C stack is the same. But pypy uses more of it per python function call
<lesshaste> cfbolz, ah I see. Is there a reason it has to be a constant size? That is why it can't be dynamically resized until you run out of RAM?
<lesshaste> or even have a size which is a function of the currently set recursive depth?
<cfbolz> You could achieve that (stackless python did) but it's slower
<Dejan> lesshaste, btw did you see my msg above that it works with PyPy 3.6 rc1 ?
<lesshaste> Dejan, yes, thanks
<lesshaste> !
<lesshaste> that ! is meant to be attached to the thanks
<Dejan> okidoki
<lesshaste> in any case.. someone not on IRC currently fixed it
<lesshaste> I wonder if it's easy to see the patch that did that
jvesely has quit [Quit: jvesely]
<cfbolz> lesshaste: no, it's not a 'fix'. It's a random rejiggling that happens to make it work. It can't be really fixed easily. If you write different code that sets the recursion limit differently and recurses you can still segfault, both on PyPy and CPython
<cfbolz> eg this one segfaults on my phone 😂 https://www.irccloud.com/pastebin/lPKu1ZcZ
<lesshaste> cfbolz, ok. The main issue seems to be the size of the stack relative to the extra RAM pypy uses per python function. A simple fix would seem to be to make the stack larger by the RAM overhead that pypy adds to the python functions.
<lesshaste> i.e. make the pypy stack larger than the cpython stack to compensate
<cfbolz> No, there are situations where CPython uses more stack. Do you then want pypy to compensate in the other direction?
<lesshaste> cfbolz, ah.. that sounds messy indeed.
<lesshaste> cfbolz, one last dim question... why isn't accessing something outside the stack detected as a run time error? that is rather than a segfault?
<cfbolz> That's how c works
<cfbolz> The segfault *is* the way that the problem is detected
<lesshaste> cfbolz, hmm.. aren't there wrappers one can use to make functions behave better? Like out of bounds checkers
<cfbolz> Yes, but they cost performance
<cfbolz> Anyway, that wrapper is the recursion limit
<cfbolz> Which you disabled
<lesshaste> cfbolz, the recursion limit is only loosely connected to the stack size I thought
<cfbolz> So?
<lesshaste> the user has no way to know what recursion limit to set if they don't want the system to segfault
<lesshaste> user/coder
<cfbolz> lesshaste: sure! Leave the default value
<lesshaste> cfbolz, :)
<cfbolz> Yes, I agree, it's very much a 'use at your own risk' api
<lesshaste> it is a shame as python is very much a teaching language
<lesshaste> and recursion is very much a tool used in teaching CS
<lesshaste> but it seems a mess in python in general
<cfbolz> Yep
<lesshaste> and I have a friend who keeps on telling me to move to Julia :)
<lesshaste> there are a number of nice ideas for efficient bounds checking in C... https://www.imperial.ac.uk/pls/portallive/docs/1/18619746.PDF is one project
<Dejan> tell your friend to move to D
<Dejan> }:)
Rhy0lite has quit [Quit: Leaving]
lritter has joined #pypy
antocuni has quit [Ping timeout: 245 seconds]
jvesely has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
dddddd has joined #pypy
xcm has quit [Remote host closed the connection]
jvesely has quit [Quit: jvesely]
xcm has joined #pypy
lesshaste has quit [Ping timeout: 268 seconds]
jvesely has joined #pypy
inhahe has quit []
Arfrever has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
inhahe has joined #pypy
<kenaan> rlamy py3.6-asyncgen 4fb21ab8a5c6 /pypy/interpreter/baseobjspace.py: Add space.callable_w() method
<kenaan> rlamy py3.6-asyncgen 647cc06b34f4 /pypy/: Make asyncgen_hooks thread-local
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
jvesely has quit [Quit: jvesely]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
antocuni has joined #pypy
jvesely has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
jcea has quit [Ping timeout: 245 seconds]
jvesely has quit [Quit: jvesely]
i9zO5AP has joined #pypy
jcea has joined #pypy
Ai9zO5AP has quit [Ping timeout: 246 seconds]
jvesely has joined #pypy
jvesely has quit [Quit: jvesely]
speeder39_ has joined #pypy
jvesely has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
jcea has quit [Ping timeout: 245 seconds]
jvesely has quit [Quit: jvesely]