sbcl.git
15 years ago1.0.25.49: x86/x86-64 unithread: use the allocated alien stack
Gabor Melis [Mon, 16 Feb 2009 22:22:23 +0000 (22:22 +0000)]
1.0.25.49: x86/x86-64 unithread: use the allocated alien stack

... in struct thread and not the original control stack that we switch
away from in call_into_lisp_first_time.

15 years ago1.0.25.48: signals internals doc
Gabor Melis [Mon, 16 Feb 2009 22:20:39 +0000 (22:20 +0000)]
1.0.25.48: signals internals doc

15 years ago1.0.25.47: OOAO restoring fp control word
Gabor Melis [Mon, 16 Feb 2009 22:20:16 +0000 (22:20 +0000)]
1.0.25.47: OOAO restoring fp control word

Do it in all signal handlers, no matter what, on platforms that
require it.

15 years ago1.0.25.46: restore errno in signal handlers
Gabor Melis [Mon, 16 Feb 2009 22:19:27 +0000 (22:19 +0000)]
1.0.25.46: restore errno in signal handlers

15 years ago1.0.25.45: fix futex_wait deadlines when interrupted
Gabor Melis [Mon, 16 Feb 2009 22:17:56 +0000 (22:17 +0000)]
1.0.25.45: fix futex_wait deadlines when interrupted

When the syscall returned with EINTR futex_wait called again with the
same timeout. Now it lets Lisp recalculate the relative timeout from
the deadline.

15 years ago1.0.25.44: INTERRUPT-THREAD and timer improvements
Gabor Melis [Mon, 16 Feb 2009 22:16:20 +0000 (22:16 +0000)]
1.0.25.44: INTERRUPT-THREAD and timer improvements

The main thing accomplished by this commit is that it's finally
possible to use INTERRUPT-THREAD and TIMERS sanely:

- there is a per thread interruption queue, interruption are executed
  in order of arrival

- the interruption has to explicitly enable interrupts with
  WITH-INTERRUPTS if needed. In the absence of WITH-INTERRUPTS the
  interruption itself is not interrupted and running out of stack is
  not a problem.

- timers have an improved repeat mechanism

Implementation notes:

- INTERRUPT-THREAD is implemented on all platforms and builds (that
  is, even without :SB-THREAD) by sending a signal to the current
  thread (or process without thread). This allows us to hook into the
  normal, interrupt deferral mechanism without having to commit OAOO
  violations on the Lisp side. And it makes threaded, non-threaded
  builds closer, hopefully easing testing.

- SIG_INTERRUPT_THREAD is SIGPIPE on all platforms. SIGPIPE is not
  used in SBCL for its original purpose, instead it's for signalling a
  thread that it should look at its interruption queue. The handler
  (RUN_INTERRUPTION) just returns if there is nothing to do so it's
  safe to receive spurious SIGPIPEs coming from the kernel.

- IN-INTERRUPTION does not unblock deferrables anymore, but arranges
  for them to be unblocked when interrupts are enabled (see
  *UNBLOCK-DEFERRABLES-ON-ENABLING-INTERRUPTS-P*).

- Thread interruption run wrapped in a (WITHOUT-INTERRUPTS
  (ALLOW-WITH-INTERRUPTS ...)).

- Repeating timers reschedule themselves when they finished to the
  current expiry time + repeat interval even if that's in the past.
  Hence, a timer's schedule does not get shifted if it takes a long
  time to run. If it takes more time than the repeat interval then it
  may catch up on later invokations.

- Timers run wrapped in a (WITHOUT-INTERRUPTS (ALLOW-WITH-INTERRUPTS
  ...)) even in run in a new thread.

- Enable previously failing tests.

- Add more tests.

- Automatically unschedule repeating timers if they take up all the
  CPU.

15 years ago1.0.25.43: alpha interrupt context fixes
Gabor Melis [Mon, 16 Feb 2009 22:12:36 +0000 (22:12 +0000)]
1.0.25.43: alpha interrupt context fixes

- interrupt contexts pointers are 64 bit

- add padding to DEFINE-PRIMITIVE-OBJECT THREAD, because the C
  compiler aligns interrupt_contexts on a double word boundary

15 years ago1.0.25.42: make os_thread 0 on unithread builds
Gabor Melis [Mon, 16 Feb 2009 22:08:38 +0000 (22:08 +0000)]
1.0.25.42: make os_thread 0 on unithread builds

... because storing the pid there (two places really, thread.os_thread
and THREAD-OS-THREAD) complicates SB-POSIX:FORK, and makes a simple
fork() lose.

15 years ago1.0.25.41: only call pthread_kill with valid thread ids
Gabor Melis [Mon, 16 Feb 2009 22:07:55 +0000 (22:07 +0000)]
1.0.25.41: only call pthread_kill with valid thread ids

... else it segfaults (at least on Linux). Fixes sporadic "Unhandled
memory fault" running timer, INTERRUPT-THREAD heavy code. And block
signals while calling pthread_kill because it is not async signal
safe.

15 years ago1.0.25.40: fix JOIN-THREAD
Gabor Melis [Mon, 16 Feb 2009 22:05:45 +0000 (22:05 +0000)]
1.0.25.40: fix JOIN-THREAD

If the thread has not returned normally signal the error when not
holding the mutex anymore. Disable interrupt for the duration of
holding the mutex. Fix test.

15 years ago1.0.25.39: thread start/stop fixes
Gabor Melis [Mon, 16 Feb 2009 22:04:26 +0000 (22:04 +0000)]
1.0.25.39: thread start/stop fixes

- disable interrupts during create_thread

  ... to protect against signals (async unwinds, reentrancy, ...)
  during malloc, pthread code and to make the pinning of
  INITIAL-FUNCTION effective. Also add checks to
  new_thread_trampoline.

- make-thread: assert gc enabled (to prevent deadlocks)

- block blockables while holding LOCK_CREATE_THREAD lock

- make dying threads safe from interrupts

15 years ago1.0.25.38: fix maybe_gc
Gabor Melis [Mon, 16 Feb 2009 22:01:45 +0000 (22:01 +0000)]
1.0.25.38: fix maybe_gc

15 years ago1.0.25.37: block deferrables when gc pending in PA
Gabor Melis [Mon, 16 Feb 2009 22:01:15 +0000 (22:01 +0000)]
1.0.25.37: block deferrables when gc pending in PA

Consider this:

  set_pseudo_atomic_atomic()
  alloc and set pseudo_atomic_interrupted and GC_PENDING
  clear_pseudo_atomic_atomic()
  if (get_pseudo_atomic_interrupted())
    gc();

If an async interrupt happens and unwinds between
clear_pseudo_atomic_atomic and gc() we have lost a gc trigger until
the next alloc. Same with SIG_STOP_FOR_GC instead of alloc.

This patch addresses the above problem by blocking deferrables when a
gc is requested in a pseudo atomic section. On exit from the protected
section there is no race because no async unwinding interrupts can
happen.

15 years ago1.0.25.36: unblock signals on low level errors
Gabor Melis [Mon, 16 Feb 2009 21:56:20 +0000 (21:56 +0000)]
1.0.25.36: unblock signals on low level errors

Low level errors (control stack exhausted, memory fault) may trigger
at inconvenient times such as in signal handlers still running with
deferrables blocked. Due to the condition handling mechanism this
leads to executing user code at unsafe places and the image may very
well become corrupted. To allow continuing anyway with fingers crossed
to diagnose the problem, deferrable and/or gc signals are unblocked
before arranging for returning to the Lisp function that signals the
appropriate condition. Before that is done, however, a warning is
fprintf'ed to stderr to that this important piece of information is
not lost in some generic condition handler (or in a interrupt handler
async unwinding before anyone gets a chance to handle the condition)
which makes diagnosis of subsequent problems very hard.

This was brought to light by the checks added in the previous commit.

15 years ago1.0.25.35: check that gc signals are unblocked
Gabor Melis [Mon, 16 Feb 2009 21:54:06 +0000 (21:54 +0000)]
1.0.25.35: check that gc signals are unblocked

... when alloc() is called and when calling into Lisp.

15 years ago1.0.25.34: gc trigger improvements
Gabor Melis [Mon, 16 Feb 2009 21:53:25 +0000 (21:53 +0000)]
1.0.25.34: gc trigger improvements

- Make sure that gc never runs user code (after gc hooks and
  finalizers) if interrupts are disabled and they cannot be enabled
  (i.e. *ALLOW-WITH-INTERRUPTS* is NIL).

- clean up maybe_gc: we know that in the interrupted context gc
  signals are unblocked (see "check that gc signals are unblocked"
  commit) so it's safe to simply enable them and call SUB-GC

15 years ago1.0.25.33: protect against recursive gcs
Gabor Melis [Mon, 16 Feb 2009 21:52:04 +0000 (21:52 +0000)]
1.0.25.33: protect against recursive gcs

... while holding the *already-in-gc* lock instead of allowing gc to
trigger and then punting.

15 years ago1.0.25.32: improvements to WITHOUT-GCING
Gabor Melis [Mon, 16 Feb 2009 21:49:30 +0000 (21:49 +0000)]
1.0.25.32: improvements to WITHOUT-GCING

- implement it with only one UNWIND-PROTECT (about 30% faster)
- add *IN-WITHOUT-GCING*
- in maybe_defer_handler defer interrupts if we are in the racy part
  of WITHOUT-GCING, that is with interrupts enabled, gc allowed but
  still *IN-WITHOUT-GCING*
- check more invariants

15 years ago1.0.25.31: axe GC-{ON,OFF}
Gabor Melis [Mon, 16 Feb 2009 21:48:20 +0000 (21:48 +0000)]
1.0.25.31: axe GC-{ON,OFF}

... because they are broken, nobody uses them (?), and complicated to
fix.

Rationale:

- There is no way to safely allow gc in a WITHOUT-GCING without making
it entirely useless (nothing like the interrupt protocol with
ALLOW-WITH-INTERRUPTS).

- WITHOUT-GCING implies WITHOUT-INTERRUPTS because interrupts running
with gc disabled may lead to deadlocks (see internals manual on lock
ordering and WITHOUT-GCING) or running out of memory. To adhere to
this contract GC-{ON,OFF} would need to enable/disable interrupts by
setting *INTERRUPTS-ENABLED*, comlicated business for little gain.

15 years ago1.0.25.30: INTERRUPT-THREAD without RT signals
Gabor Melis [Mon, 16 Feb 2009 21:45:22 +0000 (21:45 +0000)]
1.0.25.30: INTERRUPT-THREAD without RT signals

All non-win32 platforms converted to use normal signals
(SIGINFO/SIGPWR) to implement INTERRUPT-THREAD.

Remove mention of RT signals from the internals manual.

15 years ago1.0.25.29: thread state visibility and synchronization
Gabor Melis [Mon, 16 Feb 2009 21:44:11 +0000 (21:44 +0000)]
1.0.25.29: thread state visibility and synchronization

C does not guarantee that changes made to a volatile variable in one
thread are visibile to other threads. Use locking primitives (that
have memory barrier semantics) for that purpose.

Thus, all_threads need not be volatile: it's always accessed while
holding all_threads_lock. Thread state does not need volatile either,
as signal a handlers don't change it (save for sig_stop_for_gc_handler
but that sets it restores its value). But visibility issues can arise
and potentially deadlock in stop_the_world, so the thread state is
given a lock. And to reduce busy looping while waiting for the state
to change to STATE_SUSPENDED a condition variable is added as well.

Also convert sig_stop_for_gc_handler to use
wait_for_thread_state_change which frees up SIG_RESUME_FROM_GC. I
think this also guarantees that the changes made by the gc are visible
in other threads on non x86 platforms (on x86 it's already the case).

With these changes threads.impure.lisp runs 10% a faster in real time.

15 years ago1.0.25.28: always use SIG_RESUME_FROM_GC
Gabor Melis [Mon, 16 Feb 2009 21:42:05 +0000 (21:42 +0000)]
1.0.25.28: always use SIG_RESUME_FROM_GC

The other mechanism relied on real time signals which made it freeze
when the sysystem wide real time signal queue got full on Linux. A
full queue spells trouble for other processes using rt signals.

All platforms are changed to use SIGUSR1 and SIGUSR2 for
SIG_STOP_FOR_GC and SIG_RESUME_FROM_GC.

Check that SIG_RESUME_FROM_GC is never signalled without a
corresponding sigwait.

15 years ago1.0.25.27: codify interrupt handling invariants
Gabor Melis [Mon, 16 Feb 2009 21:41:08 +0000 (21:41 +0000)]
1.0.25.27: codify interrupt handling invariants

15 years ago1.0.25.26: less interrupt handling leftovers
Gabor Melis [Mon, 16 Feb 2009 21:39:59 +0000 (21:39 +0000)]
1.0.25.26: less interrupt handling leftovers

- less clear_pseudo_atomic_interrupted

  Remove it from the beginning of the protected sections in the
  runtime to match what we do in Lisp.

- less resetting of signal mask

  Don't call reset-signal-mask from the toplevel, I don't think it's
  useful anymore and quite likely it was never more than duct tape.

  Even when unmasking of signals is called for (in
  INVOKE-INTERRUPTION), only unblock the deferrable ones: gc signals
  are unblocked in Lisp anyway.

- removed unneeded sigemptyset on pending mask

- move MIPS SIGTRAP workaround to the runtime

15 years ago1.0.25.25: sig_stop_for_gc_handler looks at GC_INHIBIT first
Gabor Melis [Mon, 16 Feb 2009 21:39:08 +0000 (21:39 +0000)]
1.0.25.25: sig_stop_for_gc_handler looks at GC_INHIBIT first

... else we'd trap on every single pseudo atomic until gc is finally
allowed.

15 years ago1.0.25.24: x86/x86-64 runtime pseudo atomic fixes
Gabor Melis [Mon, 16 Feb 2009 21:38:43 +0000 (21:38 +0000)]
1.0.25.24: x86/x86-64 runtime pseudo atomic fixes

Make sure that {clear,set}_pseudo_atomic_{atomic,interrupted} boil
down to a single assembly intruction. And that the compiler does not
reorder them.

I think the ppc bits in pseudo-atomic.h are still broken on both
accounts.

15 years ago1.0.25.23: more allocation checks
Gabor Melis [Mon, 16 Feb 2009 21:37:34 +0000 (21:37 +0000)]
1.0.25.23: more allocation checks

- in gencgc alloc() check that we are in pseudo atomic
- assert that interrupt_handle_pending does not happen in pseudo atomic
- assert that cheneygc pa_alloc() runs with deferrable signals blocked
- add test code to trigger gc from pa_alloc to help testing how the
  runtime deals with such rare events

15 years ago1.0.25.22: SIGTERM and SIGABRT
Gabor Melis [Mon, 16 Feb 2009 21:36:46 +0000 (21:36 +0000)]
1.0.25.22: SIGTERM and SIGABRT

- add SIGTERM to deferrables, because it has a Lisp handler and it
  cannot run in some contexts (on the alt stack, gc signals blocked,
  ...)

- move SIGABRT/SIGIOT handling to C to abort without possibly
  triggering Lisp errors due to the same problems as in the previous
  point

15 years ago1.0.25.21: handling of potential corruptions
Gabor Melis [Mon, 16 Feb 2009 21:36:13 +0000 (21:36 +0000)]
1.0.25.21: handling of potential corruptions

- add corruption_warning_and_maybe_lose that prints a warning and
  loses depending on lose_on_corruption_p (false by default)
- use corruption_warning_and_maybe_lose when the control stack is
  exhausted and on memory faults
- use corruption_warning_and_maybe_lose on the lisp handlers of
  SIGILL, SIGBUS and SIGEMT, as invoking them is surely not a good
  sign.
- add --lose-on-corruption as a runtime option
- add --disable-ldb as a runtime option
- update the man page and the user manual
- HEAP-EXHAUSTED fixes:
  - exit pseduo atomic properly and do pending interrupt if needed
  - signalling HEAP-EXHAUSTED in a WITHOUT-INTERRUPTS is dangerous
- use --lose-on-corruption in make-target*.sh

Also, block blockable signals on lose() to prevent other threads,
timers and such from interfering. If only all threads could be stopped
somehow.

15 years ago1.0.25.20: test util: print names, status
Gabor Melis [Mon, 16 Feb 2009 21:32:58 +0000 (21:32 +0000)]
1.0.25.20: test util: print names, status

15 years ago1.0.25.19: small test fixes
Gabor Melis [Mon, 16 Feb 2009 21:32:24 +0000 (21:32 +0000)]
1.0.25.19: small test fixes

- mop-6 test: use keywords in test name

  ... because symbols from the mop-6 package cannot read later from
  the file containing test results.

- fix gc deadlock test

  Instead of with-all-threads-lock, it was using with-mutex that
  enables interrupts.

15 years ago1.0.25.18: it's only SHOW
Gabor Melis [Mon, 16 Feb 2009 21:31:32 +0000 (21:31 +0000)]
1.0.25.18: it's only SHOW

- fix compilation with QSHOW

- SHOW prints thread id on threaded builds

- SHOWing os_threads

  - do not print pthread_self() that's the job of SHOW
  - always print thread ids with %lu
  - states with %x

- add more SHOW to ease debugging

- gc_stop_the_world: don't flood with FSHOW_SIGNAL when waiting for
  another thread to change states

- signal safe SHOW

  (if QSHOW_SAFE is defined)

15 years ago1.0.25.17: kill runtime warnings
Gabor Melis [Mon, 16 Feb 2009 21:29:41 +0000 (21:29 +0000)]
1.0.25.17: kill runtime warnings

15 years ago1.0.25.16: minor stylistics changes in the runtime
Gabor Melis [Mon, 16 Feb 2009 21:28:24 +0000 (21:28 +0000)]
1.0.25.16: minor stylistics changes in the runtime

15 years ago1.0.25.15: less compilation warnings
Gabor Melis [Mon, 16 Feb 2009 21:27:26 +0000 (21:27 +0000)]
1.0.25.15: less compilation warnings

15 years ago1.0.25.14: comments
Gabor Melis [Mon, 16 Feb 2009 21:25:44 +0000 (21:25 +0000)]
1.0.25.14: comments

15 years ago1.0.25.13: 80 chars, trailing space
Gabor Melis [Mon, 16 Feb 2009 21:18:36 +0000 (21:18 +0000)]
1.0.25.13: 80 chars, trailing space

15 years ago1.0.25.12: fix debugger on non-x86oids
Gabor Melis [Wed, 11 Feb 2009 13:56:26 +0000 (13:56 +0000)]
1.0.25.12: fix debugger on non-x86oids

  (regression from 1.0.25.9 that broke TOP-FRAME)

15 years ago1.0.25.11: Remove unused SIZE slot from catch-block structure.
Alastair Bridgewater [Wed, 11 Feb 2009 12:46:19 +0000 (12:46 +0000)]
1.0.25.11: Remove unused SIZE slot from catch-block structure.

15 years ago1.0.25.10: Commit version.lisp-expr, missed in last commit. (Oops.)
Richard M Kreuter [Thu, 5 Feb 2009 23:03:36 +0000 (23:03 +0000)]
1.0.25.10: Commit version.lisp-expr, missed in last commit. (Oops.)

15 years ago1.0.25.10: Fix package locks checks for local functions in the interpeter.
Richard M Kreuter [Thu, 5 Feb 2009 18:27:31 +0000 (18:27 +0000)]
1.0.25.10: Fix package locks checks for local functions in the interpeter.

* Package lock checks were being performed in the function binding form's
  body's lexical environment, causing lossage for forms like

  (locally (declare (disable-package-locks foo:bar))
    (flet ((foo:bar ...))
      (declare (enable-package-locks foo:bar))
      ...))

  In particular, this broke some TRACE extensions.

15 years ago1.0.25.9: INVOKE-WITH-SAVED-FP-AND-PC changes
Gabor Melis [Thu, 5 Feb 2009 09:56:46 +0000 (09:56 +0000)]
1.0.25.9: INVOKE-WITH-SAVED-FP-AND-PC changes

On x86/x86-64 we stash away the fp and the pc when calling an alien
function in order to allow the debugger to get back at the lisp frames
even if the alien frames confuse the frame parsing heuristics.

This commit optimizes INVOKE-WITH-SAVED-FP-AND-PC to cancel much of
the slowdown caused by 1.0.21.32 and it makes its use conditional on
(<= speed debug).

15 years ago1.0.25.8: fix sxhash bug
Gabor Melis [Wed, 4 Feb 2009 14:10:22 +0000 (14:10 +0000)]
1.0.25.8: fix sxhash bug

... brought to light by 1.0.20.27. Declare hashes to be of type HASH
(not INDEX).

Note that INDEX still is used to mean different things:

- a valid index: (integer 0 (array-dimension-limit))

- a "bound" such as the :START arguments: (integer 0 array-dimension-limit)

- a "dimension" as in (make-array 10): (integer 0 array-dimension-limit)

which leads to all kinds of nastiness with array near the limit.

15 years ago1.0.25.7: Muffle style-warnings around lambda list parsing in the interpeter.
Richard M Kreuter [Tue, 3 Feb 2009 20:22:04 +0000 (20:22 +0000)]
1.0.25.7: Muffle style-warnings around lambda list parsing in the interpeter.

15 years ago1.0.25.6: Reunite x86oid and non-x86oid sub-{access,set}-debug-var-slot
Alastair Bridgewater [Tue, 3 Feb 2009 04:27:08 +0000 (04:27 +0000)]
1.0.25.6: Reunite x86oid and non-x86oid sub-{access,set}-debug-var-slot

Merged the x86oid and non-x86oid versions of sub-access-debug-var-slot
and sub-set-debug-var-slot, reducing the size of debug-int.lisp but
arguably making the conditionalization worse.

15 years ago1.0.25.5: genesis descriptor-intuit-gspace cleanups
Alastair Bridgewater [Tue, 3 Feb 2009 04:17:47 +0000 (04:17 +0000)]
1.0.25.5: genesis descriptor-intuit-gspace cleanups

Minor refactoring and major commentary updates to
descriptor-intuit-gspace.

15 years ago1.0.25.4: genesis load-time-value cleanup
Alastair Bridgewater [Tue, 3 Feb 2009 04:16:23 +0000 (04:16 +0000)]
1.0.25.4: genesis load-time-value cleanup

  * Added a :load-time-value pseudo-gspace for use by descriptors
    created by fop-funcall instead of the existing (undocumented)
    scheme of using a null gspace and a not-null offset within a gspace
    to indicate such descriptors.

  * Fixed up some comments.

15 years ago1.0.25.3: earlier x86 code-object fixup envectorization
Alastair Bridgewater [Tue, 3 Feb 2009 04:15:13 +0000 (04:15 +0000)]
1.0.25.3: earlier x86 code-object fixup envectorization

In order to be able to relocate code-objects, the x86 port has to keep
track of the locations of certain fixups within the objects (these
fixups being relative fixups pointing to addresses outside the
code-object and absolute fixups pointing to addresses within the
code-object).  Since time immemorial, the build process involved having
genesis dump a record of each fixup to be recorded as a cold-toplevel,
and cold-init passing such cold-toplevel information to
!envector-load-time-code-fixup.

  * Change genesis to create fixup-vectors directly, instead of dumping
    the fixup information as cold-toplevels.

  * Strip out the (now dead) code for envectoring cold-toplevels during
    cold-init.

15 years ago1.0.25.2: Eliminate untagged pointers to heap space in cold-init
Alastair Bridgewater [Tue, 3 Feb 2009 04:13:13 +0000 (04:13 +0000)]
1.0.25.2: Eliminate untagged pointers to heap space in cold-init

Load-time value fixups encountered by genesis are added as a kind of
toplevel form to be patched during cold-init.  The reference to the
location to fix up was being dumped as a SAP pointing to the correct
point in heap space.  Instead of dumping a SAP, we now dump the
containing object and an offset within the object, thus removing one
obstacle to running the GC or doing other heap-space relocation prior
to running the cold-toplevels.

15 years ago1.0.25.1: x86-64 code fixup recording for gc / slash-and-burn
Alastair Bridgewater [Tue, 3 Feb 2009 04:11:05 +0000 (04:11 +0000)]
1.0.25.1: x86-64 code fixup recording for gc / slash-and-burn

x86-64 code segments do not have absolute references to within
themselves, nor do they have relative references to without themselves,
making them relocatable without patching.  The GC has long since been
updated to reflect this, but the fixup recording code originally part
of the x86 port had been retained.

  * Removed x86-64 code-object fixup recording code everywhere.

  * Added some commentary to x86iod fixup handling in genesis.

15 years ago1.0.25: release, will be tagged as sbcl_1_0_25
Juho Snellman [Tue, 3 Feb 2009 02:49:12 +0000 (02:49 +0000)]
1.0.25: release, will be tagged as sbcl_1_0_25

15 years ago1.0.24.48: Do explicit sign-extension of small signed alien return values
Juho Snellman [Mon, 26 Jan 2009 01:54:47 +0000 (01:54 +0000)]
1.0.24.48: Do explicit sign-extension of small signed alien return values

        * gcc 4.3 has a different interpretation of the ABI, and
          zero-extends signed chars, shorts and (on x86-64) ints.

15 years ago1.0.24.47: Fix 1.0.21.29 regression with enums in structs.
Christophe Rhodes [Wed, 21 Jan 2009 17:29:08 +0000 (17:29 +0000)]
1.0.24.47: Fix 1.0.21.29 regression with enums in structs.

This is not the most elegant of fixes, but arrange to return the old
structure where applicable, and make incompatible mentions cause a
CERROR with clobber continue semantics, to parallel what I think is the
logic in the union/struct case.

15 years ago1.0.24.46: SB-BSD-SOCKETS workingness from saved cores on Windows
Nikodemus Siivola [Sat, 17 Jan 2009 10:56:47 +0000 (10:56 +0000)]
1.0.24.46: SB-BSD-SOCKETS workingness from saved cores on Windows

 * Need to call WSA-STARTUP on init.

 * Reported by Stephen Westfold, fix by Rudi Schlatte.

15 years ago1.0.24.45: handle IO errors in LDB and when saving the core
Nikodemus Siivola [Sat, 17 Jan 2009 10:43:57 +0000 (10:43 +0000)]
1.0.24.45: handle IO errors in LDB and when saving the core

 * In LDB, if users response cannot be read, assume y.

 * Check fwrite() called when saving the core, and report the error.

 * Patch by Daniel Lowe.

15 years ago1.0.24.44: bug in INVALID-ARRAY-INDEX-ERROR, leaving EXPECTED-TYPE slot unbound
Nikodemus Siivola [Fri, 16 Jan 2009 12:13:40 +0000 (12:13 +0000)]
1.0.24.44: bug in INVALID-ARRAY-INDEX-ERROR, leaving EXPECTED-TYPE slot unbound

 * It's :EXPECTED-TYPE, not :TYPE. ...having compiler check calls to ERROR like
   this would be nice.

 * Marginally better test to catch this.

15 years ago1.0.24.43: DEFTYPE to accept bodies consisting a single symbol
Nikodemus Siivola [Thu, 15 Jan 2009 09:19:31 +0000 (09:19 +0000)]
1.0.24.43: DEFTYPE to accept bodies consisting a single symbol

 * Regression from 1.0.22.8, reported by Ariel Badichi.

15 years ago1.0.24.42: fix bug 235a
Nikodemus Siivola [Wed, 14 Jan 2009 18:37:20 +0000 (18:37 +0000)]
1.0.24.42: fix bug 235a

 AKA https://bugs.launchpad.net/sbcl/+bug/309141

 * Replace DEFINED-FUN-FUNCTIONAL with DEFINED-FUN-FUNCTIONALS, and reuse
   the functional only if policy matches.

15 years ago1.0.24.41: add necessary disambiguating curly braces to runtime
Nikodemus Siivola [Mon, 12 Jan 2009 16:52:19 +0000 (16:52 +0000)]
1.0.24.41: add necessary disambiguating curly braces to runtime

 * When QSHOW is undefined FSHOW(...) expands into nothing, leading to unexpected
   results for code like

     if (gencgc_verbose)
       FSHOW(...)

   as the conditional will then apply to the next syntactic element.

 * Patch by Daniel Lowe.

15 years ago1.0.24.40: fix regression from 1.0.24.37
Nikodemus Siivola [Mon, 12 Jan 2009 16:20:37 +0000 (16:20 +0000)]
1.0.24.40: fix regression from 1.0.24.37

 * TNs with KIND :CONSTANT don't have leaves if they represent load
   time values.

 * Reported by Attila Lendvai.

15 years ago1.0.24.39: mutex changes
Gabor Melis [Mon, 12 Jan 2009 15:00:21 +0000 (15:00 +0000)]
1.0.24.39: mutex changes

- do what a FIXME suggests and rename MUTEX-VALUE to MUTEX-OWNER
- in the process, make sure that the value returned is less stale
- keep MUTEX-VALUE around for compatibility for a while
- also add HOLDING-MUTEX-P
- to make MUTEX-OWNER and HOLDING-MUTEX-P useful make unithread builds
  keep track of the owner of mutex

15 years ago1.0.24.38: improve test scripts
Gabor Melis [Mon, 12 Jan 2009 14:57:08 +0000 (14:57 +0000)]
1.0.24.38: improve test scripts

- robustify threads.test.sh even more
- fix the same bug related to $! in finalize.test.sh
- make condition-wait-sigcont.lisp work unithread builds

15 years ago1.0.24.37: full raw-instance-slot support on HPPA
Nikodemus Siivola [Mon, 12 Jan 2009 11:47:57 +0000 (11:47 +0000)]
1.0.24.37: full raw-instance-slot support on HPPA

 * Patch by Larry Valkama.

15 years ago1.0.24.36: don't print the array object when reporting index out of bounds
Nikodemus Siivola [Mon, 12 Jan 2009 11:26:42 +0000 (11:26 +0000)]
1.0.24.36: don't print the array object when reporting index out of bounds

 * Report the type of the array instead, and encapsulate the array object in the
   condition object so that it can still be inspected manually.

 * Suggested by Stas Boukarev.

15 years ago1.0.24.35: Flag-setting VOPs on x86[-64] and conditional moves
Paul Khuong [Sun, 11 Jan 2009 18:39:07 +0000 (18:39 +0000)]
1.0.24.35: Flag-setting VOPs on x86[-64] and conditional moves

 * Most :CONDITIONAL VOPs only specify which condition flags they set

 * GENERIC-{EQL,=,<,>} are :CONDITIONAL VOPs, but don't show up as
   calls anymore

 * Values may be selected with CMOVcc if applicable (and :CMOV is
   in *backend-subfeatures*, for x86):
    - Values that are represented, unboxed, in GPRs are CMOVed using
      custom VOPs
    - Unboxed float and complex types aren't converted
    - Other types are assumed to be boxed and CMOVed as descriptors

 * A test to try and to cover an interesting cross-section of flags
   and values to move conditionally.

15 years ago1.0.24.34: IR2: additional representation for predicates, conditional moves
Paul Khuong [Sun, 11 Jan 2009 18:33:31 +0000 (18:33 +0000)]
1.0.24.34: IR2: additional representation for predicates, conditional moves

 * :CONDITIONAL VOPs can now specify how to interpret the test
   they compute without performing the branch directly. How the
   test is specified is completely platform-dependent and only
   affects new-style :CONDITIONAL VOPs and a new BRANCH-IF VOP
   (src/compiler/$ARCH/pred.lisp).

 * Candidates for conversion to conditional moves are found
   and may be converted, depending on CONVERT-CONDITIONAL-MOVE-P,
   a new VM support routine. C-C-M-P returns NIL to punt on the
   conversion, or 5 values:
    1. name of the VOP to use
    2. TN for the first argument (NIL if none)
    3. TN for the second argument (NIL if none)
    4. TN for the result
    5. A list of info data, which will be appended to the flags

   The correct values will be MOVEd in the argument TNs if needed
   before computing the condition, and the result MOVEd to the right
   TN after the conditional move VOP.

15 years ago1.0.24.33: fix bug 316075
Nikodemus Siivola [Sun, 11 Jan 2009 16:34:00 +0000 (16:34 +0000)]
1.0.24.33: fix bug 316075

 https://bugs.launchpad.net/sbcl/+bug/316075

 * In DEFINE-ALIEN-ROUTINE, if the return-type is VOID, don't return
   the result of ALIEN-FUNCALL but a literal NIL instead.

15 years ago1.0.24.32: undo parts of 1.0.24.26
Gabor Melis [Sun, 11 Jan 2009 15:56:03 +0000 (15:56 +0000)]
1.0.24.32: undo parts of 1.0.24.26

No need for memory barriers when unlocking a spinlock on x86/x86-64.
The ordering rules and the cache coherency mechanism together
guarantee this. However, the compiler must be prevented from
reordering instructions with the unlock (at least in one direction).
This is now done in the runtime, but not in Lisp as the Lisp compiler
does no reordering.

15 years ago1.0.24.31: robustify threads.test.sh some more
Nikodemus Siivola [Sun, 11 Jan 2009 15:38:46 +0000 (15:38 +0000)]
1.0.24.31: robustify threads.test.sh some more

 * Missed --no-userinit --no-sysinit --disable-debugger, causing it to
   fail for some setups.

15 years ago1.0.24.30: fixed and tested some more cleanups on hppa-hpux
Nikodemus Siivola [Sat, 10 Jan 2009 11:19:22 +0000 (11:19 +0000)]
1.0.24.30: fixed and tested some more cleanups on hppa-hpux

 * Fix a stray #+ -> #!+.

 * Removed unneeded nops.

 * Explanation of magic numbers (but not yet substituted.)

   (Above changes in patch by Larry Valkama)

 * Fix a bunch of comments in the HPPA backend to use the right number
   of semicolons, and use FIXME-lav instead of FIX-lav to mark things
   (better grepping for the rest of us.)

15 years ago1.0.24.29: fix a typo in documentation
Nikodemus Siivola [Sat, 10 Jan 2009 10:51:13 +0000 (10:51 +0000)]
1.0.24.29: fix a typo in documentation

15 years ago1.0.24.28: make unbind in the runtime zero the value of the binding
Gabor Melis [Fri, 9 Jan 2009 17:47:47 +0000 (17:47 +0000)]
1.0.24.28: make unbind in the runtime zero the value of the binding

... to parallel what the Lisp side does. As far as I see the rationale
for doing that (in doc/internals/specials.texinfo) does not apply here
since signals are blocked when the dynbind functions are called. That
said, instead of adding documentation let's fix it.

15 years ago1.0.24.27: target-thread cosmetics
Gabor Melis [Fri, 9 Jan 2009 16:45:17 +0000 (16:45 +0000)]
1.0.24.27: target-thread cosmetics

- in the docstring of CONDITION-NOTIFY document that the mutex must be held
- remove and explain fixme in CONDITION-WAIT
- respect 80 char limit
- use ; ;; ;;; and ;;;; where appropriate
- fill the comment paragraphs
- add form feeds (^L) to separate pages

15 years ago1.0.24.26: fix release spinlock
Gabor Melis [Fri, 9 Jan 2009 16:43:56 +0000 (16:43 +0000)]
1.0.24.26: fix release spinlock

Both in the runtime and in Lisp releasing a spinlock was a simple
assignment. That doesn't work because the new value may not make it to
main memory by the time another CPU wants to acquire it making it
needlessly slow. Worse, it also allows the CPU to reorder instructions
from the critical section after the release.

There is a spinlock implementation for MIPS in the runtime, but it's
not used as we don't have threads on that platform. I don't know if
it's broken too.

15 years ago1.0.24.25: add volatile after asm in spinlock and swap_lispobjs
Gabor Melis [Fri, 9 Jan 2009 16:42:09 +0000 (16:42 +0000)]
1.0.24.25: add volatile after asm in spinlock and swap_lispobjs

... to prevent the compiler from optimizing away certain calls or
maybe reorder them. Test for swap_lispobj.

15 years ago1.0.24.24: fix threads.test.sh
Gabor Melis [Thu, 8 Jan 2009 17:21:08 +0000 (17:21 +0000)]
1.0.24.24: fix threads.test.sh

... so that it doesn't leave stray sbcl child processes around and it
actually tests what it wants to test.

15 years ago1.0.24.23: fix alien struct struct member offset bug
Christophe Rhodes [Mon, 5 Jan 2009 08:55:20 +0000 (08:55 +0000)]
1.0.24.23: fix alien struct struct member offset bug

No-one uses struct struct members, right?  Well, academics are
notoriously bad at keeping up to dat with good practice...

15 years ago1.0.24.22: mudball of VOP updates for HPPA
Nikodemus Siivola [Sun, 4 Jan 2009 07:49:02 +0000 (07:49 +0000)]
1.0.24.22: mudball of VOP updates for HPPA

 * Based on a mix of the old hppa-code and the mips backend.

 * Patch by Larry Valkama.

15 years ago1.0.24.21: call stub needed to switch between hpux heap-spaces
Nikodemus Siivola [Sun, 4 Jan 2009 07:35:53 +0000 (07:35 +0000)]
1.0.24.21: call stub needed to switch between hpux heap-spaces

 * Patch by Larry Valkama.

15 years ago1.0.24.20: misc HPPA & HPUX updates
Nikodemus Siivola [Sun, 4 Jan 2009 07:23:03 +0000 (07:23 +0000)]
1.0.24.20: misc HPPA & HPUX updates

 * "To make it compile and run".

 * Config.hppa-hpux missed from 1.0.24.18.

 * Patch by Larry Valkama.

15 years ago1.0.24.19: COMPILE-TIME reports timings at millisecond accuracy
Nikodemus Siivola [Sat, 3 Jan 2009 17:05:44 +0000 (17:05 +0000)]
1.0.24.19: COMPILE-TIME reports timings at millisecond accuracy

 * Patch by Luis Oliveira.

15 years ago1.0.24.18: new HPUX specific files
Nikodemus Siivola [Sat, 3 Jan 2009 16:26:22 +0000 (16:26 +0000)]
1.0.24.18: new HPUX specific files

 * Also more separation of linux stuff versus common stuff (hpux vs linux).

 * Patch by Larry Valkama.

15 years ago1.0.24.17: grab-bag of fixes to make hpux-os smile
Nikodemus Siivola [Sat, 3 Jan 2009 16:17:48 +0000 (16:17 +0000)]
1.0.24.17: grab-bag of fixes to make hpux-os smile

 * Patch by Larry Valkama.

15 years ago1.0.24.16: updates on how we deal with fixup on HPPA
Nikodemus Siivola [Sat, 3 Jan 2009 16:14:03 +0000 (16:14 +0000)]
1.0.24.16: updates on how we deal with fixup on HPPA

 * Patch by Larry Valkama.

15 years ago1.0.24.15: contrib fixes for HPPA
Nikodemus Siivola [Sat, 3 Jan 2009 16:10:19 +0000 (16:10 +0000)]
1.0.24.15: contrib fixes for HPPA

 * Fix or disable what breaks in contribs, so not everything breaks.

 * Patch by Larry Valkama.

15 years ago1.0.24.14: fix what seems to be namespace collision by HPUX headers
Nikodemus Siivola [Sat, 3 Jan 2009 16:02:31 +0000 (16:02 +0000)]
1.0.24.14: fix what seems to be namespace collision by HPUX headers

 * Patch by Larry Valkama.

15 years ago1.0.24.13: solve overlapping mmap and munmap slices on HPUX
Nikodemus Siivola [Sat, 3 Jan 2009 15:59:44 +0000 (15:59 +0000)]
1.0.24.13: solve overlapping mmap and munmap slices on HPUX

 * Patch by Larry Valkama.

15 years ago1.0.24.12: adding and fixing the HPUX/HPPA build target
Nikodemus Siivola [Sat, 3 Jan 2009 15:50:46 +0000 (15:50 +0000)]
1.0.24.12: adding and fixing the HPUX/HPPA build target

 * Patch by Larry Valkama.

15 years ago1.0.24.11: stack allocation support for HPPA
Nikodemus Siivola [Sat, 3 Jan 2009 15:41:58 +0000 (15:41 +0000)]
1.0.24.11: stack allocation support for HPPA

 * Thiemo Seufer's MIPS stack allocation work and other things by him
   ported over to HPPA.

 * Patch by Larry Valkama.

15 years ago1.0.24.10: raw slot support for HPPA
Nikodemus Siivola [Sat, 3 Jan 2009 15:39:38 +0000 (15:39 +0000)]
1.0.24.10: raw slot support for HPPA

 * Remove raw slot support workaround on hppa, VOPs implemented
   instead.

 * Patch by Larry Valkama.

15 years ago1.0.24.9: fix overlapping address spaces on sparc
Nikodemus Siivola [Sat, 3 Jan 2009 15:17:44 +0000 (15:17 +0000)]
1.0.24.9: fix overlapping address spaces on sparc

 * Patch by Bruce O'Neel.

15 years ago1.0.24.8: fix scav_lose
Gabor Melis [Fri, 2 Jan 2009 18:37:55 +0000 (18:37 +0000)]
1.0.24.8: fix scav_lose

Used to do one pointer dereferencing too many when printing the
widetag of the lispobj leading to memory faults, ultimately obscuring
the backtrace instead of losing cleanly. Memory faults during gc could
cause all kinds of trouble rendering the backtrace even less
informative.

15 years ago1.0.24.7: CHAR-CODE type derivation
Nikodemus Siivola [Fri, 2 Jan 2009 16:05:28 +0000 (16:05 +0000)]
1.0.24.7: CHAR-CODE type derivation

 * Patch by Paul Khuong.

15 years ago1.0.24.6: OPTIMIZATION #23 is there already
Nikodemus Siivola [Fri, 2 Jan 2009 15:11:08 +0000 (15:11 +0000)]
1.0.24.6: OPTIMIZATION #23 is there already

 * Type information for &REST lists is available after constraint
   propagation.

15 years ago1.0.24.5: SB-INTROSPECT: rename FUNCTION-ARGLIST to FUNCTION-LAMBDA-LIST
Nikodemus Siivola [Fri, 2 Jan 2009 14:24:03 +0000 (14:24 +0000)]
1.0.24.5: SB-INTROSPECT: rename FUNCTION-ARGLIST to FUNCTION-LAMBDA-LIST

 * Deprecate FUNCTION-ARGLIST.

 * Improve the docstring.

 * Original patch by Tobias Rittweiler.

15 years ago1.0.24.4: SB-INTROSPECT:DEFTYPE-LAMBDA-LIST
Nikodemus Siivola [Fri, 2 Jan 2009 13:55:36 +0000 (13:55 +0000)]
1.0.24.4: SB-INTROSPECT:DEFTYPE-LAMBDA-LIST

 * Patch by Tobias Rittweiler.

15 years ago1.0.24.3: sanity check address spaces
Nikodemus Siivola [Fri, 2 Jan 2009 12:42:08 +0000 (12:42 +0000)]
1.0.24.3: sanity check address spaces

 * Genesis to check that spaces don't overlap.

 * At startup make sure --dynamic-space-size doesn't overflow, or run
   into any space possibly on top of dynamic space. (GENCGC only.)

15 years ago1.0.24.2: CONSTANTP aware GET-SETF-EXPANDER
Nikodemus Siivola [Fri, 2 Jan 2009 11:14:27 +0000 (11:14 +0000)]
1.0.24.2: CONSTANTP aware GET-SETF-EXPANDER

 * Or rather GET-SETF-METHOD-INVERSE -- check for constant arguments,
   which don't need to be rebound. This allows compiler macros for
   SETF-functions to see their constant arguments.

 * This exposes a small thinko in ACCESSOR-VALUES-INTERNAL (something
   gets optimized during PCL build which wasn't before): EARLY-P there
   doesn't mean the method is early.

15 years ago1.0.24.1: Reading from a TWO-WAY-STREAM need not flush the output stream.
Gabor Melis [Thu, 1 Jan 2009 20:50:41 +0000 (20:50 +0000)]
1.0.24.1: Reading from a TWO-WAY-STREAM need not flush the output stream.

In fact, it unnecessarily complicates writing thread-safe code as
readers and writers access the output stream concurrently.

15 years ago1.0.24: release, will be tagged as sbcl_1_0_24
Christophe Rhodes [Wed, 31 Dec 2008 13:27:21 +0000 (13:27 +0000)]
1.0.24: release, will be tagged as sbcl_1_0_24

Also, include build fix for sparc (Juho Snellman / Bruce O'Neel
sbcl-devel 30-12-2008) and mark test :throw :no-such-tag as failing on
x86/linux and x86-64/linux (because they do for me).