all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* make check fails? (emacs-26.1 w/modules)
@ 2018-09-03 14:39 Greg Minshall
  2018-09-03 15:12 ` Greg Minshall
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-03 14:39 UTC (permalink / raw)
  To: emacs-devel

hi.  from git://git.sv.gnu.org/emacs.git i've checked out emacs-26.1.  i
configure with modules, to wit:
: ./configure --with-xwidgets --with-modules --without-dbus

"make" works, but "make check" fails:

----
  CCLD     data/emacs-module/mod-test.so
  ELC      src/emacs-module-tests.elc

In toplevel form:
src/emacs-module-tests.el:32:1:Error: Loading file /home/minshall/src/import/emacs/git/emacs/lisp/emacs-lisp/ert.elc failed to provide feature `mod-test'
Makefile:148: recipe for target 'src/emacs-module-tests.elc' failed
make[3]: *** [src/emacs-module-tests.elc] Error 1
make[3]: Target 'src/emacs-module-tests.log' not remade because of errors.
----

(i think, btw, the pointer at ".../ert.elc" is misguided; see
parenthetical a bit below.)

if i do the following:

----
mod-test-file
"/home/minshall/src/import/emacs/git/emacs/test/data/emacs-module/mod-test"

(require 'mod-test mod-test-file)
----

i get an error

----
Debugger entered--Lisp error: (error "Loading file
/usr/local/share/emacs/26.1/lisp/vc/log-edit.elc failed to provide
feature ‘mod-test’")
----

(as noted above, note the seemingly random reference to log-edit.elc.)

the only thing i notice odd is that test/data/emacs-module/mod-test.c,
when (presumably) registering, calls : provide (env, "mod-test"); rather
than some variant of Fprovide().  but, since i don't really know how
modules are expected to behave, i can't really say.

any clues would be gratefully imbibed.

cheers, Greg

ps -- if there's some politer, prettier way to interleave code/results
with e-mail text, i'd be interested to hear.  i find my style a bit hard
to parse.



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 14:39 make check fails? (emacs-26.1 w/modules) Greg Minshall
@ 2018-09-03 15:12 ` Greg Minshall
  2018-09-03 15:13 ` Eli Zaretskii
  2018-09-03 18:27 ` Paul Eggert
  2 siblings, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-03 15:12 UTC (permalink / raw)
  Cc: emacs-devel

oops.  i take back my one observation:

> the only thing i notice odd is that test/data/emacs-module/mod-test.c,
> when (presumably) registering, calls : provide (env, "mod-test"); rather
> than some variant of Fprovide().  but, since i don't really know how
> modules are expected to behave, i can't really say.

as it turns out, provide() is provided in mod-test.c itself, as a
wrapper for, essentially, Qprovide(), which i guess to be correct.

btw, i should have mentioned that the dynamic library for mod-test
appears to exist, have emacs_module_init in it:

----
bash minshall-apollo: {1184} ls -l test/data/emacs-module/mod-test.so
-rwxrwxr-x 1 minshall minshall 68712 Sep  3 17:23 test/data/emacs-module/mod-test.so*
bash minshall-apollo: {1185} nm test/data/emacs-module/mod-test.so | grep emacs_module_init
0000000000000ee0 T emacs_module_init
----

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 14:39 make check fails? (emacs-26.1 w/modules) Greg Minshall
  2018-09-03 15:12 ` Greg Minshall
@ 2018-09-03 15:13 ` Eli Zaretskii
  2018-09-03 15:16   ` Greg Minshall
                     ` (2 more replies)
  2018-09-03 18:27 ` Paul Eggert
  2 siblings, 3 replies; 21+ messages in thread
From: Eli Zaretskii @ 2018-09-03 15:13 UTC (permalink / raw)
  To: Greg Minshall; +Cc: emacs-devel

> From: Greg Minshall <minshall@acm.org>
> Date: Mon, 03 Sep 2018 17:39:14 +0300
> 
> hi.  from git://git.sv.gnu.org/emacs.git i've checked out emacs-26.1.

What exactly do you mean by "checked out emacs-26.1"?  Is this the tip
of the emacs-26 branch, or is that something else?

> i configure with modules, to wit:
> : ./configure --with-xwidgets --with-modules --without-dbus
> 
> "make" works, but "make check" fails:
> 
> ----
>   CCLD     data/emacs-module/mod-test.so
>   ELC      src/emacs-module-tests.elc
> 
> In toplevel form:
> src/emacs-module-tests.el:32:1:Error: Loading file /home/minshall/src/import/emacs/git/emacs/lisp/emacs-lisp/ert.elc failed to provide feature `mod-test'
> Makefile:148: recipe for target 'src/emacs-module-tests.elc' failed
> make[3]: *** [src/emacs-module-tests.elc] Error 1
> make[3]: Target 'src/emacs-module-tests.log' not remade because of errors.

Doesn't happen here with the current tip of the emacs-26 branch.



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 15:13 ` Eli Zaretskii
@ 2018-09-03 15:16   ` Greg Minshall
  2018-09-03 15:18   ` Greg Minshall
  2018-09-04 10:39   ` Greg Minshall
  2 siblings, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-03 15:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli,

> What exactly do you mean by "checked out emacs-26.1"?  Is this the tip
> of the emacs-26 branch, or is that something else?

: git checkout emacs-26.1

'git status' reports

: HEAD detached at emacs-26.1

(i'm only vaguely git-literate, but hopefully i did this right.)

Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 15:13 ` Eli Zaretskii
  2018-09-03 15:16   ` Greg Minshall
@ 2018-09-03 15:18   ` Greg Minshall
  2018-09-04 10:39   ` Greg Minshall
  2 siblings, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-03 15:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli,

> Doesn't happen here with the current tip of the emacs-26 branch.

sorry, i should have included

----
bash minshall-apollo: {1188} uname -a
Linux minshall-apollo.minshall.org 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
bash minshall-apollo: {1189} lsb_release -a
LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
----

up to date (apt-get update; apt-get upgrade)-wise.

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 14:39 make check fails? (emacs-26.1 w/modules) Greg Minshall
  2018-09-03 15:12 ` Greg Minshall
  2018-09-03 15:13 ` Eli Zaretskii
@ 2018-09-03 18:27 ` Paul Eggert
  2018-09-03 23:46   ` Greg Minshall
  2 siblings, 1 reply; 21+ messages in thread
From: Paul Eggert @ 2018-09-03 18:27 UTC (permalink / raw)
  To: Greg Minshall, emacs-devel

Greg Minshall wrote:

> "make" works, but "make check" fails:

Are you using sequential make, or parallel make (e.g., 'make -j check', or -j 
somewhere in your environment)?



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 18:27 ` Paul Eggert
@ 2018-09-03 23:46   ` Greg Minshall
  0 siblings, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-03 23:46 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Paul,

thanks.  it's very repeatable.  and, the emacs-module example
----
http://diobla.info/blog-archive/modules-tut.html
----
fails in my emacs.

i'll continue trying to track it down.  presumably something messed up
in my environment; i'll report.

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-03 15:13 ` Eli Zaretskii
  2018-09-03 15:16   ` Greg Minshall
  2018-09-03 15:18   ` Greg Minshall
@ 2018-09-04 10:39   ` Greg Minshall
  2018-09-05  7:54     ` Paul Eggert
  2 siblings, 1 reply; 21+ messages in thread
From: Greg Minshall @ 2018-09-04 10:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

um, err.  you know how it is.  you're gdb'ing through ./src, setting
breakpoints, examining data, getting a sense of the control flow,
generally having a grand old time.

but, it's hard, and getting annoying, trying to see, navigate, through
the optimizer.  so, you change src/Makefile's CFLAGS to remove the -O2,
touch the file you're currently looking at -- which just happened to be
src/emacs-module.c -- recompile, start up gdb again, and
----
make[3]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test'

SUMMARY OF TEST RESULTS
-----------------------
Files examined: 186
Ran 2601 tests, 2582 results as expected, 19 skipped
make[2]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test'
make[1]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test'
----

so, the optimizer.  i turned back on -O2, recompiled emacs-module.c, and
asked gdb to kindly disassemble module_intern() for me (as that function
was on the path i was ascending):
----
(gdb) disassemble module_intern
Dump of assembler code for function module_intern:
   0x0000000000592370 <+0>:     push   %rbx
   0x0000000000592371 <+1>:     mov    %rdi,%rbx
   0x0000000000592374 <+4>:     callq  0x592180 <module_assert_thread>
   0x0000000000592379 <+9>:     cmpb   $0x0,0x66ae08(%rip)        # 0xbfd188 <module_assertions>
   0x0000000000592380 <+16>:    je     0x59238a <module_intern+26>
   0x0000000000592382 <+18>:    mov    %rbx,%rdi
   0x0000000000592385 <+21>:    callq  0x592240 <module_assert_env>
   0x000000000059238a <+26>:    mov    %rbx,%rdi
   0x000000000059238d <+29>:    callq  0x592340 <module_non_local_exit_check>
   0x0000000000592392 <+34>:    xor    %eax,%eax
   0x0000000000592394 <+36>:    pop    %rbx
   0x0000000000592395 <+37>:    retq
End of assembler dump.
----
well, *that's* definitely optimized.

here's my compiler:
----
bash minshall-apollo: {1294} gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
----

admittedly pretty old, but that's apparently what ubuntu's serving up
these days.

i guess it's always possible the optimizer is doing the right thing
because of some programming error, maybe a mis-placed "const" on an
extern, something like that.

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-04 10:39   ` Greg Minshall
@ 2018-09-05  7:54     ` Paul Eggert
  2018-09-05  9:14       ` Greg Minshall
  2018-09-05 20:26       ` Greg Minshall
  0 siblings, 2 replies; 21+ messages in thread
From: Paul Eggert @ 2018-09-05  7:54 UTC (permalink / raw)
  To: Greg Minshall, Eli Zaretskii; +Cc: emacs-devel

Greg Minshall wrote:
> admittedly pretty old, but that's apparently what ubuntu's serving up
> these days.

It depends on the Ubuntu release. My Ubuntu 18.04 machine is running gcc (Ubuntu 
7.3.0-16ubuntu3). I don't observe the symptoms you're seeing, when I build on 
the emacs-26 branch and use './configure --with-modules'.

> i guess it's always possible the optimizer is doing the right thing
> because of some programming error, maybe a mis-placed "const" on an
> extern, something like that.

Doesn't sound likely. The assembly code you sent looks fishy, though. You might 
try running gcc -S and/r gcc -E on the affected module, with the same 
compile-time flags that 'make' is using; use 'make V=1' to see them.



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05  7:54     ` Paul Eggert
@ 2018-09-05  9:14       ` Greg Minshall
  2018-09-05 20:26       ` Greg Minshall
  1 sibling, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-05  9:14 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

Paul,

> 'make V=1'

thanks.  i noticed there was some way of getting more verbose output
from the makefiles, and intended to search it out, to do a -S and a -E.

below is what i get from 'make V=1', in case anything jumps out at you.
i'll continue probing, report if/what i find.

cheers, Greg
----

gcc -c -Demacs -I. -I. -I../lib -I../lib -pthread -isystem \
    /usr/include/gtk-3.0 -isystem /usr/include/at-spi2-atk/2.0 -isystem \
    /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem \
    /usr/lib/x86_64-linux-gnu/dbus-1.0/include -isystem \
    /usr/include/gtk-3.0 -isystem /usr/include/gio-unix-2.0/ -isystem \
    /usr/include/mirclient -isystem /usr/include/mircore -isystem \
    /usr/include/mircookie -isystem /usr/include/cairo -isystem \
    /usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem \
    /usr/include/pango-1.0 -isystem /usr/include/atk-1.0 -isystem \
    /usr/include/cairo -isystem /usr/include/pixman-1 -isystem \
    /usr/include/freetype2 -isystem /usr/include/libpng12 -isystem \
    /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/libpng12 -isystem \
    /usr/include/glib-2.0 -isystem \
    /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem \
    /usr/include/freetype2 -isystem /usr/include/alsa -pthread -isystem \
    /usr/include/librsvg-2.0 -isystem /usr/include/gdk-pixbuf-2.0 -isystem \
    /usr/include/libpng12 -isystem /usr/include/cairo -isystem \
    /usr/include/glib-2.0 -isystem \
    /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem \
    /usr/include/pixman-1 -isystem /usr/include/freetype2 -isystem \
    /usr/include/libpng12 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 \
    -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 \
    -DMAGICKCORE_QUANTUM_DEPTH=16 -isystem \
    /usr/include/x86_64-linux-gnu/ImageMagick-6 -isystem \
    /usr/include/ImageMagick-6 -isystem \
    /usr/include/x86_64-linux-gnu/ImageMagick-6 -isystem \
    /usr/include/ImageMagick-6 -isystem /usr/include/libpng12 -isystem \
    /usr/include/libxml2 -pthread -isystem \
    /usr/local/include/webkitgtk-4.0 -isystem /usr/include/gtk-3.0 \
    -isystem /usr/include/at-spi2-atk/2.0 -isystem /usr/include/at-spi-2.0 \
    -isystem /usr/include/dbus-1.0 -isystem \
    /usr/lib/x86_64-linux-gnu/dbus-1.0/include -isystem \
    /usr/include/gtk-3.0 -isystem /usr/include/gio-unix-2.0/ -isystem \
    /usr/include/mirclient -isystem /usr/include/mircore -isystem \
    /usr/include/mircookie -isystem /usr/include/cairo -isystem \
    /usr/include/pango-1.0 -isystem /usr/include/harfbuzz -isystem \
    /usr/include/pango-1.0 -isystem /usr/include/atk-1.0 -isystem \
    /usr/include/cairo -isystem /usr/include/pixman-1 -isystem \
    /usr/include/freetype2 -isystem /usr/include/libpng12 -isystem \
    /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/libpng12 -isystem \
    /usr/include/libsoup-2.4 -isystem /usr/include/libxml2 -isystem \
    /usr/include/glib-2.0 -isystem \
    /usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -isystem \
    /usr/include/glib-2.0 -isystem \
    /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem \
    /usr/include/glib-2.0 -isystem \
    /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem \
    /usr/include/freetype2 -isystem /usr/include/freetype2 -isystem \
    /usr/include/freetype2 -MMD -MF deps/emacs-module.d -MP -isystem \
    /usr/include/p11-kit-1 -fno-common -W -Wabi -Waddress \
    -Waggressive-loop-optimizations -Wall -Wattributes -Wbool-compare \
    -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wchkp \
    -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdate-time \
    -Wdeprecated -Wdeprecated-declarations -Wdesignated-init \
    -Wdisabled-optimization -Wdiscarded-array-qualifiers \
    -Wdiscarded-qualifiers -Wdiv-by-zero -Wdouble-promotion -Wempty-body \
    -Wendif-labels -Wenum-compare -Wextra -Wformat-contains-nul \
    -Wformat-extra-args -Wformat-security -Wformat-signedness -Wformat-y2k \
    -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers \
    -Wimplicit -Wimplicit-function-declaration -Wimplicit-int \
    -Wincompatible-pointer-types -Winit-self -Wint-conversion \
    -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch \
    -Wjump-misses-init -Wlogical-not-parentheses -Wlogical-op -Wmain \
    -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces \
    -Wmissing-declarations -Wmissing-include-dirs -Wmissing-parameter-type \
    -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs \
    -Wnonnull -Wodr -Wold-style-declaration -Wold-style-definition \
    -Wopenmp-simd -Woverflow -Wpacked -Wpacked-bitfield-compat \
    -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast \
    -Wpragmas -Wpsabi -Wreturn-local-addr -Wreturn-type -Wsequence-point \
    -Wshift-count-negative -Wshift-count-overflow -Wsizeof-array-argument \
    -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes \
    -Wsuggest-attribute=format -Wsuggest-attribute=noreturn \
    -Wsuggest-final-methods -Wsuggest-final-types -Wswitch-bool \
    -Wtrampolines -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused \
    -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function \
    -Wunused-label -Wunused-local-typedefs -Wunused-macros -Wunused-result \
    -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros \
    -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings \
    -Warray-bounds=2 -Wnormalized=nfc -Wredundant-decls \
    -Wno-missing-field-initializers -Wno-override-init -Wno-sign-compare \
    -Wno-type-limits -Wno-unused-parameter -Wno-format-nonliteral -g3 -O2 \
    emacs-module.c



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05  7:54     ` Paul Eggert
  2018-09-05  9:14       ` Greg Minshall
@ 2018-09-05 20:26       ` Greg Minshall
  2018-09-05 20:55         ` Paul Eggert
  1 sibling, 1 reply; 21+ messages in thread
From: Greg Minshall @ 2018-09-05 20:26 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

Paul,

i'm more or less stuck.  using a copy of "gcc -E" (garnered from 'make
V=1'), and deleting here and there, for module_intern() (just one of
many routines that are truncated, on my system, by "gcc -O2"), my
current minimal'ish example is this (surrounded by the rest of the "gcc
-E" output):
----
static emacs_value
module_intern (emacs_env *env, const char *name)
{
  if (module_non_local_exit_check (env))
    return module_nil;
  if (module_non_local_exit_check (env))
    return module_nil;

  struct handler *internal_cleanup_CATCHER_ALL;
  if (_setjmp (internal_cleanup_CATCHER_ALL->jmp)) {
      return module_nil;
  }

  return lisp_to_value (env, intern (name));
}
----

note that lines 3 and 4 duplicate 1 and 2; if 3 and 4 are deleted, the
compiler emits "good" code.  the "if" conditions there can be
complemented ("!") without changing the compiler behavior.

and, some form of _setjmp() must be there, though what the range is i'm
not sure.

similarly, if "anything" is changed in module_non_local_exit_check(),
which is currently:
----
static enum emacs_funcall_exit
module_non_local_exit_check (emacs_env *env)
{
  module_assert_thread ();
  module_assert_env (env);
  return env->private_members->pending_non_local_exit;
}
----
the compiler doesn't truncate module_intern().

with -O2, i get (only up to the "ret" is relevant, except for checking i
didn't miss anything):
----
        .type   module_intern, @function
module_intern:
.LFB791:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    module_non_local_exit_check
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE791:
        .size   module_intern, .-module_intern
        .section        .text.unlikely
.LCOLDE18:
        .text
.LHOTE18:
        .section        .text.unlikely
.LCOLDB19:
        .text
.LHOTB19:
        .p2align 4,,15
        .type   module_make_float, @function
----

below is the full, unoptimized code.

i installed clang 6.0, and it, even at -O3, seemed to output correct
code for module_intern(), at least.

i'm open to all thoughts.  (including, "give up!" :)

cheers, Greg

----
with *out* -O2 (or, any other optimization level), the compiler
generates this:
----
        .type   module_intern, @function
module_intern:
.LFB791:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        subq    $32, %rsp
        movq    %rdi, -24(%rbp)
        movq    %rsi, -32(%rbp)
        movq    -24(%rbp), %rax
        movq    %rax, %rdi
        call    module_non_local_exit_check
        testl   %eax, %eax
        je      .L119
        movl    $0, %eax
        jmp     .L120
.L119:
        movq    -24(%rbp), %rax
        movq    %rax, %rdi
        call    module_non_local_exit_check
        testl   %eax, %eax
        je      .L121
        movl    $0, %eax
        jmp     .L120
.L121:
        movq    -8(%rbp), %rax
        addq    $56, %rax
        movq    %rax, %rdi
        call    _setjmp
        testl   %eax, %eax
        je      .L124
        movl    $0, %eax
        jmp     .L120
.L124:
        movq    -32(%rbp), %rax
        movq    %rax, %rdi
        call    intern
        movq    %rax, %rdx
        movq    -24(%rbp), %rax
        movq    %rdx, %rsi
        movq    %rax, %rdi
        call    lisp_to_value
.L120:
        leave
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc
.LFE791:
        .size   module_intern, .-module_intern
        .type   module_non_local_exit_check, @function
----



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05 20:26       ` Greg Minshall
@ 2018-09-05 20:55         ` Paul Eggert
  2018-09-06  8:58           ` Robert Pluim
                             ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Paul Eggert @ 2018-09-05 20:55 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Eli Zaretskii, emacs-devel

I'm afraid I can't help much more. I'd try a later GCC, or file a compiler bug 
report if you must use that particular GCC.



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05 20:55         ` Paul Eggert
@ 2018-09-06  8:58           ` Robert Pluim
  2018-09-06 10:32           ` Greg Minshall
  2018-09-07  9:10           ` Greg Minshall
  2 siblings, 0 replies; 21+ messages in thread
From: Robert Pluim @ 2018-09-06  8:58 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel, Greg Minshall

Paul Eggert <eggert@cs.ucla.edu> writes:

> I'm afraid I can't help much more. I'd try a later GCC, or file a
> compiler bug report if you must use that particular GCC.

I can confirm this bug with both the Ubuntu 16.04 default gcc, and
with vanilla gcc5. Recompiling just emacs-module.o with vanilla gcc6
fixes the issue.

Robert



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05 20:55         ` Paul Eggert
  2018-09-06  8:58           ` Robert Pluim
@ 2018-09-06 10:32           ` Greg Minshall
  2018-09-12 13:41             ` Robert Pluim
  2018-09-07  9:10           ` Greg Minshall
  2 siblings, 1 reply; 21+ messages in thread
From: Greg Minshall @ 2018-09-06 10:32 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Robert Pluim, emacs-devel

Paul,

> I'm afraid I can't help much more. I'd try a later GCC, or file a
> compiler bug report if you must use that particular GCC.

thanks for the suggestions so far (esp. V=1!).

negative persistence being what it is, i used "lxd" magic, spun up a new
Ubuntu 16.04 release, cloned the git repository, "git checkout
emacs-26.1", downloaded all the prereqs, autogen.sh'd, configured :
./configure --with-xwidgets --with-modules --without-dbus then, "make &&
make check"; same results.  (and, for my sanity self-appraisal, i'm glad
for Robert Pluim's confirmation -- thanks!)

i'll try to report it to gcc (not a community with which i have
much other-than-user experience, so, something new).

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-05 20:55         ` Paul Eggert
  2018-09-06  8:58           ` Robert Pluim
  2018-09-06 10:32           ` Greg Minshall
@ 2018-09-07  9:10           ` Greg Minshall
  2 siblings, 0 replies; 21+ messages in thread
From: Greg Minshall @ 2018-09-07  9:10 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Eli Zaretskii, emacs-devel

here's a possibility, but i don't really understand the plumbing.

i wonder if it's the case that in src/emacs-module.c, the member
"pending_non_local_exit" of "struct emacs_env_private" should be marked
"volatile".  my sense is that it is, among other things, what links the
lower (signal/interrupt context) and upper (thread context) halves of
emacs/emacs-module (though i can't really see it).

if so, probably also the members "non_local_exit_{symbol,data}" should
be similarly marked.

[marking pending_non_local_exit volatile *does* result in (what appears
to be) good optimization; this is hardly surprising, though, as probably
if the optimizer saw even "volatile int i;" as a member of the struct,
it would back way off any code around it.  if this is what is causing
the bad optimization, it seems likely to still be a compiler.]

cheers, Greg

ps -- it's been years, decades, since i've had occasion to think of
"volatile", and possiblly the technology of such "attributes" has
advanced in the meantime.



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-06 10:32           ` Greg Minshall
@ 2018-09-12 13:41             ` Robert Pluim
  2018-09-12 14:56               ` Paul Eggert
                                 ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Robert Pluim @ 2018-09-12 13:41 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Paul Eggert, emacs-devel

Greg Minshall <minshall@acm.org> writes:

> Paul,
>
>> I'm afraid I can't help much more. I'd try a later GCC, or file a
>> compiler bug report if you must use that particular GCC.
>
> thanks for the suggestions so far (esp. V=1!).
>
> negative persistence being what it is, i used "lxd" magic, spun up a new
> Ubuntu 16.04 release, cloned the git repository, "git checkout
> emacs-26.1", downloaded all the prereqs, autogen.sh'd, configured :
> ./configure --with-xwidgets --with-modules --without-dbus then, "make &&
> make check"; same results.  (and, for my sanity self-appraisal, i'm glad
> for Robert Pluim's confirmation -- thanks!)
>
> i'll try to report it to gcc (not a community with which i have
> much other-than-user experience, so, something new).

My CPU was idle for a while, so I set it to work bisecting this. It
came up with the following gcc commit:

    commit e98da821c1ee4450bbe40a0278cd75803706aa7c (HEAD, refs/bisect/new)
    Author: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
    Date:   Sun Dec 20 05:50:29 2015 +0000

                PR middle-end/65337
                * tree-ssa-dce.c (bb_postorder): New static var.
                (forward_edge_to_pdom): Remove.
                (remove_dead_stmt): Instead of redirecting edges only keep an edge
                on a path to nearest live BB.
                (eliminate_unnecessary_stmts): Free bb_postorder.
                * cfganal.c (dfs_find_deadend): Add START_POINTES.
                * cfganal.h (inverted_post_order_compute): Update prototype.


        git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231856 138bc75d-0d04-0410-961f-82ee72b054a4

which is three years old. I guess you could try to get it backported
to the gcc in 16.04, but it might be easier for you to just install a
later version of gcc (or upgrade to a later version of Ubuntu :-) )

Regards

Robert



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-12 13:41             ` Robert Pluim
@ 2018-09-12 14:56               ` Paul Eggert
  2018-09-12 16:19               ` Greg Minshall
  2018-09-12 16:27               ` Greg Minshall
  2 siblings, 0 replies; 21+ messages in thread
From: Paul Eggert @ 2018-09-12 14:56 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Greg Minshall, emacs-devel

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

Thanks for tracking this down. It's worth a note in etc/PROBLEMS; I installed 
the attached into the emacs-26 branch.

[-- Attachment #2: 0001-etc-PROBLEMS-Document-Ubuntu-16.04-issue.patch --]
[-- Type: text/x-patch, Size: 1021 bytes --]

From 41cdda22c78eb0b00612ce25cdb356dd64322fcc Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 12 Sep 2018 07:53:43 -0700
Subject: [PATCH] * etc/PROBLEMS: Document Ubuntu 16.04 issue.

---
 etc/PROBLEMS | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 15e2b3359d..7dfafe04de 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2986,6 +2986,15 @@ as a macro.  If the definition (in both unex*.c and malloc.c) is wrong,
 it can cause problems like this.  You might be able to find the correct
 value in the man page for a.out(5).
 
+* 'make check' failures
+
+** emacs-module-tests fail on Ubuntu 16.04
+
+This is due to a bug in GCC that was fixed in 2015; see
+<https://lists.gnu.org/r/emacs-devel/2018-09/msg00548.html>.
+You can work around the problem by using a later version of GCC or of
+Ubuntu, or by configuring without modules.
+
 * Problems on legacy systems
 
 This section covers bugs reported on very old hardware or software.
-- 
2.17.1


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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-12 13:41             ` Robert Pluim
  2018-09-12 14:56               ` Paul Eggert
@ 2018-09-12 16:19               ` Greg Minshall
  2018-09-12 16:37                 ` Robert Pluim
  2018-09-12 16:27               ` Greg Minshall
  2 siblings, 1 reply; 21+ messages in thread
From: Greg Minshall @ 2018-09-12 16:19 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Paul Eggert, emacs-devel

Robert,

great!  do you want to add your comment to the gcc bug?
----
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87242
----

i added a creduce(1)'d (partly -- talk about CPU usage!) test case.  if
you wanted to make sure that works/fails for you, that'd be great.

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-12 13:41             ` Robert Pluim
  2018-09-12 14:56               ` Paul Eggert
  2018-09-12 16:19               ` Greg Minshall
@ 2018-09-12 16:27               ` Greg Minshall
  2018-09-12 16:39                 ` Robert Pluim
  2 siblings, 1 reply; 21+ messages in thread
From: Greg Minshall @ 2018-09-12 16:27 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Paul Eggert, emacs-devel

Robert,

reading Paul's README text, i realize i'm not sure of something. was
----
    commit e98da821c1ee4450bbe40a0278cd75803706aa7c (HEAD, refs/bisect/new)
    Author: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
    Date:   Sun Dec 20 05:50:29 2015 +0000
----
the commit that *introduced* the -O2 bug, or the commit that *fixed* it?

cheers, Greg



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-12 16:19               ` Greg Minshall
@ 2018-09-12 16:37                 ` Robert Pluim
  0 siblings, 0 replies; 21+ messages in thread
From: Robert Pluim @ 2018-09-12 16:37 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Paul Eggert, emacs-devel

Greg Minshall <minshall@acm.org> writes:

> Robert,
>
> great!  do you want to add your comment to the gcc bug?

The gcc bug is already fixed, so Iʼm not entirely sure what value that
would have, but Iʼve just done so.

> ----
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87242
> ----
>
> i added a creduce(1)'d (partly -- talk about CPU usage!) test case.  if
> you wanted to make sure that works/fails for you, that'd be great.

Iʼll add it to my list (which only ever seems to get longer :-) )

Cheers

Robert



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

* Re: make check fails? (emacs-26.1 w/modules)
  2018-09-12 16:27               ` Greg Minshall
@ 2018-09-12 16:39                 ` Robert Pluim
  0 siblings, 0 replies; 21+ messages in thread
From: Robert Pluim @ 2018-09-12 16:39 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Paul Eggert, emacs-devel

Greg Minshall <minshall@acm.org> writes:

> Robert,
>
> reading Paul's README text, i realize i'm not sure of something. was
> ----
>     commit e98da821c1ee4450bbe40a0278cd75803706aa7c (HEAD, refs/bisect/new)
>     Author: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
>     Date:   Sun Dec 20 05:50:29 2015 +0000
> ----
> the commit that *introduced* the -O2 bug, or the commit that *fixed* it?

Fixed it. I realize my message to the list didnʼt explicitly state
that (although I suggest backporting it, which kind of implied it was
a fix).

Robert



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

end of thread, other threads:[~2018-09-12 16:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-03 14:39 make check fails? (emacs-26.1 w/modules) Greg Minshall
2018-09-03 15:12 ` Greg Minshall
2018-09-03 15:13 ` Eli Zaretskii
2018-09-03 15:16   ` Greg Minshall
2018-09-03 15:18   ` Greg Minshall
2018-09-04 10:39   ` Greg Minshall
2018-09-05  7:54     ` Paul Eggert
2018-09-05  9:14       ` Greg Minshall
2018-09-05 20:26       ` Greg Minshall
2018-09-05 20:55         ` Paul Eggert
2018-09-06  8:58           ` Robert Pluim
2018-09-06 10:32           ` Greg Minshall
2018-09-12 13:41             ` Robert Pluim
2018-09-12 14:56               ` Paul Eggert
2018-09-12 16:19               ` Greg Minshall
2018-09-12 16:37                 ` Robert Pluim
2018-09-12 16:27               ` Greg Minshall
2018-09-12 16:39                 ` Robert Pluim
2018-09-07  9:10           ` Greg Minshall
2018-09-03 18:27 ` Paul Eggert
2018-09-03 23:46   ` Greg Minshall

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.