summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-03-10Guile 2.1.8.v2.1.8Andy Wingo1-1/+1
* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.
2017-03-10Revert "Fix "Scheme Syntax" info rendering"Andy Wingo1-2/+2
This reverts commit 62f08b8f38990c1849ea61cd622f84b3d2611cd9, which was causing failing texi2dvi runs.
2017-03-10Update NEWSAndy Wingo1-2/+10
* NEWS: Update for 2.1.8.
2017-03-10Fix atomics compilation on clangAndy Wingo1-8/+19
* libguile/atomics-internal.h (scm_atomic_subtract_uint32): (scm_atomic_compare_and_swap_uint32, scm_atomic_set_pointer): (scm_atomic_ref_pointer, scm_atomic_set_scm): (scm_atomic_ref_scm, scm_atomic_swap_scm): (scm_atomic_compare_and_swap_scm): Use C11 atomic types if we have loaded C11 stdatomic.h.
2017-03-09Fix a couple of typos in the docsVladislav Ivanishin2-2/+2
* 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).
2017-03-09VM support for string-set!; slimmer read-stringAndy Wingo7-11/+57
* 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!.
2017-03-09Micro-optimize update-port-position.Andy Wingo1-3/+5
* libguile/ports.c (update_port_position): Only fetch line if we need to increment it.
2017-03-09Fix bug in comparison between real and complexDaniel Llorens2-6/+17
This bug was introduced by 35a90592501ebde7e7ddbf2486ca9d315e317d09. * module/language/cps/specialize-numbers.scm (specialize-operations): Check that both operands are real as a condition for specialize-f64-comparison. * test-suite/tests/numbers.test: Add test.
2017-03-09Remove contification restriction in case-lambdaAndy Wingo2-31/+12
* module/language/cps/compile-bytecode.scm (compile-function): Check for fallthrough after $kclause too; possible to need to jump if clause tails are contified. * module/language/cps/contification.scm (compute-contification-candidates): Enable inter-clause contification.
2017-03-09All clauses of function have same nlocalsAndy Wingo2-33/+25
* module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/slot-allocation.scm ($allocation) (lookup-nlocals, compute-frame-size, allocate-slots): Adapt to have one frame size per function, for all clauses.
2017-03-09Adapt gcprof to preemptive interruptsAndy Wingo1-4/+4
* module/statprof.scm (gcprof): Remove handle-interrupts trampoline from captured stacks.
2017-03-09Adapt statprof to new preemptive interruptsAndy Wingo1-2/+4
* module/statprof.scm (profile-signal-handler): Cut an additional stack frame, corresponding to the handle-interrupts trampoline added recently.
2017-03-09statprof: 'with-statprof' honors #:display-style.Ludovic Courtès1-1/+5
* module/statprof.scm (with-statprof): Pass #:display-style to 'statprof'.
2017-03-0864KB segment alignmentAndy Wingo2-4/+50
* module/system/vm/linker.scm (*lcm-page-size*): Rename from *page-size*, change to 64 KB. * libguile/loader.c (load_thunk_from_memory): Only require page size alignment, knowing that although Guile might emit ELF with 64k alignment, it only really needs page alignment.
2017-03-07Fix new thread-local fluids testAndy Wingo1-1/+1
* test-suite/tests/fluids.test ("dynamic states"): Fix test.
2017-03-07Fix documentation buildAndy Wingo1-1/+1
* doc/ref/api-control.texi (Fluids and Dynamic States): Fix link.
2017-03-07Add thread local fluidsAndy Wingo9-32/+125
* 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.
2017-03-07psyntax: Generate identifiers in a deterministic fashion.Mark H Weaver5-50/+143
Fixes <http://bugs.gnu.org/20272>. * module/ice-9/boot-9.scm (module-generate-unique-id!) (module-gensym): New procedures. (module): Add 'next-unique-id' field. (the-root-module): Inherit 'next-unique-id' value from early stub. (make-module, make-autoload-interface): Adjust calls to module-constructor. * module/ice-9/psyntax.scm (gen-label, new-mark): Generate unique identifiers from the module name and the per-module unique-id. (build-lexical-var, generate-temporaries): Use 'module-gensym' instead of 'gensym'. * module/ice-9/psyntax-pp.scm: Regenerate. * module/language/tree-il/fix-letrec.scm (fix-letrec!): Use 'module-gensym' instead of 'gensym'. * module/system/base/syntax.scm (define-record): Likewise. (transform-record): Likewise. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-03-06Check for working profiling and virtual itimersMike Gran7-55/+148
* 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
2017-03-05Can't recursively search DLLs with FFI on CygwinMike Gran4-7/+40
* 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
2017-03-04Disable Turkish locale tests on CygwinMike Gran1-2/+3
Cygwin's support of Turkish casing rules is broken. * test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): modified
2017-03-03Fix regression in non-mmap fallback elf loaderMike Gran1-6/+6
* libguile/loader.c [!HAVE_SYS_MMAN_H] (map_file_contents): updated variables and function calls to the current names
2017-03-03Cygwin: skip tests that require working setrlimits for memoryMike Gran2-1/+17
On Cygwin, setrlimits cannot be used to set total memory availabe for a process. * test-suite/standalone/test-out-of-memory: skip for cygwin * test-suite/standalone/test-stack-overflow: skip for cygwin
2017-03-02Revert "build: Compress with lzip too."Andy Wingo1-1/+1
This reverts commit 89ce9fb31b00f1f243fe6f2450db50372cc0b86d. It was causing the hydra builds to fail.
2017-03-01Fix makeinfo warningsAndy Wingo2-3/+3
* doc/ref/api-languages.texi (Nil): * doc/ref/statprof.texi (Statprof): Use headings instead of sections to avoid makeinfo warnings.
2017-03-01Remove useless subsection from hooks documentationAndy Wingo1-14/+0
* doc/ref/api-utility.texi (Hook Reference): Remove useless "handling hooks from C" section that was also generating warnings.
2017-03-01Fix scheme-scripts markup.Andy Wingo1-1/+1
* doc/ref/scheme-scripts.texi (Scripting Examples): Fix $@ rendering in texinfo.
2017-03-01Update NEWS for prerelease.Andy Wingo1-0/+35
* NEWS: Update for next prerelease.
2017-03-01Update NEWSAndy Wingo1-86/+86
* NEWS: Update 2.0.x NEWS. Fold 2.1.7 NEWS into main 2.2 body.
2017-03-01doc: Describe -e (module) on equal footing with (@ ...).Arne Babenhauserheide2-8/+72
* 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>
2017-03-01i18n: 'number->locale-string' guesses the minimum number of decimals.Ludovic Courtès4-28/+44
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.
2017-03-01i18n: Fix corner cases for monetary and number string conversions.Ludovic Courtès3-30/+88
Fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (integer->string, number-decimal-string): New procedures. (monetary-amount->locale-string): Use them instead of 'number->string' followed by 'string-split'. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["fraction"]: Add second argument to 'number->locale-string'. ["fraction, 1 digit"]: Round up. ["fraction, 10 digits", "trailing zeros", "negative integer"]: New tests. * test-suite/tests/i18n.test ("format ~h"): Pass the number of decimals for ~h. ("monetary-amount->locale-string")["French"]: Always expect two decimals after the comma. ["one cent", "very little money"]: New tests. * test-suite/tests/format.test ("~h localized number")["1234.5"]: Specify the number of decimals explicitly. ["padding"]: Expect zero decimals. ["padchar"]: Ask for one decimal. ["decimals", "locale"]: Adjust rounding.
2017-03-01tests: Choose a more plausible US English locale name.Ludovic Courtès1-1/+1
* test-suite/tests/i18n.test (%american-english-locale-name): Change to en_US.utf8".
2017-03-01tests: Use 'pass-if-equal' for (ice-9 i18n) tests.Ludovic Courtès1-34/+40
* test-suite/tests/i18n.test ("number->locale-string") ("format ~h", "monetary-amount->locale-string"): Use 'pass-if-equal' instead of 'pass-if'.
2017-03-01i18n: Do not represent zero as "-0".Ludovic Courtès2-6/+18
Partly fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (monetary-amount->locale-string): Don't negate AMOUNT when it's zero. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["positive inexact zero, 1 digit"]: New test. ("monetary-amount->locale-string")["positive inexact zero"]: New test.
2017-03-01Recognize sh3 as compilation targetsJohn Paul Adrian Glaubitz1-2/+2
* module/system/base/target.scm (cpu-endianness, triplet-pointer-size): Add case for "sh3". Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01doc: Fix typo in site packages documentation.Georgi Kirilov1-1/+1
* doc/ref/scheme-using.texi (Installing Site Packages): Fix typo Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01doc: Fix typo in keywords documentation.Georgi Kirilov1-1/+1
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-03-01tests: Avoid statprof test failure on systems without 'setitimer'.Ludovic Courtès1-11/+12
Partly fixes <http://bugs.gnu.org/25463>. Reported by rennes@openmailbox.org. * test-suite/tests/statprof.test ("return values"): Wrap in 'when-implemented'.
2017-03-01build: Honor $SOURCE_DATE_EPOCH for the recorded timestamp.Ludovic Courtès1-1/+2
Reported by Jan Nieuwenhuizen <janneke@gnu.org> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20272#36>. * libguile/Makefile.am (libpath.h): Honor 'SOURCE_DATE_EPOCH'.
2017-03-01scandir: Avoid 'stat' calls on each entry.Ludovic Courtès1-32/+26
* module/ice-9/ftw.scm (scandir): Rewrite in terms of 'readdir'.
2017-03-01build: Compress with lzip too.Ludovic Courtès1-1/+1
* configure.ac: Add 'dist-lzip' Automake option.
2017-03-01build: Check for /gnu/store file names upon "make dist".Ludovic Courtès1-2/+12
* Makefile.am (assert-no-store-file-names): New rule, taken from Guix. (dist-hook): Depend on it.
2017-03-01Disable REPL server tests if no threadsAndy Wingo1-1/+7
* test-suite/tests/00-repl-server.test (call-with-repl-server): The REPL server needs threads so don't bother testing if we have no threads. Also, prevent SIGPIPE from killing the parent process.
2017-03-01tests: Avoid race condition in REPL server test.Ludovic Courtès1-2/+8
Fixes <http://bugs.gnu.org/24769>. Reported by Rob Browning <rlb@defaultvalue.org>. * test-suite/tests/00-repl-server.test ("simple expression"): Add call to 'select' before 'display'.
2017-03-01tests: Throw 'unresolved when the REPL server is too slow.Ludovic Courtès1-4/+5
* test-suite/tests/00-repl-server.test (call-with-repl-server): Use (usleep 100) instead of (sleep 1). Throw 'unresolved when TRIES is too high.
2017-03-01tests: Add REPL server test for CVE-2016-8606.Ludovic Courtès2-0/+140
This is a followup to 08c021916dbd3a235a9f9cc33df4c418c0724e03. * test-suite/tests/00-repl-server.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
2017-03-01REPL Server: Guard against HTTP inter-protocol exploitation attacks.Mark H Weaver3-9/+203
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".
2017-03-01tests: Use the "normalized codeset" in locale names.Ludovic Courtès1-6/+6
* test-suite/tests/i18n.test (%french-locale-name) (%french-utf8-locale-name, %turkish-utf8-locale-name) (%german-utf8-locale-name, %greek-utf8-locale-name): Use the normalized codeset for ISO-8859-1 and UTF-8.
2017-03-01Treat 'SIG_IGN' as a pointer.Ludovic Courtès1-3/+5
* libguile/posix.c (scm_system_star): Cast 'SIG_IGN' to 'scm_t_uintptr_t' and use 'scm_from_uintptr_t'. This fixes an 'int-conversion' warning with GCC 6.2.