Commit graph

115 commits

Author SHA1 Message Date
Daniel Kochmański
593d9d2190 stacks: move invocation history stack to a separate structure 2025-05-26 07:43:41 +02:00
Daniel Kochmański
9687a1d33a stacks: move frames stack to a separate structure 2025-05-26 07:43:41 +02:00
Daniel Kochmański
fcd9abba71 universal_error_handler: print more of the error
Having *PRINT-LENGTH* at 3 is not satisfactory, especially in the early handler
where there are no other means to introspect errors. Change it to 8.

Before:

    ;;; Message:
    |TYPE-ERROR|
    ;;; Arguments:
    (:|EXPECTED-TYPE| |FUNCTION| :|DATUM| ...)

After:

    ;;; Message:
    |TYPE-ERROR|
    ;;; Arguments:
    (:|EXPECTED-TYPE| |FUNCTION| :|DATUM| (|QUOTE| |WHILE|))
2024-12-06 10:20:39 +01:00
Marius Gerbershagen
0885862e40 cmp: improve handling of potential miscompilations
Abort with a useful error message instead of trying to continue on.
2023-07-01 16:45:21 +02:00
Marius Gerbershagen
4da9cc3a87 improve error message for wrong index
Use ~S instead of ~A to make the difference between e.g. "0" and 0
clear.

Fixes #687.
2022-12-27 15:32:55 +01:00
Daniel Kochmański
9e10e9115e cosmetic: introduce define ecl_thread_exit() 2022-11-25 10:13:49 +01:00
Marius Gerbershagen
0f737b6ba6 multithreading: implement mutexes and condition variables using OS primitives
Replace slow homegrown mutex implementation by standard OS functions.

We try our best to be interrupt safe, however a completely safe
implementation is impossible (unless one completely removes the ability
to interrupt a thread waiting on a mutex). There is always a window
after the OS specific function has returned, but before we can set
the owner, in which interrupts will see an inconsistent state of the
mutex with regards to owner and count.

Condition variables are now based on OS functions as well. Timed
waiting on condition variables has also been implemented.
2021-08-29 17:23:19 +02:00
Marius Gerbershagen
36a9c95c80 tree-wide: use new dpp @"" specifier for constant base strings where appropriate 2021-03-12 19:53:33 +01:00
Marius Gerbershagen
7ddb4ada07 error.d: FEcannot_open: improve error message 2021-02-10 20:06:57 +01:00
Daniel Kochmański
0ab85fc9d5 conditions: add an ext:timeout serious condition 2020-06-15 12:34:10 +02:00
Marius Gerbershagen
68ee6fa228 add some missing ecl_va_end statements 2019-12-08 10:26:52 +01:00
Marius Gerbershagen
24dcb778cf clean up functions creating base strings from C strings
Make functions behave as documented, remove use of legacy names.
    Fixes #462.
2019-01-07 18:43:55 +01:00
Marius Gerbershagen
fd1affa7d0 Print a C backtrace in ecl_thread_internal_error
After the recent changes to the C backtrace interface,
    _ecl_dump_c_backtrace() no longer needs a working lisp
    environment, so we can safely call it here.
2018-05-27 18:21:30 +02:00
Marius Gerbershagen
2279361383 debugger: add option to print C backtrace
Split si_dump_c_backtrace up into two functions:
    - _ecl_dump_c_backtrace() (already declared in internal.h, but not
      implemented) using only C functions printing to stderr to be used
      in case of internal errors
    - si_dump_c_backtrace() using lisp functions to be used in the
      debugger
    Remove broken emulation of backtrace and backtrace_symbols
    functions using __builtin_return_address.
2018-05-08 19:36:11 +02:00
Daniel Kochmanski
fd183e575f Better error messages, bc-compile improvements
bc-compile is more conforming now (we validate definition and name, also our
closure compilation is a bit better, still broken though).

Also improve some error messages and add periods at the end.
2018-02-13 12:43:32 +01:00
Kris Katterjohn
028ab410b2 Remove FEprogram_error_noreturn and replace uses with FEprogram_error
These two function are the same.

Here is my understanding: FEprogram_error_noreturn was introduced with
the noreturn function attribute in commit 7d9fb8bb because
FEprogram_error did not have this attribute.  However, FEprogram_error
got the noreturn function attribute in commit 790d466c.  Now there is
no reason to have both of these.

This removes FEprogram_error_noreturn and changes all calls to it
with calls to FEprogram_error instead.
2017-06-29 17:24:54 -05:00
Kris Katterjohn
643651e320 Move FEillegal_variable_name to error.d and use it where appropriate
This was local to compiler.d, but it should also be used in stacks.d.

This is used in place of the error message introduced in commit 9ff142.
2017-06-28 14:21:28 -05:00
Kris Katterjohn
f5b9430c6c Introduce FEbinding_a_constant and use it where appropriate
This is for signalling an error about binding a constant variable.

This makes the error messages originally in commits 745686, c9e732
and 4e3283 more precise.
2017-06-28 14:03:29 -05:00
Fabrizio Fabbri
390caa3e51
Revert "Revert "Merge branch 'develop' into 'develop'""
This reverts commit cf416f6fd4.
2017-06-03 12:57:17 +02:00
Daniel Kochmanski
cf416f6fd4 Revert "Merge branch 'develop' into 'develop'"
This reverts commit b75802f122, reversing
changes made to 5e3ccb1955.
2017-05-26 14:38:52 +02:00
Daniel Kochmański
a095f6a4ee ecl_thread_internal_error: provide hint what may go wrong 2017-05-25 08:19:19 +02:00
Daniel Kochmański
7ef7116589 windows: thread_internal_error: call ExitThread 2017-05-25 07:57:05 +02:00
Daniel Kochmański
052155c6c3 ecl_thread_internal_error: add C api, protect get_env
Problem reported and fixed by Marius Gerbershagen. Fixes #382.
2017-05-22 22:58:15 +02:00
Fabrizio Fabbri
a74094de9a
fix coverity issue Missing varargs init or cleanup 2017-05-17 23:20:10 +02:00
Daniel Kochmański
7d8f7cdc76 add _ecl_unexpected_return(); to noreturn funs 2016-11-18 14:58:31 +01:00
Daniel Kochmański
2f89642227 fix noreturn attributes
Some functions doesn't return, declare them so (GCC complaints).
2016-10-06 12:21:26 +02:00
Daniel Kochmański
ae7cae404d indent: d-f 2016-05-05 15:24:58 +02:00
Attila Lendvai
15f3d7feab fix bootstrap error printing in universal_error_handler.
Signed-off-by: Attila Lendvai <attila@lendvai.name>
2015-09-29 17:41:28 +02:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Daniel Kochmański
09ae630cde stack: add special conditional handler for stack-overflow
Add `serror' and `stack-error-handler', which behave like normal
`cerror' -> `universal-error-handler' call order, except fact, that
after handling stack-overflow condition they reset appropriate stack
limit. Fixes #56.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:45:54 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Juan Jose Garcia Ripoll
d5f1e4301b Remove debug statements from error.d 2012-10-10 22:53:52 +02:00
Juan Jose Garcia Ripoll
dfc94901c4 delete-file, rename-file, chdir, mkdir and chmod now signal file-errors 2012-09-02 21:46:38 +02:00
Juan Jose Garcia Ripoll
825fc8cbd3 Cnil and Ct are now part of legacy 2012-06-30 23:01:40 +02:00
Juan Jose Garcia Ripoll
0131e2131d Renamed ecl_bds_ptr and ecl_ihs_ptr and the corresponding structs 2012-06-30 21:39:22 +02:00
Juan Jose Garcia-Ripoll
05a16801ca Rename cl_va_* macros to ecl_va_* 2012-06-24 20:46:55 +02:00
Juan Jose Garcia Ripoll
cb1cf92713 Rename ecl_fix() to ecl_fixnum(), just like ecl_long_float() or ecl_double_float() 2012-06-07 23:55:43 +02:00
Juan Jose Garcia Ripoll
64a9168434 CHARACTERP, BASE_CHAR_P, BASE_CHAR_CODE_P, CODE_CHAR, CHAR_CODE, REAL_TYPE, IMMEDIATE, IMMEDIATE_TAG, FIXNUM_TAG, FIXNUM_MINUSP, FIXNUM_PLUSP, FIXNUMP and fix get the ecl_ prefix 2012-06-06 11:19:55 +02:00
Juan Jose Garcia Ripoll
e1c1fbe5aa FElibc_error/FEwin32_error now explain that what the user is seeing is a core library message 2012-04-13 01:10:13 +02:00
Juan Jose Garcia Ripoll
8d1c35daeb ecl_unrecoverable_error() verifies that some frame was established before jumping to it. 2012-04-08 16:17:50 +02:00
Juan Jose Garcia Ripoll
9d557937b1 Added new dispatch functions for slot accessors. 2011-12-16 22:12:56 +01:00
Juan Jose Garcia Ripoll
c1b98706fa Removed debug statement in error.d (FEundefined_function) 2011-08-23 14:02:10 +02:00
Juan Jose Garcia Ripoll
853ec3ebc5 Errors in array/sequence indexes are now a bit more uniform. Eliminated FEillegal_index. Changed prototype for FEtype_error_index. Fixed typo in FEwrong_index. 2011-04-03 10:03:50 +02:00
Juan Jose Garcia Ripoll
ac4b1a7b8d Added support for a subset of Unicode (0 - 65535). 2011-02-19 23:46:52 +00:00
Juan Jose Garcia Ripoll
77f51dc653 Remove printf statement FElibc_error(). 2011-02-12 19:35:41 +01:00
Juan Jose Garcia Ripoll
0aa176a5bb Fixed typo. 2011-01-14 09:11:17 +01:00
Juan Jose Garcia Ripoll
4a83432e01 ecl_make_simple_base_string() replaces make_simple_base_string() and allows fixing the length. 2011-01-13 23:28:44 +01:00
Juan Jose Garcia Ripoll
c952641c43 Added C backtraces (EXT:DUMP-C-BACKTRACE) and used them at boot time, when the error handler is not set up. 2010-11-07 12:49:55 +01:00
Juan Jose Garcia Ripoll
79d8e9b569 Split printer into separate files, factorizing those for unreadable printing 2010-10-28 23:05:25 +02:00
Juan Jose Garcia Ripoll
c86c8bd5c0 Move packages to read/write locks 2010-10-24 17:53:44 +02:00