unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
@ 2020-11-30 19:56 Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-30 19:56 UTC (permalink / raw)
  To: 44968; +Cc: Gerry Agbobada

Reported by Gerry Agbobada,

reproducer:

============
;; -*- lexical-binding: t -*-

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

(native-compile #'rustic-flycheck-dirs-list)

(message "%s" (rustic-flycheck-dirs-list "/tmp/test/foo" "/tmp"))

===========






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

* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
  2020-11-30 19:56 bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list' Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-30 23:37   ` Gerry Agbobada
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-30 23:19 UTC (permalink / raw)
  To: Gerry Agbobada; +Cc: 44968

Hi Gerry,

21104e6808 fix this for me.

Would you like to give it a try and confirm?

Thanks!

  Andrea





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

* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
  2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-30 23:37   ` Gerry Agbobada
  2020-12-01  9:14     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Gerry Agbobada @ 2020-11-30 23:37 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 44968

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

On Tue, Dec 1, 2020, at 00:19, Andrea Corallo wrote:
> 
> 21104e6808 fix this for me.
> 
> Would you like to give it a try and confirm?
> 
Hi Andrea,

I’ll try, although I must admit that I’ve been using Andrew’s build recipe, so it might take me longer to build from source again to check.

Thanks for the help, I’ll look at the commit to see if I understand something :)

Gerry 

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

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

* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
  2020-11-30 23:37   ` Gerry Agbobada
@ 2020-12-01  9:14     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-12-01 11:07       ` Gerry Agbobada
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-12-01  9:14 UTC (permalink / raw)
  To: Gerry Agbobada; +Cc: 44968

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

> Thanks for the help, I’ll look at the commit to see if I understand something :)

Dumping Limple (setf comp-verbose 3) we can see how the call to `car'
as:

(call car #s(comp-mvar (cons) (nil) nil 15178090 6))

(cons) is the typeset slot of the mvar, (nil) is the valset.
This implies the the mvar may be during execution *or* a cons *or*
assume value nil.

Hence the fix to `comp-mvar-cons-p' in the commit.

Without this `comp-mvar-cons-p' was returning t and the backend was
erroneously generating code on this false assumption.  Indeed at the
first iteration of your reproducer the argument of car is nil and not a
cons, and so the crash.

  Andrea





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

* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
  2020-12-01  9:14     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-12-01 11:07       ` Gerry Agbobada
  2020-12-01 13:16         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Gerry Agbobada @ 2020-12-01 11:07 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: 44968

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

On Tue, Dec 1, 2020, at 10:14, Andrea Corallo wrote:
> (call car #s(comp-mvar (cons) (nil) nil 15178090 6))
> 

Hello,

I see, thanks for the explanation and the quick fix :) (I tested today and the commit works well)

Have a good day,

Gerry

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

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

* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
  2020-12-01 11:07       ` Gerry Agbobada
@ 2020-12-01 13:16         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 6+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-12-01 13:16 UTC (permalink / raw)
  To: Gerry Agbobada; +Cc: 44968-done

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

> On Tue, Dec 1, 2020, at 10:14, Andrea Corallo wrote:
>
>  (call car #s(comp-mvar (cons) (nil) nil 15178090 6))
>
> Hello,
>
> I see, thanks for the explanation and the quick fix :) (I tested today and the commit works well)

Thanks for checking, closing then.

Andrea





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

end of thread, other threads:[~2020-12-01 13:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30 19:56 bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list' Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-30 23:37   ` Gerry Agbobada
2020-12-01  9:14     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-01 11:07       ` Gerry Agbobada
2020-12-01 13:16         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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