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> Started: http://buildbot.pypy.org/builders/rpython-win-x86-64/builds/1 [nulano: test branch, win64]
ronan__ has joined #pypy
ronan has quit [Ping timeout: 272 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/rpython-win-x86-64/builds/1 [nulano: test branch, win64]
jcea has quit [Ping timeout: 258 seconds]
mgedmin has quit [Quit: ZNC - https://wiki.znc.in/ZNC]
mgedmin has joined #pypy
wleslie has quit [Quit: Lost terminal]
wleslie has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-64/builds/32 [nulano: test branch, win64-py3.6]
andrewsmedina has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-64/builds/113 [nulano: test branch, win64-py3.6]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-64/builds/113 [nulano: test branch, win64-py3.6]
_whitelogger has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2488 [mattip: test non-win64, win64-py3.6]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7271 [mattip: test non-win64, win64-py3.6]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5595 [mattip: test non-win64, win64-py3.6]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8393 [mattip: test non-win64, win64-py3.6]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8393 [mattip: test non-win64, win64-py3.6]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2488 [mattip: test non-win64, win64-py3.6]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5595 [mattip: test non-win64, win64-py3.6]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7271 [mattip: test non-win64, win64-py3.6]
<mattip> untranslate pypy/module/_socket/test/test_sock_app.py::test_gethostbyaddr is crashing on win64-py3.6 with the pypy64-2.7 host
rfgpfeiffer has joined #pypy
epony has quit [Remote host closed the connection]
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
epony has joined #pypy
dddddd has quit [Ping timeout: 240 seconds]
<rjarry> I have a function that allocates a pointer: int sr_connect(foo_t **) and I want to register a destructor
<rjarry> so I do:
<rjarry> foo_p = ffi.new('foo_t **')
<rjarry> lib.sr_connect(foo_p)
<rjarry> foo = ffi.gc(foo_p[0], lib.sr_disconnect)
<rjarry> however, if there is a signal that causes the program to exit before I register the destructor, it is not called
<rjarry> how can I make sure to register it before calling connect ?
<rjarry> calling gc before connect does not work as it makes a copy
oberstet has joined #pypy
<rjarry> mattip: not really no
<rjarry> the only solution I found is to block signals before calling connect and unblock them after calling ffi.gc
<rjarry> but I was hoping there is a more elegant solution
lritter has joined #pypy
vstinner has quit [Quit: leaving]
jacob22 has quit [Quit: Konversation terminated!]
dddddd has joined #pypy
ronan__ is now known as ronan
pmp-p has quit [Quit: No Ping reply in 180 seconds.]
pmp-p has joined #pypy
pmp-p has quit [Quit: No Ping reply in 180 seconds.]
pmp-p has joined #pypy
andrewsmedina has quit []
andrewsmedina has joined #pypy
<rjarry> mattip, arigato do you have an opinion on https://foss.heptapod.net/pypy/cffi/-/issues/476 ?
<lazka> rjarry, couldn't you block the signal in Python using the signal module?
andrews has joined #pypy
<rjarry> lazka: block it always ?
<rjarry> depending on the type of callback, you may not know in advance when it will be called
<lazka> also seems racy, what if the signal was already received, you'd still get an exception in the callback, right?
<rjarry> I don't know, I do not have enough knowledge of POSIX signals
andrews has quit [Client Quit]
<lazka> rjarry, I mean block for the duration of do_stuff_while_under_lock
<rjarry> yes I in that example that would fix this particular issue
<rjarry> but depending on the C libraries, callbacks may be called from threads not created by python
<rjarry> asynchronously
<lazka> I currently handle a similar situation by setting a custom signal handler and checking if it was called afterwards
<rjarry> but as a general matter, it looks to me that since the python callback is called by C code, it cannot propagate any exception
<rjarry> since a signal handler may raise one
<rjarry> I think that python extern callbacks should not be interrupted by signal handlers
<rjarry> I don't know if I'm making sense
<rjarry> because even if you handle the exception, if it is SystemExit, what would you do with it ?
<rjarry> except do some very hackish code
<rjarry> I see no downside in defering the signals to after the callback has returned
<rjarry> except maybe for some race condition I do not forsee
<lazka> I have code that depends on signals in callbacks working.. a C event loop that runs forever and calls into Python
<lazka> (though using cpython api, not cffi)
<rjarry> that is why I suggested to make that optional
jacob22 has joined #pypy
jcea has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2489 [mattip: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5596 [mattip: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8394 [mattip: force build, py3.7]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2489 [mattip: force build, py3.7]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8394 [mattip: force build, py3.7]
andrewsmedina has quit [Quit: Connection closed for inactivity]
<bbot2> Started: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2490 [mattip: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8395 [mattip: force build, py3.7]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5596 [mattip: force build, py3.7]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5597 [mattip: force build, py3.7]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8395 [mattip: force build, py3.7]
rfgpfeiffer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<bbot2> Failure: http://buildbot.pypy.org/builders/own-win-x86-32/builds/2490 [mattip: force build, py3.7]
<ronan> mattip, mgorny: why did d147d3b422d7 modify rpython/?
<mgorny> ronan: sorry, probably some mercurial magic doing something i didn't anticipate
lritter has quit [Quit: Leaving]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5598 [mattip: force build, py3.7]
mattip_ has joined #pypy
mattip has quit [Ping timeout: 264 seconds]
<ronan> mgorny: I guess it comes from c8bdc9146f6e then
rubdos has quit [Ping timeout: 260 seconds]
jacob22 has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/5598 [mattip: force build, py3.7]
Dejan has quit [Quit: Leaving]
Ai9zO5AP has joined #pypy
Ai9zO5AP has quit [Remote host closed the connection]
Ai9zO5AP has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
jcea has quit [Client Quit]
jcea has joined #pypy
jcea has quit [Client Quit]
jcea has joined #pypy