unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerry Agbobada" <gerry@gagbo.net>
To: "Emacs development discussions." <emacs-devel@gnu.org>
Subject: [feature/native-comp] Segfaulting in push or nreverse ?
Date: Mon, 30 Nov 2020 17:47:10 +0100	[thread overview]
Message-ID: <457a0d97-fdaa-473e-9f7a-257d5792d70c@www.fastmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 612 bytes --]

Hello,

I've been using native-comp for a while and thanks for that. I think I found an issue with a seemingly simple function that only uses basic elisp procedures.

* Issue

When I run a specific rustic.el function while native-compiled, emacs segfaults; whereas if I delete the .eln file (rustic-flycheck.eln) and use the byte-compiled file instead, the function works as advertised.

I've included the basic code to trigger the segfault and the source of the function for easier inspection

* Reproduction

1) Install rustic.el
2) Native compile rustic.el
3) Run emacs -l rustic-segfault.el

Regards,

Gerry

[-- Attachment #1.2: Type: text/html, Size: 910 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rustic-segfault.el --]
[-- Type: text/x-emacs-lisp; name="rustic-segfault.el", Size: 948 bytes --]

(require 'rustic-flycheck)
;; Adds (/tmp/test/foo /tmp/test) unless native-compiled
;; Segfaults when native-compiled
(message "%s" (rustic-flycheck-dirs-list "/tmp/test/foo" "/tmp"))

;; The code
;; (defun rustic-flycheck-dirs-list (start end)
;;   "Return a list of directories from START (inclusive) to END (exclusive).
;; E.g., if START is '/a/b/c/d' and END is '/a', return the list
;; '(/a/b/c/d /a/b/c /a/b) in this order.
;; START and END are strings representing file paths.  END should be
;; above START in the file hierarchy; if not, the list stops at the
;; root of the file hierarchy."
;;   (let ((dirlist)
;;         (dir (expand-file-name start))
;;         (end (expand-file-name end)))
;;     (while (not (or (equal dir (car dirlist)) ; avoid infinite loop
;;                     (file-equal-p dir end)))
;;       (push dir dirlist)
;;       (setq dir (directory-file-name (file-name-directory dir))))
;;     (nreverse dirlist)))


             reply	other threads:[~2020-11-30 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 16:47 Gerry Agbobada [this message]
2020-11-30 20:03 ` [feature/native-comp] Segfaulting in push or nreverse ? Andrea Corallo via Emacs development discussions.

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=457a0d97-fdaa-473e-9f7a-257d5792d70c@www.fastmail.com \
    --to=gerry@gagbo.net \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).