cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "the modern world where network packets and compiler optimizations are effectively hostile"
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
harold has joined #pypy
<harold>
hi
<harold>
I have a relatively simple python program (about 500 lines), it uses tkinter and pil. I want to run it on my windows computer
<harold>
I just installed pypy -- pypy2-v5.8.0-win32.zip
<harold>
unzipped it and tried to run my prog and obviously it's missing PIL and stuff. How would I install PIL? I was thinking that pip by default would be installed in this pypy, but it isn't
<harold>
Any hints?
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
yuyichao has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 248 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholm_ has joined #pypy
adamhol__ has joined #pypy
adamhol__ has quit [Remote host closed the connection]
adamhol__ has joined #pypy
adamholmberg has quit [Ping timeout: 252 seconds]
adamholm_ has quit [Ping timeout: 240 seconds]
adamhol__ has quit [Ping timeout: 252 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
tbodt has joined #pypy
adamholmberg has joined #pypy
tbodt has quit [Client Quit]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
marr has quit [Ping timeout: 248 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
tbodt has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
cloudyplain has quit [Read error: Connection reset by peer]
cloudyplain has joined #pypy
<realitix>
Hi arigato ! A developer reported a strange error in my wrapper. When you have a nested struct, if you keep a reference only on the child struct, when the parent struct gets garbage collected, the child struct is filled with bad data. Do you ever heard about that problem ?
<fijal>
realitix: the parent struct does not keep the child struct alive in any way
<fijal>
so you need to keep it alive on your own
<fijal>
if the child struct has no python reference, it'll be garbage collected
<fijal>
(maybe even before parent)
<realitix>
of course but in that case, there is a reference only on the child
<realitix>
if the parent struct is freed, did it free the child struct too ?
<fijal>
no, the C references has no connection to GC at all
<fijal>
just because you store one into the other does not mean there is any link as far as GC is concerned
<realitix>
ok so the developer maybe does something else wrong. Indeed his error was too strange
<realitix>
thanks fijal
<realitix>
fijal: I met a south african guy in the plane, very cool guy! like you ;-)
raynold has quit [Quit: Connection closed for inactivity]
<kenaan>
stevie_92 cpyext-gc-trialdeletion a478bda34d52 /: Added tests Fixed bug in generic_cpy_call if called recursively Fixed bug in cycle detection if...
exarkun has quit [Ping timeout: 240 seconds]
exarkun has joined #pypy
antocuni has quit [Ping timeout: 255 seconds]
ronan has joined #pypy
ssbr has quit [Quit: restarting computer or whatever]
forgottenone has quit [Quit: Konversation terminated!]
<arigato>
the other problem is that the commit you point out changes things about ffi.new(), which you almost don't use in the reproducer
<realitix>
yes indeed, it's why I don't understand
<realitix>
but you can notice that you add tp_free function too
<arigato>
and, well, the 3rd problem is: I need to install Vulkan and SDL2 to reproduce, right?
<realitix>
indeed :)
<arigato>
can I do that on Linux?
<realitix>
it depends on your graphic card
<realitix>
is your computer recent ?
<realitix>
(I do it on linux)
<arigato>
I have an Intel HD Graphics 520, Skylate GT2
<arigato>
Skylake
rokujyouhitoma has quit [Ping timeout: 246 seconds]
<realitix>
yes it works
<arigato>
(and, just saying, I bet from the general style of the reproducer that the problem is rather some misuse of the C API, like the .extent structure is freed by someone)
<realitix>
yes it could be bu it sounds strange
<arigato>
as it's not even *allocated* by cffi, it can't really be something else, except if there is general memory corruption messing things up
vkirilichev has quit [Remote host closed the connection]
vkirilichev has joined #pypy
vkirilichev has quit [Ping timeout: 240 seconds]
<arigato>
should have no effect, because it's the default
<realitix>
ok arigato, don't pass more time on it. I will look deeper to give you more informations
<arigato>
ideally, you should reduce the bug further
<arigato>
e.g. what is self.extent? there are two paths in the get_swap_extent() function
forgottenone has quit [Ping timeout: 240 seconds]
<arigato>
ret = ffi.new(_type.cname + '*', init)[0]
<arigato>
^^^ that's the problem
<arigato>
realitix:
<arigato>
this line is always wrong, because it allocates something with ffi.new(), then gets the [0] item, then forgets the allocated thing---which gets GCed
<realitix>
ok!
<realitix>
but why is it working pre-1.9.1
<realitix>
?
<arigato>
no clue
<arigato>
must be randomly
<realitix>
i can assure you it's not random
<realitix>
are you sure the default value of tp_free is the same
<arigato>
I'm pretty sure the above line is pretty wrong
<realitix>
of course it's wrong
<realitix>
;-)
<arigato>
if you compile a debug version of cffi, it will fail systematically
<realitix>
ha nice to know
<realitix>
ok so I'm going to check it and I close the issue after
<realitix>
au fait, comment se sont passé tes vacances ?
<arigato>
the question of why it works anyway sometimes is not really relevant I think
marr has quit [Ping timeout: 240 seconds]
<kenaan>
arigo cffi/cffi 3d609382a4b8 /doc/source/ref.rst: Write down an explicit example of what not to do
<arigato>
^^^ because you're not the first person making this mistake
<realitix>
Shame on me!
<arigato>
well, the problem is that it seems to work, even though it's accessing just-freed memory
<arigato>
maybe cffi should have a configurable knob that writes 0xDD into freed memory
<realitix>
you have explicitly write it in the doc now so it should be ok