1. 27 Nov, 2020 12 commits
    • Philipp Stephani's avatar
      Fix incorrect handling of module runtime and environment pointers. · 23974cfa
      Philipp Stephani authored
      We used to store module runtime and environment pointers in the static
      lists Vmodule_runtimes and Vmodule_environments.  However, this is
      incorrect because these objects have to be kept per-thread.  With this
      naive approach, interleaving module function calls in separate threads
      leads to environments being removed in the wrong order, which in turn
      can cause local module values to be incorrectly garbage-collected.
      The fix isn't completely trivial: specbinding the lists wouldn't work
      either, because then the garbage collector wouldn't find the
      environments in other threads than the current ones, again leading to
      objects being garbage-collected incorrectly.  While introducing custom
      pseudovector types would fix this, it's simpler to put the runtime and
      environment pointers into the specbinding list as new specbinding
      kinds.  This works since we need to unwind them anyway, and we only
      ever treat the lists as a stack.  The thread switching machinery
      ensures that the specbinding lists are thread-local, and that all
      elements of the specbinding lists in all threads are marked during
      garbage collection.
      Module assertions now have to walk the specbinding list for the
      current thread, which is more correct since they now only find
      environments for the current thread.  As a result, we can now remove
      the faulty Vmodule_runtimes and Vmodule_environments variables
      Also add a unit test that exemplifies the problem.  It interleaves two
      module calls in two threads so that the first call ends while the
      second one is still active.  Without this change, this test triggers
      an assertion failure.
      * src/lisp.h (enum specbind_tag): Add new tags for module runtimes and
      * src/eval.c (record_unwind_protect_module): New function to record a
      module object in the specpdl list.
      (do_one_unbind): Unwind module objects.
      (backtrace_eval_unrewind, default_toplevel_binding, lexbound_p)
      (Fbacktrace__locals): Deal with new specbinding types.
      (mark_specpdl): Mark module environments as needed.
      * src/alloc.c (garbage_collect): Remove call to 'mark-modules'.
      Garbage collection of module values is now handled as part of marking
      the specpdl of each thread.
      * src/emacs-module.c (Fmodule_load, funcall_module): Use specpdl to
      record module runtimes and environments.
      (module_assert_runtime, module_assert_env, value_to_lisp): Walk
      through specpdl list instead of list variables.
      (mark_module_environment): Rename from 'mark_modules'.  Don't attempt
      to walk though current thread's environments only, since that would
      miss other threads.
      (initialize_environment, finalize_environment): Don't change
      Vmodule_environments variable; environments are now in the specpdl
      (finalize_environment_unwind, finalize_runtime_unwind): Make 'extern'
      since do_one_unbind now calls them.
      (finalize_runtime_unwind): Don't change Vmodule_runtimes variable;
      runtimes are now in the specpdl list.
      (syms_of_module): Remove Vmodule_runtimes and Vmodule_environments.
      * test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test
      (emacs_module_init): Bind it.
      * test/src/emacs-module-tests.el (emacs-module-tests--variable): New
      helper type to guard access to state in a thread-safe way.
      (emacs-module-tests--change-variable): New helper functions.
      (emacs-module-tests/interleaved-threads): New unit test.
    • Philipp Stephani's avatar
    • Stefan Monnier's avatar
    • Mattias Engdegård's avatar
      Make the 'cucumber' compilation pattern work without 'omake' · 8ebf041d
      Mattias Engdegård authored
      When 'omake' is included in compilation-error-regexp-alist, which it
      still is by default, then all other rules are modified to match with
      an extra leading 6 spaces as well. The 'cucumber' pattern relied on
      this in order to work as intended.
      * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
      Extend the 'cucumber' pattern so that it works even when 'omake'
      is not included.  Move it below the 'gnu' rule so that it doesn't
      match anything else.
    • Mattias Engdegård's avatar
      Update TUTORIAL.de and TUTORIAL.fr · 48c747e7
      Mattias Engdegård authored
      * etc/tutorials/TUTORIAL.de:
      * etc/tutorials/TUTORIAL.fr: Follow recent changes in TUTORIAL.
    • Stefan Monnier's avatar
    • Stefan Kangas's avatar
      Update TUTORIAL.es · 2b14b7e6
      Stefan Kangas authored
      * etc/tutorials/TUTORIAL.es: A followup to recent changes in
    • Stefan Kangas's avatar
      Update TUTORIAL.sv · 5dba3563
      Stefan Kangas authored
      * etc/tutorials/TUTORIAL.sv: A followup to recent changes in
      TUTORIAL.  Minor tweaks for grammar and style.
    • Juri Linkov's avatar
      Add completion-tab-width to align prefix chars with names in read-char-by-name · 13e032ba
      Juri Linkov authored
      * lisp/international/mule-cmds.el (mule--ucs-names-affixation):
      Replace mule--ucs-names-annotation to display chars in prefixes
      that implements two FIXME items.
      (read-char-by-name): Let-bind completion-tab-width to 4.
      Use affixation-function instead of annotation-function.
      * lisp/minibuffer.el (completion-tab-width): New variable.
      (completion--insert-strings): Align colwidth to tab positions
      when completion-tab-width is non-nil.
      * lisp/simple.el (completion-setup-function): Set tab-width to
      completion-tab-width when completion-tab-width is non-nil.
    • Juri Linkov's avatar
    • Eli Zaretskii's avatar
      Update TUTORIAL.he · 2dd1c2d4
      Eli Zaretskii authored
      * etc/tutorials/TUTORIAL.he: A followup to recent changes in
    • Lars Ingebrigtsen's avatar
      Fix up previous server exit directory deletion · 289a04cd
      Lars Ingebrigtsen authored
      * lisp/server.el (server-start): Only delete the server directory
      if it's in /tmp (bug#44644).
  2. 26 Nov, 2020 7 commits
  3. 25 Nov, 2020 16 commits
  4. 24 Nov, 2020 5 commits