| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* module/ice-9/psyntax.scm (syntax?): Only recognize legacy syntax
objects if the new allow-legacy-syntax-objects? parameter is true.
* module/ice-9/boot-9.scm (allow-legacy-syntax-objects?): New
parameter.
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document the
horrible situation with legacy syntax objects.
* NEWS: Add entry.
|
|
|
|
|
| |
This reverts commit 62f08b8f38990c1849ea61cd622f84b3d2611cd9, which was
causing failing texi2dvi runs.
|
|
|
|
|
|
| |
* doc/ref/scheme-ideas.texi: the some way -> the same way
* doc/ref/scheme-intro.texi: Use @math inside a texinfo command (turns out
$math$ is not processed in this context and thus is not rendered correctly).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/ref/vm.texi (Inlined Scheme Instructions): Add string-set!.
* libguile/vm-engine.c (string-set!): New opcode.
* module/ice-9/rdelim.scm (read-string): Reimplement in terms of a
geometrically growing list of strings, to reduce total heap usage when
reading big files.
* module/language/cps/compile-bytecode.scm (compile-function): Add
string-set! support.
* module/language/cps/types.scm (string-set!): Update for &u64 index.
* module/language/tree-il/compile-cps.scm (convert): Unbox index to
string-set!.
* module/system/vm/assembler.scm (system): Export string-set!.
|
|
|
|
| |
* doc/ref/api-control.texi (Fluids and Dynamic States): Fix link.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/fluids.h (struct scm_dynamic_state): Add thread_local_values
table. Thread locals are flushed to a separate thread-local table.
The references are strong references since the table never escapes the
thread.
(scm_make_thread_local_fluid, scm_fluid_thread_local_p): New
functions.
* libguile/fluids.c (FLUID_F_THREAD_LOCAL):
(SCM_I_FLUID_THREAD_LOCAL_P): New macros.
(restore_dynamic_state): Add comment about precondition.
(save_dynamic_state): Flush thread locals.
(scm_i_fluid_print): Print thread locals nicely.
(new_fluid): Add flags arg.
(scm_make_fluid, scm_make_fluid_with_default, scm_make_unbound_fluid):
Adapt.
(scm_make_thread_local_fluid, scm_fluid_thread_local_p): New
functions.
(fluid_set_x): Special flushing logic for thread-locals.
(fluid_ref): Special cache miss logic for thread locals.
* libguile/stacks.c (scm_init_stacks):
* libguile/throw.c (scm_init_throw): %stacks and %exception-handler are
thread-locals.
* libguile/threads.c (guilify_self_2): Init thread locals table.
* test-suite/tests/fluids.test ("dynamic states"): Add test.
* doc/ref/api-control.texi (Fluids and Dynamic States): Add link to
Thread-Local Variables.
* doc/ref/api-scheduling.texi (Thread Local Variables): Update with real
thread-locals.
* NEWS: Update.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (HAVE_USABLE_GETITIMER_PROF, HAVE_USABLE_GETITIMER_VIRTUAL): new tests
* doc/ref/posix.texi (setitimer, getitimer): document provided? 'ITIMER_VIRTUAL and 'ITIMER_PROF
* doc/ref/statprof.texi (statprof): document ITIMER_PROF requirements
* libguile/scmsigs.c (scm_setitimer, scm_getitimer): document (provided? 'ITIMER_VIRTUAL) and (provided? 'ITIMER_PROF)
(scm_init_scmsigs): add features ITIMER_VIRTUAL and ITIMER_PROF
* test-suite/tests/asyncs.test ("prevention via sigprof"): throw when unsupported
* test-suite/tests/signals.test: throw when not supported
* test-suite/tests/statprof.test: throw when not supported
|
|
|
|
|
|
|
| |
* doc/ref/api-foreign.text (dynamic-link): document problems with recursive DLLs.
* test-suite/standalone/test-ffi (global): with Cygwin, dynamic-link C library explicitly
* test-suite/standalone/test-foreign-object-scm (libc-ptr): with Cygwin, link C library explicitly
* test-suite/tests/foreign.test (qsort): with Cygwin, link C library explicitly
|
|
|
|
|
|
| |
* doc/ref/api-languages.texi (Nil):
* doc/ref/statprof.texi (Statprof): Use headings instead of sections to
avoid makeinfo warnings.
|
|
|
|
|
| |
* doc/ref/api-utility.texi (Hook Reference): Remove useless "handling
hooks from C" section that was also generating warnings.
|
|
|
|
|
| |
* doc/ref/scheme-scripts.texi (Scripting Examples): Fix $@ rendering in
texinfo.
|
|
|
|
|
|
|
| |
* doc/ref/guile-invoke.texi, doc/ref/scheme-scripts.texi:
describe the -e (module) shorthand as on equal footing with (@ ...)
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This feature was removed by 4aead68cdb86ca60cc372f0cd558cadda90ddec5.
* module/ice-9/i18n.scm (number-decimal-string): Rewrite the case where
DIGIT-COUNT is not an integer.
(number->locale-string): Always pass FRACTION-DIGITS to
'number-decimal-string'.
* test-suite/tests/format.test ("~h localized number")["1234.5"]
["padding", "padchar"]: Remove decimal specifier.
* test-suite/tests/i18n.test ("number->locale-string")
["fraction",
* test-suite/tests/i18n.test ("format ~h")["12 345,678"]: Remove decimal
specifier. Remove one decimal.
* doc/ref/api-i18n.texi (Number Input and Output): Update
'number->locale-string' doc to mention the number of decimals.
|
|
|
|
|
|
| |
* doc/ref/scheme-using.texi (Installing Site Packages): Fix typo
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
|
| |
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Christopher Allan Webber <cwebber@dustycloud.org>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit adds protection to Guile's REPL servers against HTTP
inter-protocol exploitation attacks, a scenario whereby an attacker can,
via an HTML page, cause a web browser to send data to TCP servers
listening on a loopback interface or private network. See
<https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and
<https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol
Attack (2001) by Tochen Topf <jochen@remote.org>.
Here we add a procedure to 'before-read-hook' that looks for a possible
HTTP request-line in the first line of input from the client socket. If
present, the socket is drained and closed, and a loud warning is written
to stderr (POSIX file descriptor 2).
* module/system/repl/server.scm: Add 'maybe-check-for-http-request'
to 'before-read-hook' when this module is loaded.
(with-temporary-port-encoding, with-saved-port-line+column)
(drain-input-and-close, permissive-http-request-line?)
(check-for-http-request, guard-against-http-request)
(maybe-check-for-http-request): New procedures.
(serve-client): Use 'guard-against-http-request'.
* module/system/repl/coop-server.scm (start-repl-client): Use
'guard-against-http-request'.
* doc/ref/guile-invoke.texi (Command-line Options): In the description
of the --listen option, make the security warning more prominent.
Mention the new protection added here. Recommend using UNIX domain
sockets for REPL servers. "a path to" => "the file name of".
|
|
|
|
| |
* doc/ref/api-data.texi (Integers): Document them.
|
|
|
|
|
|
|
|
|
|
| |
Fixes <http://bugs.gnu.org/24659>.
* libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is
unbound; instead, use 0777 as the mode. Update docstring to clarify
this.
* doc/ref/posix.texi (File System): Adjust accordingly.
* NEWS: Mention it.
|
|
|
|
|
|
|
| |
* doc/ref/posix.texi (Ports and File Descriptors): Update.
* libguile/filesys.c (scm_select): Use scm_std_select so that pending
interrupts can be delivered. On EINTR or EAGAIN, just return directly
so that calling Scheme code can run asyncs.
|
|
|
|
|
| |
* doc/ref/api-evaluation.texi (Expression Syntax): Fix quote and
quasiquote so that they actually look different in Info.
|
|
|
|
|
| |
* doc/ref/scheme-scripts.texi (Scripting Examples): Mention system* and
open-pipe.
|
|
|
|
|
|
| |
This reverts commit 8a177d316c0062afe74f9a761ef460e297435e59, though
keeping the additional tests. (Guile 2.2 doesn't have a fixed stack
limit).
|
|
|
|
|
| |
* doc/ref/api-data.texi: Instead of saying it is obvious, explain why
no native endianness accessors exist for the `s8' and `u8' variants.
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/ref/posix.texi (Network Sockets and Communication): Add
documentation.
* libguile/socket.c (scm_accept4): New function, replaces accept
implementation.
(scm_accept): Call scm_accept4.
(scm_init_socket): Define SOCK_CLOEXEC and SOCK_NONBLOCK.
* libguile/socket.h: Add private scm_accept4 decl.
* module/ice-9/suspendable-ports.scm (accept): Update.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/dynstack.h:
* libguile/dynstack.c (scm_dynstack_find_old_fluid_value): New
function.
* libguile/fluids.c (saved_dynamic_state_ref): New helper.
(scm_fluid_ref): Fix docstring.
(scm_fluid_ref_star): New function allowing access to previous values
for a fluid.
(scm_dynamic_state_ref): New internal function.
* libguile/fluids.h: Add scm_fluid_ref_star and scm_dynamic_state_ref.
* libguile/stacks.c (scm_stack_id): Adapt to %stacks not being a chain.
* libguile/throw.c (catch, throw_without_pre_unwind): Adapt to
%exception-handlers not being a chain.
* module/ice-9/boot-9.scm (catch, dispatch-exception): Instead of having
%exception-handlers be a chain, use fluid-ref* to access the chain
that is in place at the time the exception is thrown. Prevents
unintended undelimited capture of the current exception handler stack
by a delimited "catch".
(%start-stack): Similarly, don't be a chain.
* module/system/repl/debug.scm (frame->stack-vector):
* module/system/repl/error-handling.scm (call-with-error-handling):
* module/ice-9/save-stack.scm (save-stack): Adapt to %stacks not being a
chain.
* test-suite/tests/exceptions.test ("delimited exception handlers"): Add
tests.
* doc/ref/api-control.texi (Fluids and Dynamic States): Add docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/vm-engine.c (BR_F64_ARITHMETIC): New preprocessor macro.
(br_if_f64_ee, br_if_f64_lt, br_if_f64_le, br_if_f64_gt, br_if_f64_ge):
New VM instructions.
* doc/ref/vm.texi ("Unboxed Floating-Point Arithmetic"): Document them.
* module/language/cps/compile-bytecode.scm (compile-function): Emit f64
comparison instructions.
* module/language/cps/effects-analysis.scm: Define effects for f64
primcalls.
* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
arities for f64 primcalls.
* module/language/cps/specialize-numbers.scm (specialize-f64-comparison):
New procedure.
(specialize-operations): Specialize f64 comparisons.
* module/system/vm/assembler.scm (emit-br-if-f64-=, emit-br-if-f64-<)
(emit-br-if-f64-<=, emit-br-if-f64->, emit-br-if-f64->=): Export.
* module/system/vm/disassembler.scm (code-annotation): Add annotations
for f64 comparison instructions.
|
|
|
|
|
|
| |
Globally rename (array-from* -> array-slice), (array-from ->
array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell
-> array-slice-for-each).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/async.h:
* libguile/async.c (struct scm_thread_wake_data): Include the cond to
signal. Be a union and include a tag.
(scm_i_prepare_to_wait): Rename from scm_i_setup_sleep and take wake
data directly. Also call scm_i_wait_finished as appropriate.
(scm_i_wait_finished): Rename from scm_i_reset_sleep.
(scm_i_prepare_to_wait_on_fd, scm_c_prepare_to_wait_on_fd):
(scm_i_prepare_to_wait_on_cond, scm_c_prepare_to_wait_on_cond): New
functions.
(scm_c_wait_finished): New function.
(scm_system_async_mark_for_thread): Adapt to wake data change.
* libguile/threads.c (block_self, scm_std_select): Adapt to async
interface changes.
* doc/ref/api-scheduling.texi (Asyncs): Doc new public interfaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements wishlist item <https://debbugs.gnu.org/18592>.
Requested by Frank Terbeck <ft@bewatermyfriend.org>.
Based on a proposed patch by Nala Ginrut <nalaginrut@gmail.com>.
Patch ported to 2.2 by Andy Wingo <wingo@pobox.com>.
* libguile/foreign.c (cif_to_procedure): Add 'with_errno' argument.
If true, truncate result to only one return value.
(scm_i_foreign_call): Separate the arguments. Always return errno.
(pointer_to_procedure): New static function.
(scm_pointer_to_procedure_with_errno): New C API function, implemented
in terms of 'pointer_to_procedure'.
(scm_pointer_to_procedure): Reimplement in terms of
'pointer_to_procedure', no longer bound to "pointer->procedure". See
below.
(scm_i_pointer_to_procedure): New C function bound to
"pointer->procedure" which now accepts the optional #:return-errno?
keyword argument, implemented in terms of 'pointer_to_procedure'.
(k_return_errno): New keyword #:return-errno?.
* libguile/foreign.h (scm_pointer_to_procedure_with_errno): Add prototype.
* doc/ref/api-foreign.texi (Dynamic FFI): Adjust documentation.
* libguile/vm-engine.c (foreign-call): Return two values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/ref/api-control.texi (Prompt Primitives): Document
suspendable-continuation?.
* libguile/control.c (scm_suspendable_continuation_p): New procedure.
(scm_init_ice_9_control): New extension procedure, defines
suspendable-continuation?.
(scm_init_control): Register scm_init_ice_9_control.
* libguile/eval.c (eval):
* libguile/throw.c (catch):
* libguile/continuations.c (scm_i_make_continuation): Restore resumable
prompt cookie after continuation invocation.
* libguile/vm.c (scm_call_n): Arrange to set resumable_prompt_cookie
during invocation of VM.
* libguile/vm.h (struct scm_vm): Add resumable_prompt_cookie member.
* module/ice-9/control.scm: Export suspendable-continuation?.
* test-suite/tests/control.test ("suspendable-continuation?"): New
test.
|
|
|
|
| |
* doc/ref/api-scheduling.texi (Thread Local Variables): New subsection.
|
|
|
|
|
| |
* doc/ref/api-control.texi (Parameters): Make the opening a bit less
abrupt.
|
|
|
|
|
| |
* doc/ref/api-control.texi (Fluids and Dynamic States): Update
documentation.
|
|
|
|
|
| |
* doc/ref/api-control.texi:
* doc/ref/api-scheduling.texi: Move fluids and parameters docs.
|
|
|
|
|
| |
* doc/ref/api-io.texi (Non-Blocking I/O): Fix example to call use-modules
rather than use-module.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/dynstack.h (SCM_DYNSTACK_TYPE_DYNAMIC_STATE):
* libguile/dynstack.c (DYNAMIC_STATE_WORDS, DYNAMIC_STATE_STATE_BOX):
(scm_dynstack_push_dynamic_state):
(scm_dynstack_unwind_dynamic_state): New definitions.
(scm_dynstack_unwind_1, scm_dynstack_wind_1): Add with-dynamic-state
cases.
* libguile/memoize.c (push_dynamic_state, pop_dynamic_state)
(do_push_dynamic_state, do_pop_dynamic_state): New definitions.
(memoize, scm_init_memoize): Handle push-dynamic-state and
pop-dynamic-state.
* libguile/vm-engine.c (push-dynamic-state, pop-dynamic-state): New
opcodes.
* module/ice-9/boot-9.scm (with-dynamic-state): New definition in Scheme
so that the push-dynamic-state and pop-dynamic-state always run in the
VM.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm:
* module/language/cps/types.scm:
* module/language/tree-il/effects.scm (make-effects-analyzer):
* module/language/tree-il/peval.scm (peval):
* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
* module/system/vm/assembler.scm: Add support for with-dynamic-state to
the compiler.
* test-suite/tests/fluids.test ("dynamic states"): Add basic tests.
* doc/ref/vm.texi (Dynamic Environment Instructions): Update.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two goals: one, to use less memory per dynamic state in order
to allow millions of dynamic states to be allocated in light-weight
threading scenarios. The second goal is to prevent dynamic states from
being actively mutated in two threads at once. This second goal does
mean that dynamic states object that escape into scheme are now copies
that won't receive further updates; an incompatible change, but one
which we hope doesn't affect anyone.
* libguile/cache-internal.h: New file.
* libguile/fluids.c (is_dynamic_state, get_dynamic_state)
(save_dynamic_state, restore_dynamic_state, add_entry)
(copy_value_table): New functions.
(scm_i_fluid_print, scm_i_dynamic_state_print): Move up.
(new_fluid): No need for a number.
(scm_fluid_p: scm_is_fluid): Inline IS_FLUID uses.
(fluid_set_x, fluid_ref): Adapt to dynamic state changes.
(scm_fluid_set_x, scm_fluid_unset_x): Call fluid_set_x.
(scm_swap_fluid): Rewrite in terms of fluid_ref and fluid_set.
(swap_fluid): Use internal fluid_set_x.
(scm_i_make_initial_dynamic_state): Adapt to dynamic state
representation change.
(scm_dynamic_state_p, scm_is_dynamic_state): Use new accessors.
(scm_current_dynamic_state): Use make_dynamic_state.
(scm_dynwind_current_dynamic_state): Use new accessor.
* libguile/fluids.h: Remove internal definitions. Add new struct
definition.
* libguile/threads.h (scm_i_thread): Use scm_t_dynamic_state for dynamic
state.
* libguile/threads.c (guilify_self_1, guilify_self_2):
(scm_i_init_thread_for_guile, scm_init_guile):
(scm_call_with_new_thread):
(scm_init_threads, scm_init_threads_default_dynamic_state): Adapt to
scm_i_thread change.
(scm_i_with_guile, with_guile): Remove "and parent" suffix.
(scm_i_reset_fluid): Remove unneeded function.
* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Remove
scm_make_dynamic_state docs. Update current-dynamic-state docs.
* libguile/vm-engine.c (vm_engine): Update fluid-ref and fluid-set!
inlined fast paths for dynamic state changes.
* libguile/vm.c (vm_error_unbound_fluid): Remove now-unused function.
* NEWS: Update.
* module/ice-9/deprecated.scm (make-dynamic-state): New definition.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_dynamic_state): Move here.
* libguile/__scm.h (scm_t_dynamic_state): New typedef.
* libguile/dynstack.h:
* libguile/dynstack.c (scm_dynstack_push_fluid):
(scm_dynstack_unwind_fluid): Take raw dynstate in these internal
functions.
* libguile/throw.c (catch): Adapt to dynstack changes.
|
|
|
|
|
|
|
|
|
|
|
| |
* libguile/vm-engine.c (fluid-set!): Fix name of opcode to correspond
with name of Tree-IL primitive. Fixes compilation of fluid-set! to
actually use the fluid-set! opcode.
* doc/ref/vm.texi (Dynamic Environment Instructions): Update.
* module/language/cps/compile-bytecode.scm (compile-function): Add
fluid-set! case.
* module/system/vm/assembler.scm: Update export name for
emit-fluid-set!.
|
|
|
|
|
|
| |
* doc/ref/api-data.texi: New section 'Arrays as arrays of
arrays'. Document array-from, array-from*, array-amend!,
array-for-each-cell, array-for-each-cell-in-order.
|
|
|
|
|
|
|
|
|
| |
* doc/ref/api-compound.texi: Remove.
* doc/ref/api-data.texi: Fold "Compound Data Types" and "Simple Data
Types" into just "Data Types". The distinction didn't work.
* doc/ref/guile.texi:
* doc/ref/Makefile.am:
* doc/ref/srfi-modules.texi: Adapt.
|
|
|
|
|
|
| |
* doc/ref/api-scheduling.texi (Threads): Joining a foreign thread is an
error.
* NEWS: Update.
|
|
|
|
| |
* doc/ref/web.texi (open-socket-for-uri): Adjust capitalization.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since importing gnutls directly would result in a dependency cycle,
we load gnutls lazily.
This uses code originally written for Guix by Ludovic Courtès.
* module/web/client.scm: (%http-receive-buffer-size)
(gnutls-module, ensure-gnutls, gnutls-ref, tls-wrap): New variables.
(open-socket-for-uri): Wrap in tls when uri scheme is https.
* doc/ref/web.texi (open-socket-for-uri): Document gnutls usage.
|
|
|
|
| |
* doc/ref/api-scheduling.texi: Fix a couple editing mistakes.
|
|
|
|
|
| |
* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
Update.
|
|
|
|
|
| |
* doc/ref/api-scheduling.texi (Mutexes and Condition Variables): Add
foreboding preface.
|
|
|
|
|
|
|
|
|
|
| |
* doc/ref/srfi-modules.texi (SRFI-18 Threads): Update.
* module/srfi/srfi-18.scm (<mutex>): Add owner field.
(<thread>): New data type.
(make-thread): Adapt for boxed threads.
(thread-start!, thread-terminate!): Likewise.
(mutex-state): Adapt for boxed threads.
(mutex-lock!, mutex-unlock!): Update owner field.
|
|
|
|
|
| |
* doc/ref/srfi-modules.texi (SRFI-18): Update documentation for disjoint
mutexes and cond variables.
|
|
|
|
| |
* doc/ref/api-scheduling.texi (Threads): Fix typo.
|