unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [feature/native-comp] Segfaulting in push or nreverse ?
@ 2020-11-30 16:47 Gerry Agbobada
  2020-11-30 20:03 ` Andrea Corallo via Emacs development discussions.
  0 siblings, 1 reply; 2+ messages in thread
From: Gerry Agbobada @ 2020-11-30 16:47 UTC (permalink / raw)
  To: Emacs development discussions.


[-- 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)))


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [feature/native-comp] Segfaulting in push or nreverse ?
  2020-11-30 16:47 [feature/native-comp] Segfaulting in push or nreverse ? Gerry Agbobada
@ 2020-11-30 20:03 ` Andrea Corallo via Emacs development discussions.
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Corallo via Emacs development discussions. @ 2020-11-30 20:03 UTC (permalink / raw)
  To: Gerry Agbobada; +Cc: Emacs development discussions.

"Gerry Agbobada" <gerry@gagbo.net> writes:

> 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

Hi Gerry,

thanks for the bug report and for having already isolated the offending
function.  This looks fun :)

I've opened bug#44968 [1] so we can handle it there and we have record
of it.

  Andrea

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44968



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-30 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 16:47 [feature/native-comp] Segfaulting in push or nreverse ? Gerry Agbobada
2020-11-30 20:03 ` Andrea Corallo via Emacs development discussions.

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).