[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48061: Unexpected result from a native-compiled function
From: |
Alan Mackenzie |
Subject: |
bug#48061: Unexpected result from a native-compiled function |
Date: |
Tue, 27 Apr 2021 14:49:31 +0000 |
Hello, Emacs.
In certain circumstances (see below for recipe), the natively compiled
version of c-determine-limit-no-macro returns an invalid result, nil.
In the same circumstances, the edebug instrumented version returns the
correct result, a buffer position.
So far I have tried M-x disassemble RET c-determine-limit-no-macro, but
I wasn't able to follow the output (there were no symbols in the
listing).
Question: what else can I do to help isolate and fix this bug?
Recipe for reproduction:
In GNU Emacs 28.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version
3.24.26, cairo version 1.16.0)
of 2021-04-25 built on ACM
Repository revision: 83a915d3dfafd5f3d737afe1e13b75e4dd3aef96
Repository branch: master
System Description: Gentoo/Linux
Configured using:
'configure --with-gif=no --with-tiff=no --with-gpm
--with-native-compilation'
(i) emacs -Q
(ii) Make sure CC Mode is natively compiled and loaded into an Emacs
session.
(iii) Evaluate the following (an attempt to time CC Mode's indentation
speed):
(defmacro time-it (&rest forms)
"Time the running of a sequence of forms using `float-time'.
Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"."
`(let ((start (float-time)))
,@forms
(- (float-time) start)))
(defun time-indent ()
(interactive)
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(delete-horizontal-space)
(beginning-of-line 2))
(goto-char (point-min))
(message "%s"
(time-it
(while (not (eobp))
(c-indent-line)
(beginning-of-line 2))))))
(iv) Load src/minibuf.c into a buffer.
(v) M-: (time-indent) RET
This throws an error at line 606 in minibuf.c. point is at 16972, at
BOL.
(vi) With the current buffer minibuf.c, M-: (c-determine-limit-no-macro
16367 16972) RET. This returns the invalid result nil. This looks like
a bug.
(vii) Load lisp/progmodes/cc-engine.el into another buffer. Move to the
definition of c-determine-limit-no-macro at line 5795. Instrument the
function for edebug with C-u C-M-x.
(viii) M-: (c-determine-limit-no-macro 16367 16972) RET, followed by the
edebug command c. This indicates the expected result 16350, which is
different from the nil returned in (vi).
--
Alan Mackenzie (Nuremberg, Germany).
- bug#48061: Unexpected result from a native-compiled function,
Alan Mackenzie <=