1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-15 10:10:21 +02:00
Commit graph

10798 commits

Author SHA1 Message Date
Neil Jerram
3ed47d2203 Avoid "no duplicate" popen tests leaving zombie processes
On the one hand we want the child process in these tests to exit.  On
the other, we don't want it to exit before the parent Guile code has
tested the relevant condition (EOF in the first test, broken pipe in
the second) - because these conditions would obviously be true if the
child had already exited, and that's not what we're trying to test
here.  We're trying to test getting EOF and broken pipe while the
child process is still alive.

* test-suite/tests/popen.test (open-input-pipe:no duplicate): Add
  another pipe from parent to child, so that the child can finish by
  reading from this.  Then the parent controls the child lifetime by
  writing to this pipe.

* test-suite/tests/popen.test (open-output-pipe:no duplicate): Add
  another pipe from child to parent, and have the child finish by
  endlessly writing into this.  Then the parent controls the child
  lifetime by closing its end of the pipe, causing a broken pipe in
  the child.
2009-05-20 19:05:38 +01:00
Neil Jerram
0310b348a1 Fix explicitely' typos, should be explicitly' 2009-05-20 18:54:23 +01:00
Ludovic Courtès
4a198038b9 Update `NEWS'. 2009-05-12 00:12:18 +02:00
Michael Gran
93c0c75658 Symbols longer than 128 chars can cause an exception. Also, the terminating colon of long postfix keywords are not handled correctly.
* test-suite/tests/reader.test ("read-options"): Add test
	for long postfix keywords.

	* libguile/read.c (scm_read_mixed_case_symbol): Fix
	exception on symbols are greater than 128 chars.  Also,
	colons are not stripped from long postfix keywords.
2009-05-12 00:07:51 +02:00
Ludovic Courtès
1011599792 Better diagnose broken (strftime "%z" ...)' in time.test' (bug #24130).
* test-suite/tests/time.test ("strftime")["C99 %z
  format"](have-strftime-%z): Better diagnose broken "%z" on Tru64 5.1b
  and AIX.  Closes bug #24130.

* NEWS: Update.
2009-05-12 00:01:30 +02:00
Ludovic Courtès
5d8f339fd8 Work around lack of flock(2) declaration on Tru64 5.1b.
* configure.in: Check for the declaration of flock(2).

* libguile/posix.c [!__MINGW32__][!HAVE_DECL_FLOCK]: Provide an flock(2)
  declaration, needed on Tru64 5.1b.
2009-05-11 22:54:45 +02:00
Ludovic Courtès
2b76a65566 Fix compilation of `test-round.c' on BSD.
* test-suite/standalone/test-round.c (HAVE_MACHINE_FPU_H): Include
  <sys/types.h> when available.  This fixes compilation on NetBSD.
  Reported by Greg Toxel.
2009-05-11 22:13:29 +02:00
Ludovic Courtès
cabfe198fd Ask for IEEE floating point behavior on Alpha and SH.
* configure.in (CPPFLAGS): Add `-mieee' or `-ieee' on Alpha and SH.

* libguile/numbers.c (guile_ieee_init): Make sure `-mieee' was passed
  when using GCC on Alpha.

* NEWS: Update.
2009-05-11 22:11:25 +02:00
Ludovic Courtès
e9c9fd3d99 Update `NEWS'. 2009-04-24 00:44:43 +02:00
Ludovic Courtès
b701fcef1d Don't use raw divisions by zero in `test-conversion.c'.
* test-suite/standalone/test-conversion.c (ieee_init): New function.
  (guile_Inf, guile_NaN): New variables.
  (test_from_double, test_to_double): Use them.  Divisions by zero made
  `cc' on Tru64 5.1b ("Compaq C V6.5-011") bail out and led to a
  floating point exception when compiled with GCC on the same platform.
  (main): Call `ieee_init ()'.
2009-04-23 23:20:59 +02:00
Ludovic Courtès
c50764e72e Use <machine/fpu.h> instead of <fenv.h> when needed (e.g., Tru64 5.1b).
* configure.in: Look for <machine/fpu.h>.

* test-suite/standalone/test-round.c: Use <machine/fpu.h> if available.
2009-04-23 22:51:27 +02:00
Ludovic Courtès
fbcc27cfef Work around lack of cuserid(3) declaration on Tru64 5.1b.
* configure.in: Check for a cuserid(3) declaration.

* libguile/posix.c [HAVE_CUSERID][!HAVE_DECL_CUSERID]: Provide a
  declaration.
2009-04-23 22:24:32 +02:00
Ludovic Courtès
d2469ca702 Work around the lack of hstrerror(3) declaration on Tru64.
* configure.in: Look for the declaration of hstrerror(3).

* libguile/net_db.c: Add hstrerror(3) declaration if
  `HAVE_DECL_HSTRERROR' is undefined.
2009-04-23 22:04:05 +02:00
Ludovic Courtès
df2870d385 Fix use of unsetenv(3) on Tru64.
* configure.in: Check for the declaration of unsetenv(3), which Tru64
  5.1b doesn't have.

* libguile/posix.c: Include <stdlib.h> since that's where POSIX says
  unsetenv(3) should reside.
  (scm_putenv): Don't attempt to use unsetenv(3) if its declaration
  isn't available since that wouldn't work well on Tru64.
2009-04-23 22:00:44 +02:00
Ludovic Courtès
5260808c9d Remove extraneous semicolons from `test-conversion.c'.
* test-suite/standalone/test-conversion.c: Remove extraneous semicolon
  following `DEF[SU]TST' invocations since that made Compaq C
  V6.5-011 (`cc' on Tru64 5.1b) bail out.
2009-04-22 23:53:52 +02:00
Ludovic Courtès
ceb6da3f8b Fix compilation of `numbers.c' on Tru64.
* libguile/numbers.c (scm_c_make_polar): Don't use sincos(3) on non-GNU
  platforms.  Reported by Didier Godefroy <ldg@ulysium.net>.
2009-04-21 22:37:45 +02:00
Ludovic Courtès
ecea820468 Fix compilation of `gcc_os_dep.c' on Tru64.
* libguile/gc_os_dep.c [OSF1](_end): Specify the type.
  (scm_get_stack_base): Suitably cast RESULT.  Reported by Didier
  Godefroy <ldg@ulysium.net>.
2009-04-21 22:34:54 +02:00
Ludovic Courtès
7d19c807b1 Update NEWS' and THANKS'. 2009-04-21 22:27:38 +02:00
daniel
5e5b073faa Make `--disable-deprecated' work.
* configure.in (enable_deprecated): Set SCM_WARN_DEPRECATED_DEFAULT
  even when --disable-deprecated is passed.
* libguile/deprecation.h: Declare deprecation-issuing methods even
  if SCM_ENABLE_DEPRECATED is not set.
* libguile/deprecation.c: Ditto.
  (scm_init_deprecation): Include full body even for unset
  SCM_ENABLE_DEPRECATED.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2009-04-21 22:11:48 +02:00
Neil Jerram
3009b5d557 Fix spurious `throw from within critical section' errors
The crux of this problem was that the thread doing a throw, and so
checking scm_i_critical_section_level, was different from the thread
that was in a critical section.

* libguile/async.h (scm_i_critical_section_level): Removed, replaced
  by per-thread critical_section_level.
  (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END): Use
  per-thread critical_section_level.

* libguile/continuations.c (scm_dynthrow): Check per-thread
  critical_section_level.

* libguile/threads.c (guilify_self_1): Init per-thread
  critical_section_level.
  (scm_i_critical_section_level): Removed.

* libguile/threads.h (scm_i_thread): New critical_section_level field.

* libguile/throw.c (scm_ithrow): Check per-thread critical_section_level.
2009-03-25 18:54:34 +00:00
Neil Jerram
ced1987c77 NEWS entry for lock ordering and critical section fixes
(I don't think we need more specific entries than this.)
2009-03-25 18:54:34 +00:00
Neil Jerram
499c43b032 Avoid throw from critical section, given invalid sigaction call
* libguile/scmsigs.c (scm_sigaction_for_thread): Exit critical section
  before raising out-of-range error.

* test-suite/Makefile.am (SCM_TESTS): Add signals.test.

* test-suite/tests/signals.test: New file.
2009-03-25 18:53:12 +00:00
Ludovic Courtès
9a84dc8bbc Aggregate Makefile.am' files under examples/'.
* configure.in: Don't produce `examples/*/Makefile'.

* examples/Makefile.am (SUBDIRS): Remove.
  (EXTRA_DIST, AM_CFLAGS, AM_LIBS): New.
  (box/box, box/box.o, box-module/box, box-module/box.o, libbox.la,
  box-dynamic/box.lo, libbox-module.la, box-dynamic-module/box.lo,
  installcheck, CLEANFILES, clean-local): New targets, aggregated from
  `Makefile.am' files formerly in sub-directories.

* examples/check.test: New file, aggregated from `check.test' files in
  sub-directories.
2009-03-20 21:23:51 +01:00
Ludovic Courtès
8760f4694d Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
* libguile/symbols.c (intern_symbol): New function, with code formerly
  duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
  (scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
  (scm_take_locale_symboln): Use `intern_symbol ()'.  This fixes
  bug #25865.

* test-suite/standalone/Makefile.am
  (test_scm_take_locale_symbol_SOURCES,
  test_scm_take_locale_symbol_CFLAGS,
  test_scm_take_locale_symbol_LDADD): New variables.
  (check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.
2009-03-19 22:19:04 +01:00
Ludovic Courtès
60bdb533b2 Aggregate Makefile.am' files under lang/'.
* lang/Makefile.am (SUBDIRS): Remove.
  (elisp_sources): Aggregate the value of `elisp_SOURCES' formerly found
  in sub-directories' `Makefile.am'.
2009-03-08 22:29:02 +01:00
Ludovic Courtès
30a413ca8b Move `guardians.test' to its own module.
* test-suite/tests/guardians.test: Add `define-module' clause.
2009-03-08 22:29:01 +01:00
Ludovic Courtès
ad2c7c9388 Add new subr invocation benchmarks.
* benchmark-suite/benchmarks/subr.bm (hook1, hook3): New variables.
  ("subr invocation")("generic subr with rest arg", "generic subr with
  rest arg and 3+ parameters"): New benchmarks.
  ("subr application")("generic subr with rest arg", "generic subr with
  rest arg and 3+ parameters"): New benchmarks.
2009-03-08 22:28:41 +01:00
Ludovic Courtès
a85dd41532 Add subr invocation benchmark.
* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `subr.bm'.
2009-03-08 22:24:52 +01:00
Ludovic Courtès
5e07264f04 Add tests for the stack inspection API.
* test-suite/tests/eval.test (stack->frames): New procedure.
  ("stacks"): New test prefix.
2009-03-08 22:24:50 +01:00
Ludovic Courtès
8455a73329 Add new GOOPS tests for built-in types.
* test-suite/tests/goops.test ("classes for built-in types"): New test
  prefix.
2009-03-08 22:24:49 +01:00
Ludovic Courtès
1b131cf160 Add test for `procedure-properties'.
* test-suite/Makefile.am (SCM_TESTS): Add `tests/procprop.test'.
2009-03-08 22:24:47 +01:00
Neil Jerram
2bfcaf2605 Lock ordering: don't allocate when in critical section (scm_sigaction_for_thread)
This fixes the following helgrind report.

Thread #1: lock order "0x4114748 before 0x4331084" violated
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x407A55F: deval (eval.c:4077)
   by 0x407A071: scm_dapply (eval.c:5012)
   by 0x407888A: scm_apply (eval.c:4811)
   by 0x407E20C: scm_call_0 (eval.c:4666)
   by 0x406BDF7: scm_dynamic_wind (dynwind.c:111)
   by 0x407620C: ceval (eval.c:4571)
   by 0x407E8D9: scm_primitive_eval_x (eval.c:5921)
   by 0x407E934: scm_eval_x (eval.c:5956)
   by 0x40B9140: scm_shell (script.c:737)
   by 0x4095AC5: invoke_main_func (init.c:367)
   by 0x4065A81: c_body (continuations.c:349)
  Required order was established by acquisition of lock at 0x4114748
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40B7BE1: scm_sigaction_for_thread (scmsigs.c:339)
   by 0x40911DE: scm_gsubr_apply (gsubr.c:223)
   by 0x4079E36: scm_dapply (eval.c:4930)
   by 0x407AB68: deval (eval.c:4378)
   by 0x407A071: scm_dapply (eval.c:5012)
   by 0x407888A: scm_apply (eval.c:4811)
   by 0x407E1D0: scm_call_1 (eval.c:4672)
   by 0x407FEEE: scm_map (eval.c:5489)
   by 0x407BDCC: deval (eval.c:4367)
   by 0x407D197: deval (eval.c:3698)
   by 0x407A071: scm_dapply (eval.c:5012)
  followed by a later acquisition of lock at 0x4331084
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40DC397: scm_enter_guile (threads.c:377)
   by 0x40DC8F4: scm_pthread_mutex_lock (threads.c:1485)
   by 0x4083FAA: scm_gc_for_newcell (gc.c:484)
   by 0x40A9781: scm_cons (inline.h:115)
   by 0x4079867: scm_dapply (eval.c:4850)
   by 0x407888A: scm_apply (eval.c:4811)
   by 0x40796D6: scm_call_3 (eval.c:4684)
   by 0x409A7C2: module_variable (modules.c:302)
   by 0x409A7EE: module_variable (modules.c:312)
   by 0x409A962: scm_sym2var (modules.c:466)
   by 0x40738F4: scm_lookupcar1 (eval.c:2874)

* libguile/scmsigs.c (close_1): Renamed `handler_to_async'; also
  handle #f case and wrapping the async in a cons, if necessary.

  (install_handler): Pass in async instead of constructing it; combine
  two branches into one.

  (scm_sigaction_for_thread): Allocate async upfront instead of inside
  the critical section, and pass it to install_handler calls.  Leave
  critical section before signaling out-of-range error.
2009-03-05 19:48:41 +00:00
Neil Jerram
58bef38c0a Don't leave Guile mode to lock async_mutex
This fixes lots of helgrind-reported problems, such as:

Thread #1: lock order "0x4325084 before 0x4108928" violated
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40CFD37: scm_enter_guile (threads.c:377)
   by 0x40D0284: scm_pthread_mutex_lock (threads.c:1485)
   by 0x405A736: scm_async_click (async.c:155)
   by 0x406F9EE: deval (eval.c:4080)
   by 0x40761D9: scm_primitive_eval_x (eval.c:5921)
   by 0x40AD20E: install_handler (scmsigs.c:113)
   by 0x40AD402: scm_sigaction_for_thread (scmsigs.c:394)
   by 0x4087D1F: scm_gsubr_apply (gsubr.c:223)
   by 0x406DF55: scm_dapply (eval.c:4930)
   by 0x407147C: deval (eval.c:4378)
   by 0x406E1BD: scm_dapply (eval.c:5012)
  Required order was established by acquisition of lock at 0x4325084
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40CFD37: scm_enter_guile (threads.c:377)
   by 0x408C58B: scm_i_init_guile (init.c:421)
   by 0x40D1873: scm_i_init_thread_for_guile (threads.c:589)
   by 0x40D18B4: scm_i_with_guile_and_parent (threads.c:731)
   by 0x40D19BD: scm_with_guile (threads.c:720)
   by 0x408C42E: scm_boot_guile (init.c:350)
   by 0x8048710: main (guile.c:69)
  followed by a later acquisition of lock at 0x4108928
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40AFD61: scm_make_smob_type (smob.c:294)
   by 0x40AFF19: scm_smob_prehistory (smob.c:512)
   by 0x408C595: scm_i_init_guile (init.c:423)
   by 0x40D1873: scm_i_init_thread_for_guile (threads.c:589)
   by 0x40D18B4: scm_i_with_guile_and_parent (threads.c:731)
   by 0x40D19BD: scm_with_guile (threads.c:720)
   by 0x408C42E: scm_boot_guile (init.c:350)
   by 0x8048710: main (guile.c:69)

* libguile/async.c (scm_async_click): Don't leave Guile mode when
  locking async_mutex.  We don't need to, because none of the code
  that has async_mutex locked can block, and doing so may lead to lock
  ordering problems between async_mutex and a thread's heap_mutex.
2009-03-04 22:20:53 +00:00
Neil Jerram
acb9cffee0 Lock ordering: don't lock heap_mutex and then thread_admin_mutex
This fixes the following helgrind report.

Thread #1: lock order "0x4325084 before 0x4105328" violated
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40D01EA: scm_i_thread_put_to_sleep (threads.c:1622)
   by 0x4078958: scm_make_fluid (fluids.c:114)
   by 0x40778D6: scm_init_feature (feature.c:101)
   by 0x408C62E: scm_i_init_guile (init.c:464)
   by 0x40D1873: scm_i_init_thread_for_guile (threads.c:583)
   by 0x40D18B4: scm_i_with_guile_and_parent (threads.c:725)
   by 0x40D19BD: scm_with_guile (threads.c:714)
   by 0x408C42E: scm_boot_guile (init.c:350)
   by 0x8048710: main (guile.c:69)
  Required order was established by acquisition of lock at 0x4325084
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40CFFA4: guilify_self_1 (threads.c:468)
   by 0x408C58B: scm_i_init_guile (init.c:421)
   by 0x40D1873: scm_i_init_thread_for_guile (threads.c:583)
   by 0x40D18B4: scm_i_with_guile_and_parent (threads.c:725)
   by 0x40D19BD: scm_with_guile (threads.c:714)
   by 0x408C42E: scm_boot_guile (init.c:350)
   by 0x8048710: main (guile.c:69)
  followed by a later acquisition of lock at 0x4105328
   at 0x40234F7: pthread_mutex_lock (hg_intercepts.c:408)
   by 0x40CFFAC: guilify_self_1 (threads.c:470)
   by 0x408C58B: scm_i_init_guile (init.c:421)
   by 0x40D1873: scm_i_init_thread_for_guile (threads.c:583)
   by 0x40D18B4: scm_i_with_guile_and_parent (threads.c:725)
   by 0x40D19BD: scm_with_guile (threads.c:714)
   by 0x408C42E: scm_boot_guile (init.c:350)
   by 0x8048710: main (guile.c:69)

* threads.c (guilify_self_1): Add self to global thread list _before_
  entering Guile mode.
2009-03-04 22:20:52 +00:00
Julian Graham
8fc9367bbd Update SRFI-11 docs to use correct name for let*-values.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2009-02-11 23:33:26 +01:00
Neil Jerram
f8d8007275 Allow @ to work with (ice-9 syncase)
(Reported by Panicz Maciej Godek.)

* test-suite/tests/syncase.test ("@ works with syncase"): New test.

* ice-9/syncase.scm (guile-macro): When a Guile macro transformer
  produces a variable, don't pass it through sc-expand.
2009-02-05 22:13:19 +00:00
Neil Jerram
a24f4637ea Fix build when compiled with -Wundef -Werror
(Reported by David Fang)

* libguile/inline.h: Check if __APPLE_CC__ is defined before testing
  its value.
2009-02-05 22:13:17 +00:00
Andy Wingo
1e1bffb4e7 cleanups to value and help help handlers
* ice-9/session.scm (*value-help-handlers*): Define object-documentation
  as the default value help handler.
  (remove-value-help-handler!, add-name-help-handler!)
  (remove-name-help-handler!): Fix docs.
  (help, help-doc): Fix so that we try object-documentation through
  try-value-help, and we obey the docs regarding what happens with return
  values.
2009-01-28 12:12:32 +01:00
Andy Wingo
8b8b599694 merge in from guile-lib: add some extensibility to `help'
* ice-9/session.scm (add-value-help-handler!)
  (remove-value-help-handler!, add-name-help-handler!)
  (remove-name-help-handler!): New public interfaces, to allow some basic
  extensibility of the help interface. Merged in from guile-lib's (scheme
  session).
2009-01-28 12:12:29 +01:00
Neil Jerram
94922b177b Fix build when scm_t_timespec is different from struct timespec
Reported by Roland Haeder.  The declaration and definition of
scm_pthread_cond_timedwait were using possibly different types for the
third arg.

* THANKS: Added Roland Haeder.

* libguile/threads.h (scm_pthread_cond_timedwait): Use scm_t_timespec
  for third arg rather than struct timespec, for consistency with the
  function implementation.
2009-01-23 01:27:20 +00:00
Neil Jerram
d681856755 Fix MinGW HAVE_STRUCT_TIMESPEC build problem
Reported by Carlo Bramini.  See the comment in _scm.h.

* THANKS: Add Carlo Bramini.

* libguile/_scm.h: Undefine HAVE_STRUCT_TIMESPEC.
2009-01-23 01:02:46 +00:00
Neil Jerram
e4c39847a2 Remove `INSTALL'
* INSTALL: Removed.
2009-01-17 22:38:15 +00:00
Neil Jerram
f9c780db97 NEWS entry for %fast-slot-ref/set! fix 2009-01-04 22:45:54 +00:00
Neil Jerram
53a79cd060 Fix implementation of %fast-slot-ref and %fast-slot-set!
* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
  Correct incantation for getting the number of slots of the specified
  instance.

* libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong).

* test-suite/standalone/test-fast-slot-ref.in: New standalone test.

* configure.in: Generate test-suite/standalone/test-fast-slot-ref.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  test-fast-slot-ref.
2009-01-04 22:41:51 +00:00
Ludovic Courtès
d1fae96472 Update/remove references to the CVS repository. 2009-01-01 23:55:46 +00:00
Han-Wen Nienhuys
04810630ab * HACKING: update to current practice
* Drop CVS references.

  * Ask for Git based patches.

  * Drop outdated info (EGCS, SCM_P)
2009-01-01 23:46:21 +00:00
Ludovic Courtès
2f5df78cba Fix typo in SRFI-19.
* srfi/srfi-19.scm (priv:string->date): Check for EOF on CH, not PORT.
2008-12-22 16:25:21 +01:00
Ludovic Courtès
b09fad7fa5 Update `INSTALL', from Automake 1.10.2. 2008-12-18 22:48:49 +01:00
Ludovic Courtès
a97cd69632 Don't use deprecated functions in `debug-malloc.c'.
* libguile/debug-malloc.c (scm_malloc_stats): Use
  `scm_from_locale_string ()'.  Patch by Linas Vepstas
  <linasvepstas@gmail.com>.
2008-12-18 22:48:45 +01:00
Neil Jerram
bba579611b Update autogen.sh
* autogen.sh: Don't call guile-readline/autogen.sh; not needed because
  autoreconf recurses itself.  Remove copies of config.guess and
  config.sub, which are now invalid because we don't have those files
  in the top level directory.  Remove mention of
  --enable-maintainer-mode, as we don't use AM_MAINTAINER_MODE any
  more.
2008-12-14 14:42:08 +00:00