[Ecls-list] cl_boot() segfaults when called not in the main thread

Kamil Shakirov kamils80 at gmail.com
Tue Jul 14 16:16:30 UTC 2009


Hi Juan,

Thanks a lot for your help. I did as you suggested but it still
segfaults getting SIGTTOU signal. import.c from 'examples/threads'
directory also segfaults with the following backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fd0c1721950 (LWP 8117)]
ecl_alloc_object (t=t_process) at /home/kamil/temp/ecl/src/c/alloc_2.d:195
195			ecl_disable_interrupts_env(the_env);
(gdb) bt
#0  ecl_alloc_object (t=t_process) at /home/kamil/temp/ecl/src/c/alloc_2.d:195
#1  0x00007fd0c24b2423 in alloc_process (name=0x1,
initial_bindings=0x0) at /home/kamil/temp/ecl/src/c/threads.d:189
#2  0x00007fd0c24b2863 in ecl_import_current_thread (name=0x1,
bindings=0x1) at /home/kamil/temp/ecl/src/c/threads.d:227
#3  0x00000000004009ef in thread_entry_point (data=0x1d161b1) at import.c:62
#4  0x00007fd0c24dc7ef in GC_inner_start_routine (sb=<value optimized
out>, arg=<value optimized out>)
    at /home/kamil/temp/ecl/src/gc/pthread_support.c:1073
#5  0x00007fd0c24d8345 in GC_call_with_stack_base (fn=0x7fd0c2509d64,
arg=0x0) at /home/kamil/temp/ecl/src/gc/misc.c:1167
#6  0x00007fd0c213c3ba in start_thread () from /lib/libpthread.so.0
#7  0x00007fd0c1a1ffcd in clone () from /lib/libc.so.6
#8  0x0000000000000000 in ?? ()


On Tue, Jul 14, 2009 at 5:17 PM, Juan Jose
Garcia-Ripoll<juanjose.garciaripoll at googlemail.com> wrote:
> cl_boot() can only be used _once_ and it only has to be used once: it
> simply allocates the resources for ECL, registering symbols,
> functions, etc.
>
> If you need to run Common Lisp code in other threads, use
>
> extern ECL_API void ecl_import_current_thread(cl_object process_name,
> cl_object process_binding);
> extern ECL_API void ecl_release_current_thread(void);
>
> to register/release the currently running thread with ECL. You only
> need to release the thread when it is going to be destroyed, not on
> every use.
>
> Juanjo
>
> On Tue, Jul 14, 2009 at 11:33 AM, Kamil Shakirov<kamils80 at gmail.com> wrote:
>> Hi,
>>
>> Is that possible to boot/use embedded ECL not in the main thread? My
>> application uses plugins (shared libraries) that are loaded on demand.
>> Each plugin starts its own thread to serve requests from the main
>> application. cl_boot() segfaults when called from the created plugin's
>> thread (there is only one plugin that uses ECL)
>
> --
> Instituto de Física Fundamental, CSIC
> c/ Serrano, 113b, Madrid 28006 (Spain)
> http://juanjose.garciaripoll.googlepages.com
>



-- 
--kamil




More information about the ecl-devel mailing list