[pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

Yicong Huang hengha.mao at gmail.com
Tue Sep 8 17:00:36 CEST 2015


With gdb debug, it blocked at this stack:

#0  0x0000003fea40b1c0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1  0x00007ffff6369305 in RPyGilAcquire () from .//../dist/libpypy-c.so
#2  0x00007ffff55bb8ed in pypy_g_pypy_execute_source_ptr () from
.//../dist/libpypy-c.so
#3  0x00007ffff53a8f42 in pypy_execute_source_ptr () from
.//../dist/libpypy-c.so
#4  0x00007ffff53a8d82 in pypy_execute_source () from
.//../dist/libpypy-c.so
#5  0x0000000000400b2e in main () at udf_call_test.c:84


On Tue, Sep 8, 2015 at 10:10 PM, Yicong Huang <hengha.mao at gmail.com> wrote:

> Hi Armin,
>
> Sorry for I didn't describe the problem clearly.
> The issue is well reproducible with the belolw simple piece of the code:
>
> #include ...
>
> int main()
> {
>  rpython_startup_code();
>  pypy_init_threads();
>  pypy_setup_home(...);
>  pypy_execute_source_ptr("print \'hello\'");
> }
>
> It hangs in pypy_execute_source().
> And if we remove "pypy_init_threads()", the code works.
>
> On Tue, Sep 8, 2015 at 9:19 PM, Armin Rigo <arigo at tunes.org> wrote:
>
>> Hi Yicong,
>>
>> On Tue, Sep 8, 2015 at 1:57 PM, Yicong Huang <hengha.mao at gmail.com>
>> wrote:
>> > I tried the following in one thread, and it hang in
>> > pypy_execute_source_ptr().
>> > *     rpython_startup_code();
>> > *     pypy_init_threads();
>> > *     pypy_setup_home(...)
>> > *     pypy_execute_source_ptr()
>>
>> I meant "do whatever you did so far here".  I can't debug a new
>> problem you get if I only know "it hangs"...
>>
>>
>> A bientôt,
>>
>> Armin.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150908/caf613f5/attachment.html>


More information about the pypy-dev mailing list