[Ecls-list] Missing thread-related diff :)

Matthew Mondor mm_lists at pulsar-zone.net
Thu Jul 2 17:54:21 UTC 2009


On Thu, 2 Jul 2009 10:37:00 +0200
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:

> Ok, most of this diff has been committed, but first I had to make a
> couple of changes to drop the *_NP attribute names entirely. Now ECL
> is built with _XOPEN_SOURCE = 600 so that under Linux it includes all
> POSIX, XPG and other future extensions, and in particular it defines
> PTHREAD_MUTEX_ERRORCHECK and not just PTHREAD_MUTEX_ERRORCHEC_NP.
> 
> I am now testing builds on Linux and Mac, please report any other
> problems I may have caused with this change.

Thanks, after looking I think the changes are right.

There is an issue on NetBSD where <sys/time.h>'s struct timezone is
only defined if _NETBSD_SOURCE is defined, where in <sys/featuretest.h>
_NETBSD_SOURCE is only defined if _XOPEN_SOURCE is not defined.  This
could however be due to a bug in either the _XOPEN_SOURCE handling or
in <sys/time.h> where the structure definition for timezone should be
moved out of the _NETBSD_SOURCE conditional, and I have started a
thread on this subject on tech-userlevel at netbsd.org mailing list.
For now in ecl.h I #ifdef __NetBSD__ before the _XOPEN_SOURCE
definition locally.

There is an interesting problem where ecl_min locks in an endless loop
when setting up the environment.  A segmentation fault occurs, which is
catched by the signal handler and afterwards the endless loop occurs.
This seems to occur with all versions prior to 8.12.0 where this didn't
occur.  It also only occurs when building with thread support.  I've
not been able to properly analyze it yet, however a prelimininary test
using gdb on a build with suggests this happens when trying to find out
the memory limits:

behemoth$ gdb ./ecl_min
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...
Breakpoint 1 at 0x8092c46: file /home/mmondor/work/ecl-cvs/src/c/num_sfun.d, line 573.
Breakpoint 2 at 0x8080b5b: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 294.
Breakpoint 3 at 0x8080336: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 64.
Breakpoint 4 at 0x8080295: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 52.
Breakpoint 5 at 0x8080717: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 154.
Breakpoint 6 at 0x8080758: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 160.
Breakpoint 7 at 0x80806c1: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 148.
Breakpoint 8 at 0x80808a7: file /home/mmondor/work/ecl-cvs/src/c/error.d, line 204.
Function "error" not defined.
(gdb) run

Program received signal SIGSEGV, Segmentation fault.
0x080e3af7 in GC_find_limit_with_bound (p=0x81045c4 ",# ", up=0, bound=0x0) at /home/mmondor/work/ecl-cvs/src/gc/os_dep.c:926
926                     GC_noop1((word)(*result));
(gdb) bt
#0  0x080e3af7 in GC_find_limit_with_bound (p=0x81045c4 ",# ", up=0, bound=0x0) at /home/mmondor/work/ecl-cvs/src/gc/os_dep.c:926
#1  0x080e3b78 in GC_find_limit (p=0x81045c4 ",# ", up=0) at /home/mmondor/work/ecl-cvs/src/gc/os_dep.c:941
#2  0x080e3824 in GC_init_netbsd_elf () at /home/mmondor/work/ecl-cvs/src/gc/os_dep.c:507
#3  0x080e2584 in GC_init_inner () at /home/mmondor/work/ecl-cvs/src/gc/misc.c:626
#4  0x080e21ee in GC_init () at /home/mmondor/work/ecl-cvs/src/gc/misc.c:412
#5  0x080b2f85 in init_alloc () at /home/mmondor/work/ecl-cvs/src/c/alloc_2.d:348
#6  0x0804dd79 in cl_boot (argc=1, argv=0xbfbfe724) at /home/mmondor/work/ecl-cvs/src/c/main.d:385
#7  0x0804cc0b in main (argc=135239128, args=0xbbbec000) at /home/mmondor/work/ecl-cvs/src/c/cinit.d:109
(gdb) info locals
result = 0x8047f00 <Address 0x8047f00 out of bounds>
(gdb) 

When I have more time I will try to see how 8.12.0 did it and how the
current code differs.

Thanks,
-- 
Matt




More information about the ecl-devel mailing list