unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / Atom feed
* bug#46722: test-map-into fails
@ 2021-02-23 16:22 Glenn Morris
  2021-02-23 16:33 ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2021-02-23 16:22 UTC (permalink / raw)
  To: 46722

Package: emacs
Version: 28.0.50

Something between 8d5dfaf and efe42c2 (inclusive) causes test-map-into
to reliably fail on hydra.nixos.org. We can't be more specific since
intermediate revisions don't build. So far I could not reproduce the issue.

Ref eg https://hydra.nixos.org/build/137474120

(cl-no-applicable-method map-into ((a . 1) (b . 2)) (hash-table :test equal))





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

* bug#46722: test-map-into fails
  2021-02-23 16:22 bug#46722: test-map-into fails Glenn Morris
@ 2021-02-23 16:33 ` Basil L. Contovounesios
  2021-02-23 17:06   ` Glenn Morris
  2021-02-23 17:30   ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2021-02-23 16:33 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Stefan Monnier, 46722

Glenn Morris <rgm@gnu.org> writes:

> Something between 8d5dfaf and efe42c2 (inclusive) causes test-map-into
> to reliably fail on hydra.nixos.org. We can't be more specific since
> intermediate revisions don't build. So far I could not reproduce the issue.
>
> Ref eg https://hydra.nixos.org/build/137474120
>
> (cl-no-applicable-method map-into ((a . 1) (b . 2)) (hash-table :test equal))

FWIW, I've been working on map.el and map-tests.el since yesterday, and
I occasionally run into this heisenerror locally maybe once in every 50
runs of 'make test/map-tests RET'.

-- 
Basil





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

* bug#46722: test-map-into fails
  2021-02-23 16:33 ` Basil L. Contovounesios
@ 2021-02-23 17:06   ` Glenn Morris
  2021-02-23 17:30   ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2021-02-23 17:06 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Stefan Monnier, 46722


Thanks. Locally I got 3/100 such failures.

(I wish the Emacs test suite was less flaky.
Eg in https://hydra.nixos.org/build/137475263
we have dired-test-bug27243-02 failing as well, apropos of nothing.)





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

* bug#46722: test-map-into fails
  2021-02-23 16:33 ` Basil L. Contovounesios
  2021-02-23 17:06   ` Glenn Morris
@ 2021-02-23 17:30   ` Stefan Monnier
  2021-02-23 20:58     ` Basil L. Contovounesios
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2021-02-23 17:30 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 46722

>> Something between 8d5dfaf and efe42c2 (inclusive) causes test-map-into
>> to reliably fail on hydra.nixos.org. We can't be more specific since
>> intermediate revisions don't build. So far I could not reproduce the issue.
>>
>> Ref eg https://hydra.nixos.org/build/137474120
>>
>> (cl-no-applicable-method map-into ((a . 1) (b . 2)) (hash-table :test equal))
>
> FWIW, I've been working on map.el and map-tests.el since yesterday, and
> I occasionally run into this heisenerror locally maybe once in every 50
> runs of 'make test/map-tests RET'.

This kind of code is supposed to be fully deterministic, so it's quite
worrisome.  It sounds/smells like memory corruption or some other bug in
the memory management.

If you could come up with a reasonably simple code (in the sense that it
doesn't take too long to run) to reproduce this problem with a high
probability, maybe we can start adding some tracing to try and figure
out what's going on.

IOW, try and write a loop that runs the problematic code a couple
hundred times, so that one of those should fail.  Then try and cut down
the code as much as possible, verifying along the way that the problem
didn't disappear.


        Stefan






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

* bug#46722: test-map-into fails
  2021-02-23 17:30   ` Stefan Monnier
@ 2021-02-23 20:58     ` Basil L. Contovounesios
  2021-02-23 22:50       ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2021-02-23 20:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 46722

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

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> This kind of code is supposed to be fully deterministic, so it's quite
> worrisome.  It sounds/smells like memory corruption or some other bug in
> the memory management.
>
> If you could come up with a reasonably simple code (in the sense that it
> doesn't take too long to run) to reproduce this problem with a high
> probability, maybe we can start adding some tracing to try and figure
> out what's going on.
>
> IOW, try and write a loop that runs the problematic code a couple
> hundred times, so that one of those should fail.  Then try and cut down
> the code as much as possible, verifying along the way that the problem
> didn't disappear.

Here's the simplest repro I could find:

  ;;; foo.el -*- lexical-binding: t -*-
  (require 'map)
  (map-into () '(hash-table))
  ;;; foo.el ends here

followed by:

  emacs -Q -batch -f batch-byte-compile foo.el
  while emacs -Q -batch -l foo.elc; do :; done

which barfs the attached after a few seconds.

The same happens with:

  (map-into () '(hash-table :test eq))
  (map-into () '(hash-table :test eql))
  (map-into () '(hash-table :test equal))

but not with:

  (map-into () 'hash-table)

so maybe the heisenbug lies with cl-defmethod's treatment of 'head'?

Let me know if you'd like me to run anything else.

Thanks,

-- 
Basil


[-- Attachment #2: backtrace.el --]
[-- Type: application/emacs-lisp, Size: 4890 bytes --]

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

* bug#46722: test-map-into fails
  2021-02-23 20:58     ` Basil L. Contovounesios
@ 2021-02-23 22:50       ` Basil L. Contovounesios
  0 siblings, 0 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2021-02-23 22:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 46722

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Here's the simplest repro I could find:
>
>   ;;; foo.el -*- lexical-binding: t -*-
>   (require 'map)
>   (map-into () '(hash-table))
>   ;;; foo.el ends here
>
> followed by:
>
>   emacs -Q -batch -f batch-byte-compile foo.el
>   while emacs -Q -batch -l foo.elc; do :; done
>
> which barfs the attached after a few seconds.
>
> The same happens with:
>
>   (map-into () '(hash-table :test eq))
>   (map-into () '(hash-table :test eql))
>   (map-into () '(hash-table :test equal))
>
> but not with:
>
>   (map-into () 'hash-table)
>
> so maybe the heisenbug lies with cl-defmethod's treatment of 'head'?

For some reason looping in Lisp doesn't fail though:

  ;;; foo.el -*- lexical-binding: t -*-
  (require 'map)
  (while (map-into () '(hash-table)))
  ;;; foo.el ends here

when run as:

  emacs -Q -batch -f batch-byte-compile foo.el
  emacs -Q -batch -l foo.elc

I actually forgot I left this running in the background for over an
hour because compilation-finish-functions never ran.

The same happens if I change '-batch -l' to '-script'.

-- 
Basil





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

end of thread, other threads:[~2021-02-23 22:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 16:22 bug#46722: test-map-into fails Glenn Morris
2021-02-23 16:33 ` Basil L. Contovounesios
2021-02-23 17:06   ` Glenn Morris
2021-02-23 17:30   ` Stefan Monnier
2021-02-23 20:58     ` Basil L. Contovounesios
2021-02-23 22:50       ` Basil L. Contovounesios

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git