cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
joshszep has quit [Ping timeout: 250 seconds]
joshszep_ has joined #pypy
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
mannerism has quit [Remote host closed the connection]
jcea has quit [Ping timeout: 248 seconds]
jcea has joined #pypy
catern- is now known as catern
jcea has quit [Remote host closed the connection]
joshszep_ has joined #pypy
joshszep has quit [Ping timeout: 268 seconds]
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
lehmrob has joined #pypy
joshszep_ has joined #pypy
derpydoo has quit [Quit: derpydoo]
joshszep has quit [Ping timeout: 240 seconds]
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
catern has quit [Ping timeout: 250 seconds]
derpydoo has joined #pypy
joshszep has quit [Ping timeout: 255 seconds]
joshszep_ has joined #pypy
joshszep_ has quit [Read error: Connection reset by peer]
joshszep has joined #pypy
Atque has quit [Remote host closed the connection]
Atque has joined #pypy
Techcable has quit [Ping timeout: 268 seconds]
Techcable has joined #pypy
catern has joined #pypy
<ctismer> Found the problem: We are crashing when trying to retrieve the partial function.
<ctismer> static auto *const _partial = Shiboken::String::createStaticString("partial");
<ctismer> static auto *const partial = PyObject_GetAttr(functools, _partial);
<ctismer> cfbolz: is matti around in these days?
<cfbolz> ctismer: he has been on vacation, I think back tomorrow? Or next week?
<cfbolz> ctismer: do. You feel like giving me some C code that shows the problem? I can also try to look into it
<ctismer> cfbolz: Ok, fine! Here is the crashing function. It is retrieving the partial function from Python.
<ctismer> doing that segfaults, but I did not debug any further because I can't make sense of the generated code (also obscure since I have an ARM now)
<ctismer> I have confirmed that the crash is really in that last PyObject_GetAttr call.
<ctismer> We can probably work around that, but it really is an astonishing bug :D
Dejan has joined #pypy
<ctismer> Ahhh, the `_functools` module seems not to exist.
<ctismer> Fixed :-)
<cfbolz> ctismer: aaaaah, right. why did it work on an older version then?
<ctismer> No idea, maybe an alias was there
derpydoo has quit [Quit: derpydoo]
mattip has joined #pypy
jcea has joined #pypy
<ctismer> _functools is a builtin module which gets extended by functools. Maybe they did a clean-up
<ctismer> yeah, but _functools is totally gone, now. Anyway, things work for us with functools
derpydoo has joined #pypy
<cfbolz> ctismer: _functools in cpython is an 'accelerator module' that might or might not be there
<mattip> maybe PyObject_GetAttr should check for a NULL obj
<mattip> but CPython does not check for NULL, so why should we?
<mattip> I guess since this is C, it should be on the caller to make sure after every call there was no error returned
joshszep has quit [Read error: Connection reset by peer]
<ctismer> I used that function because I prefer a builtin since I don‘t have to check if it was tampered with. And I was away fron PyPy for about a year, so I was much surprized.
<ctismer> Was the function existent by accident in PyPy 7.3.9 or why did I get no crash?
<ctismer> s/function/module/
<ctismer> Ah, I will handle the accelerator module as you said cfbolz, thank you!
<ctismer> mattip: things are very different. CPython will probably stick with this internal acceleration, and I used this because it‘s a builtin. PyPy has no reason to accelerate itself. But being an immutable builtin is a welcome security measure for us. Admittedly an abuse :-)
derpydoo has quit [Quit: derpydoo]
derpydoo has joined #pypy
<tumbleweed> ctismer: see the ticket I posted above for what happened there (the module was removed to fix that bug)
<mattip> PyObject_GetAttr(obj, name) will segfault if obj is NULL. Someone needs to check that. The implementation of PyObject_GetAttr does not do any validity checks
<mattip> neither in CPython nor in PyPy
lehmrob has quit [Quit: Konversation terminated!]
derpydoo has quit [Ping timeout: 268 seconds]
catern has quit [Ping timeout: 250 seconds]
otisolsen70 has joined #pypy
otisolsen70 has quit [Quit: Leaving]
<ctismer> Yes, why should it. _functools is a builtin module. There is by definition no reason to check anything of a builtin. This is now lost by the removal of _functools, and I need to verify that I really get the function that I expect. A bad move in my eyes.
<jean-paul[m]> del _functools.partial totally works.
<jean-paul[m]> It might be builtin but it's still a hateful sack of mutable state
<jean-paul[m]> I think you have to say "I don't mind if it segfaults sometimes" or "I'll check for NULL (and probably other things) everywhere".
<jean-paul[m]> which you say is, of course, up to you :)
<jean-paul[m]> (put another way, it was always possible for it to segfault, the _functools change that actually happened merely realized one of those ways)
catern has joined #pypy
<ctismer> Hmm, you are right jean-paul[m] it was only obfuscation by the name but it is not safe since this is not read-only. And there is no way out because there is no API to access this reliably. Thanks for the correction, how sad. There should be a layer for extensions that gives a secure way to access internals without exposing their implementation.
<ctismer> That was really a very wrong assumption that builtin modules were read-only. Sigh… I stand corrected
<ctismer> tumbleweed: Now I understand the reference you gave :)