bug#46722: test-map-into fails

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Glenn Morris-3
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))



Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Basil L. Contovounesios
Glenn Morris <[hidden email]> 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



Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Stefan Monnier
>> 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




Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Basil L. Contovounesios
Stefan Monnier <[hidden email]> 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


backtrace.el (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Basil L. Contovounesios
"Basil L. Contovounesios" <[hidden email]> 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



Reply | Threaded
Open this post in threaded view
|

bug#46722: test-map-into fails

Glenn Morris-3
In reply to this post by Glenn Morris-3

I've also now seen this failure on the emacs-27 branch, so my initial
comments about revisions are incorrect.