[Ecls-list] Latest changes (and thread related topic)

Matthew Mondor mm_lists at pulsar-zone.net
Sat Aug 29 03:59:59 UTC 2009

On Fri, 28 Aug 2009 22:44:05 +0200
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:

>  - The internal functions dealing with bignums have been renamed with the usual
>    prefix "_ecl", and some of them have been turned into macros. Do not use
>    those functions if possible.
>  - A new compiler macro ECL_NO_LEGACY can be defined to remove all deprecated
>    macros and functions. Have a look at the end of src/h/external.h to see
>    what functions are deprecated on each release -- typically they are functions
>    that have been renamed with one of the prefixes, ecl_, cl_, si_,
> ext_ or _ecl.

I couldn't check further if these changes are responsible yet, but
today's ECL CVS HEAD failed to build here:

if test -f ../CROSS-DPP ; then ../CROSS-DPP /home/mmondor/work/ecl-cvs/src/c/cinit.d cinit.c ; else ./dpp /home/mmondor/work/ecl-cvs/src/c/cinit.d cinit.c ; fi
dpp: /home/mmondor/work/ecl-cvs/src/c/cinit.d -> cinit.c
gcc -I. -I/home/mmondor/work/ecl-cvs/build -I/home/mmondor/work/ecl-cvs/src/c -I../ecl/gc -DECL_API -DECL_NO_LEGACY  -g -O2 -fPIC   -Dnetbsd -c -I./ cinit.c -o ../cinit.o
if [ -f CROSS-COMPILER ]; then  touch ecl_min;  else  gcc  -o ecl_min cinit.o c/all_symbols.o -L./ libeclmin.a -leclgmp -leclgc  -lpthread   -lm; fi
libeclmin.a(instance.o): In function `ecl_slot_value_set':
/home/mmondor/work/ecl-cvs/src/c/instance.d:210: undefined reference to `c_string_to_object'
/home/mmondor/work/ecl-cvs/src/c/instance.d:211: undefined reference to `c_string_to_object'
libeclmin.a(instance.o): In function `ecl_slot_value':
/home/mmondor/work/ecl-cvs/src/c/instance.d:203: undefined reference to `c_string_to_object'
libeclmin.a(character.o): In function `cl_character':
/home/mmondor/work/ecl-cvs/src/c/character.d:353: undefined reference to `c_string_to_object'
libeclmin.a(typespec.o): In function `FEtype_error_proper_list':
/home/mmondor/work/ecl-cvs/src/c/typespec.d:57: undefined reference to `c_string_to_object'
libeclmin.a(num_rand.o):/home/mmondor/work/ecl-cvs/src/c/num_rand.d:164: more undefined references to `c_string_to_object' follow
*** Error code 1

make: stopped in /home/mmondor/work/ecl-cvs/build
*** Error code 1

make: stopped in /home/mmondor/work/ecl-cvs

That put aside, the reason I updated the code and was recompiling it
was because of thread related issues (notably, mp:process-kill seemed
not to work).  I noticed the following fix might be necessary:

Index: ./src/c/threads.d
RCS file: /cvsroot/ecls/ecl/src/c/threads.d,v
retrieving revision 1.42
diff -u -p -r1.42 threads.d
--- ./src/c/threads.d   28 Aug 2009 20:35:00 -0000      1.42
+++ ./src/c/threads.d   29 Aug 2009 03:57:31 -0000
@@ -338,7 +338,7 @@ mp_process_enable(cl_object process)
                FEerror("Cannot enable the running process ~A.", 1, process);
         process->process.parent = mp_current_process();
        code = pthread_create(&process->process.thread, &pthreadattr, thread_entry_point, process);
-       output = (process->process.thread = code)? Cnil : process;
+       output = (code != 0 ? Cnil : process);
        @(return output)

Does this also make sense to you?  It seems that process.thread is used
as the pthread_t passed to pthread_kill(3).  process_create(3) returns
0 on success or an error code, and it appears that pthread.thread
was dereferenced to 0 in this case.  I can't confirm this works for me
as I'd have to first look into the build breakage, I might be able to
work further on it this weekend.


More information about the ecl-devel mailing list