all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Sévère Durand" <mmemmew@gmail.com>
To: 71555@debbugs.gnu.org
Subject: bug#71555: 29.3.50; Native-compilation sets some variable to nil unexpectedly.
Date: Fri, 14 Jun 2024 22:55:56 +0800	[thread overview]
Message-ID: <CAHg+Y3TVe0Ep7B_iDvc4ZgGhS+g8g7h_Vwm9i2Zjj_qzHfv0vA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4471 bytes --]

Hello:

I recently found that sometimes an argument of a function is
unexpectedly set to nil when the function is natively compiled.

A recipe to reproduce the behaviour is as follows.

```elisp
(defun test (&optional start)
  "Test the values of START."
  (message "start is %S" start)
  (cond
   ((not (integer-or-marker-p start))
    (message "entered first cond variant")
    (setq start nil))
   ((and
     (markerp start)
     (not (equal (marker-buffer start) (current-buffer))))
    (message "entered second cond variant")
    (setq start nil)))
  (message "start is %S" start))
(native-compile 'test)
(test 12)
```

When I evaluate the above forms in sequence, I got the following two
messages:

start is 12
start is nil

As can be seen from the above, no `cond` variants are triggered, so the
variable START should have the value 12, while it becomes nil at the
end.

Sorry if this example is not minimal: I found this behaviour in my
package, so copied the relevant parts here.  I am not sure what a
minimal example would be.

Hope this report is helpful.
---
In GNU Emacs 29.3.50 (build 1, x86_64-apple-darwin23.4.0, NS
 appkit-2487.50 Version 14.4.1 (Build 23E224)) of 2024-06-12 built on
 MacBook-Pro-de-Severe.local
Repository revision: 59261e6f4fef0ec03c8127b29fe107ed19280a3b
Repository branch: emacs-29
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.4.1

Configured using:
 'configure --with-ns --without-tree-sitter
 --with-native-compilation=yes'

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XIM ZLIB

Important settings:
  value of $LC_ALL: fr_FR.UTF-8
  value of $LC_COLLATE: fr_FR.UTF-8
  value of $LC_CTYPE: fr_FR.UTF-8
  value of $LC_MESSAGES: fr_FR.UTF-8
  value of $LC_MONETARY: fr_FR.UTF-8
  value of $LC_NUMERIC: fr_FR.UTF-8
  value of $LC_TIME: fr_FR.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils time-date cl-print byte-opt debug
backtrace find-func misearch multi-isearch vc-git diff-mode easy-mmode
vc-dispatcher shortdoc text-property-search thingatpt help-fns
radix-tree format-spec comp comp-cstr warnings icons subr-x rx cl-seq
cl-macs gv cl-extra help-mode cl-loaddefs cl-lib bytecomp byte-compile
face-remap rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind kqueue cocoa ns
lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 115764 6238)
 (symbols 48 8233 1)
 (strings 32 30416 2847)
 (string-bytes 1 896655)
 (vectors 16 21051)
 (vector-slots 8 395280 10306)
 (floats 8 95 77)
 (intervals 56 866 15)
 (buffers 976 16))
---
Durand

[-- Attachment #2: Type: text/html, Size: 5278 bytes --]

             reply	other threads:[~2024-06-14 14:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 14:55 Sévère Durand [this message]
2024-06-16 12:46 ` bug#71555: 29.3.50; Native-compilation sets some variable to nil unexpectedly Gerd Möllmann
2024-06-17  7:25 ` Andrea Corallo
2024-06-17  7:32   ` Sévère Durand
2024-06-17  8:00     ` Andrea Corallo
2024-06-17 14:02       ` Sévère Durand
2024-06-17 14:38         ` Andrea Corallo
2024-06-17 14:41           ` Andrea Corallo
2024-06-17 12:00   ` Eli Zaretskii
2024-06-17 13:15     ` Andrea Corallo
2024-06-17 10:08 ` Mattias Engdegård
2024-06-17 10:15   ` Andrea Corallo
2024-06-17 10:58     ` Mattias Engdegård
2024-06-17 12:04   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHg+Y3TVe0Ep7B_iDvc4ZgGhS+g8g7h_Vwm9i2Zjj_qzHfv0vA@mail.gmail.com \
    --to=mmemmew@gmail.com \
    --cc=71555@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.