bug#42660: emacs-27.1-rc1 and UBsan findings

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

bug#42660: emacs-27.1-rc1 and UBsan findings

Jeffrey Walton-3
I believe these additional failures are due to -fsanitize=undefined
-fno-sanitize-recover=all.

SUMMARY OF TEST RESULTS
-----------------------
Files examined: 267
Ran 3850 tests, 7 failed to run, 3763 results as expected, 1
unexpected, 86 skipped
1 files did not contain any tests:
  src/emacs-module-tests.log
1 files did not finish:
  lisp/international/ccl-tests.log
1 files contained unexpected results:
  lisp/cedet/srecode-utest-template.log
Makefile:319: recipe for target 'check-doit' failed
make[2]: *** [check-doit] Error 2
make[2]: Leaving directory '/home/jwalton/Build-Scripts/emacs-27.1/test'
Makefile:289: recipe for target 'check' failed
make[1]: *** [check] Error 2
make[1]: Leaving directory '/home/jwalton/Build-Scripts/emacs-27.1/test'
Makefile:959: recipe for target 'check' failed
make: *** [check] Error 2

Here's a typical failure:

$ cat emacs-27.1/test/lisp/international/ccl-tests.log
Running 7 tests (2020-08-01 16:28:12-0400, selector `(not (or (tag
:expensive-test) (tag :unstable)))')
   passed  1/7  ccl-compile-midi (0.000181 sec)
   passed  2/7  ccl-compile-pgg (0.000093 sec)
   passed  3/7  ccl-dump-midi (0.005956 sec)
   passed  4/7  ccl-dump-pgg (0.000111 sec)
Package pgg-def is deprecated
Package pgg-parse is deprecated
Package pgg is deprecated
ccl.c:1146:29: runtime error: left shift of 1246883553 by 1 places
cannot be represented in type 'int'

config.log.zip (59K) Download Attachment
test-suite.log.zip (195K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#42660: emacs-27.1-rc1 and UBsan findings

Lars Ingebrigtsen
Jeffrey Walton <[hidden email]> writes:

> $ cat emacs-27.1/test/lisp/international/ccl-tests.log
> Running 7 tests (2020-08-01 16:28:12-0400, selector `(not (or (tag
> :expensive-test) (tag :unstable)))')
>    passed  1/7  ccl-compile-midi (0.000181 sec)
>    passed  2/7  ccl-compile-pgg (0.000093 sec)
>    passed  3/7  ccl-dump-midi (0.005956 sec)
>    passed  4/7  ccl-dump-pgg (0.000111 sec)
> Package pgg-def is deprecated
> Package pgg-parse is deprecated
> Package pgg is deprecated
> ccl.c:1146:29: runtime error: left shift of 1246883553 by 1 places
> cannot be represented in type 'int'

I get the same, basically:

Running 7 tests (2020-08-10 00:55:35+0200, selector `(not (tag :unstable))')
   passed  1/7  ccl-compile-midi (0.000614 sec)
   passed  2/7  ccl-compile-pgg (0.000371 sec)
   passed  3/7  ccl-dump-midi (0.001032 sec)
   passed  4/7  ccl-dump-pgg (0.000531 sec)
Package pgg-def is deprecated
Package pgg-parse is deprecated
Package pgg is deprecated
ccl.c:1153:29: runtime error: left shift of 1239426054 by 1 places cannot be represented in type 'int'
make[1]: *** [Makefile:183: lisp/international/ccl-tests.log] Error 1

This is the test that fails:

(ert-deftest pgg-parse-crc24 ()
  ;; Compiler
  (require 'pgg)
  (should (equal pgg-parse-crc24 prog-pgg-code))
  ;; Interpreter
  (should (equal (pgg-parse-crc24-string "foo") (concat [#x4f #xc2 #x55])))
  (should (equal (pgg-parse-crc24-string "bar") (concat [#x51 #xd9 #x53])))
  (should (equal (pgg-parse-crc24-string "baz") (concat [#xf0 #x58 #x6a]))))

All three of those pgg-parse calls make Emacs signal a runtime error
with this checking turned on.

So this is with:

CFLAGS="-fsanitize=undefined -fno-sanitize-recover=all" ./configure && make

Now, pgg is obsolete, so that's a test that probably should go away.
So is this a bug?  The thing that fails is this:

            case CCL_LSH: reg[rrr] <<= i; break;

So it's doing a left shift on a too-high number...  which is something
that pgg does, but since that's obsolete, do we care?

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no