Hi Maciej
The minimal program is as below:
nt 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.
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
The alternative method is we might add a finialze() method to clear all
enviroment, and another thread could initialize again.
On Wed, Sep 9, 2015 at 5:05 AM, Maciej Fijalkowski <[email protected]> wrote:
> do you have a minimal example where it doesn't work? did you try a
> very minimal program?
>
> On Tue, Sep 8, 2015 at 5:00 PM, Yicong Huang <[email protected]> wrote:
> > 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 <[email protected]>
> 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 <[email protected]> wrote:
> >>>
> >>> Hi Yicong,
> >>>
> >>> On Tue, Sep 8, 2015 at 1:57 PM, Yicong Huang <[email protected]>
> >>> 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.
> >>
> >>
> >
> >
> > _______________________________________________
> > pypy-dev mailing list
> > [email protected]
> > https://mail.python.org/mailman/listinfo/pypy-dev
> >
>
_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev