Discussion:
git+master: c6e6503900534d939dd94b812563c27f22c49b7d crash when using gnus
(too old to reply)
Uwe Brauer
2018-04-28 09:06:34 UTC
Permalink
Hi

I compiled the above version yesterday. It freezes and crashes
frequently in when using gnus, without any bug-trace left. What
can I do to achieve a better bug report?

Uwe Brauer
Eli Zaretskii
2018-04-28 09:43:09 UTC
Permalink
Date: Sat, 28 Apr 2018 11:06:34 +0200
I compiled the above version yesterday. It freezes and crashes
frequently in when using gnus, without any bug-trace left. What
can I do to achieve a better bug report?
Run Emacs under GDB, and when it crashes type:

thread apply all bt

Then include the output of the above command in your bug report,
submitted via "M-x report-emacs-bug RET".

Thanks.
Uwe Brauer
2018-04-28 10:11:58 UTC
Permalink
Date: Sat, 28 Apr 2018 11:06:34 +0200
I compiled the above version yesterday. It freezes and crashes
frequently in when using gnus, without any bug-trace left. What
can I do to achieve a better bug report?
Thanks, but sorry for my ignorance. What do you mean by
«Run Emacs under GDB»

I googled, could not find am explanation of what that means.
Eli Zaretskii
2018-04-28 10:46:29 UTC
Permalink
Date: Sat, 28 Apr 2018 12:11:58 +0200
Thanks, but sorry for my ignorance. What do you mean by
«Run Emacs under GDB»
Basically, start GDB with Emacs as the executable to debug, then run
Emacs from GDB's command line.
I googled, could not find am explanation of what that means.
No need to google, the answer is under your fingertips: see the
beginning of the file etc/DEBUG in the Emacs source tree.
Uwe Brauer
2018-04-28 11:56:28 UTC
Permalink
Post by Eli Zaretskii
Basically, start GDB with Emacs as the executable to debug, then run
Emacs from GDB's command line.
Oh well,

I tried gdb /opt/emacs27/bin/emacs
and I obtained
Reading symbols from /opt/emacs27/bin/emacs...(no debugging symbols
found)...done.

But no emacs started.

The message indicates that I should recompile emacs?
Post by Eli Zaretskii
No need to google, the answer is under your fingertips: see the
beginning of the file etc/DEBUG in the Emacs source tree.
Thanks, but just read it, but it is a bit confusing, since it is not
clear to me whether I could start emacs first and then start gdb within
emacs.

So it comes down to this: is

gdb /opt/emacs27/bin/emacs

in the emacs/src directory the right command to use?
I tried it but emacs does not start, what do I miss?


So shall I recompile emacs with debug options like

CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type
Eli Zaretskii
2018-04-28 12:09:10 UTC
Permalink
Date: Sat, 28 Apr 2018 13:56:28 +0200
Post by Eli Zaretskii
Basically, start GDB with Emacs as the executable to debug, then run
Emacs from GDB's command line.
Oh well,
I tried gdb /opt/emacs27/bin/emacs
and I obtained
Reading symbols from /opt/emacs27/bin/emacs...(no debugging symbols
found)...done.
Your Emacs was not built with debugging symbols. The "Preliminaries"
section of etc/DEBUG explains how to build with debugging symbols.
But no emacs started.
Because you didn't start it. The GDB "run" command starts the
executable. This is again described in etc/DEBUG.
The message indicates that I should recompile emacs?
Yes.
Post by Eli Zaretskii
No need to google, the answer is under your fingertips: see the
beginning of the file etc/DEBUG in the Emacs source tree.
Thanks, but just read it, but it is a bit confusing, since it is not
clear to me whether I could start emacs first and then start gdb within
emacs.
You can either start GDB from (another session of) Emacs, or start GDB
from the shell prompt. In both cases, you should then start Emacs
from GDB.
So shall I recompile emacs with debug options like
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type
Yes, that's a good beginning.
Uwe Brauer
2018-04-29 08:46:42 UTC
Permalink
Post by Eli Zaretskii
Post by Uwe Brauer
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type
Yes, that's a good beginning.
This dos not work. That description most likely is incomplete.

On the prompt that line gives error, so I presume that CFLAGS='-O0 -g3'
is a setting either in bash or tcsh shell.

Can you please tell me precisely how this setting should work, and may I
recommend change it in the documentation. Once I have finished
successfully the compilation and the debugging I don't mind doing that.

It might be that for experts like you these things are obvious, for a
C debugging beginner like me, they are not.
Eli Zaretskii
2018-04-29 09:53:32 UTC
Permalink
Post by Uwe Brauer
Post by Eli Zaretskii
Post by Uwe Brauer
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs'
--enable-check-lisp-object-type
Post by Eli Zaretskii
Yes, that's a good beginning.
This dos not work. That description most likely is incomplete.
On the prompt that line gives error, so I presume that CFLAGS='-O0 -g3'
is a setting either in bash or tcsh shell.
Can you please tell me precisely how this setting should work, and may I
recommend change it in the documentation. Once I have finished
successfully the compilation and the debugging I don't mind doing that.
It might be that for experts like you these things are obvious, for a
C debugging beginner like me, they are not.
Please show the error message you got. I just tried the command from
DEBUG to be sure, and it worked for me.

You should type literally the command as written in DEBUG.
Uwe Brauer
2018-04-29 14:54:03 UTC
Permalink
Post by Eli Zaretskii
Post by Uwe Brauer
Post by Eli Zaretskii
Post by Uwe Brauer
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs'
--enable-check-lisp-object-type
Post by Eli Zaretskii
Yes, that's a good beginning.
This dos not work. That description most likely is incomplete.
On the prompt that line gives error, so I presume that CFLAGS='-O0 -g3'
is a setting either in bash or tcsh shell.
Can you please tell me precisely how this setting should work, and may I
recommend change it in the documentation. Once I have finished
successfully the compilation and the debugging I don't mind doing that.
It might be that for experts like you these things are obvious, for a
C debugging beginner like me, they are not.
Please show the error message you got. I just tried the command from
DEBUG to be sure, and it worked for me.
I restarted my laptop and then

Just typed (using tcsh shell)
./configure CFLAGS='-O0 -g3' --enable-checking='yes,glyphs' --enable-check-lisp-object-type --prefix=/opt/emacs27 --wi
th-x-toolkit=athena --with-mailutils


And that worked.

I could compile emacs succesfully. So maybe I owe you an apology. But
think if I am correct that should be written in src/DEBUG:

The line reads

CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type

When I run it I obtain

CFLAGS=-O0 -g3: Command not found.

Which is to expected.

So it should be

./configure CFLAGS='-O0 -g3' --enable-checking='yes,glyphs' --enable-check-lisp-object-type
Post by Eli Zaretskii
You should type literally the command as written in DEBUG.
Not for me. Ok I just checked it seems to work for the bash shell. In
that case still a correction should be in place. Don't you think so.
Eli Zaretskii
2018-04-29 15:09:59 UTC
Permalink
Date: Sun, 29 Apr 2018 16:54:03 +0200
I restarted my laptop and then
Just typed (using tcsh shell)
./configure CFLAGS='-O0 -g3' --enable-checking='yes,glyphs' --enable-check-lisp-object-type --prefix=/opt/emacs27 --wi
th-x-toolkit=athena --with-mailutils
And that worked.
I could compile emacs succesfully. So maybe I owe you an apology. But
The line reads
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type
When I run it I obtain
CFLAGS=-O0 -g3: Command not found.
Maybe this is something specific to tcsh. The command is written for
Bourne-shell compatible shells, AFAIU.
Post by Eli Zaretskii
You should type literally the command as written in DEBUG.
Not for me. Ok I just checked it seems to work for the bash shell. In
that case still a correction should be in place. Don't you think so.
I'm not sure the script will work for non-Bourne shells, but I'm not
an expert on that.
Noam Postavsky
2018-04-29 15:26:29 UTC
Permalink
Post by Eli Zaretskii
Post by Uwe Brauer
CFLAGS='-O0 -g3' ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type
When I run it I obtain
CFLAGS=-O0 -g3: Command not found.
Maybe this is something specific to tcsh. The command is written for
Bourne-shell compatible shells, AFAIU.
It would make sense to change etc/DEBUG as Uwe suggests here anyway:
the autoconf manual recommends setting variables (apart from
CONFIG_SHELL) in the ./configure command line rather than the
environment.

https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Defining-Variables.html
Post by Eli Zaretskii
I'm not sure the script will work for non-Bourne shells, but I'm not
an expert on that.
The configure script has #!/bin/sh at the top, so the script itself
won't be evaluated by tcsh (unless you do 'tcsh ./configure ...'
(which fails immediately)).
Paul Eggert
2018-04-29 16:30:58 UTC
Permalink
Post by Noam Postavsky
the autoconf manual recommends setting variables (apart from
CONFIG_SHELL) in the ./configure command line rather than the
environment.
Quite right, and the Emacs doc mostly follows that advice, but there were a few
cases where it still used the older convention of setting CFLAGS in the
environment. I fixed the cases I found by installing the attached into master.
Eli Zaretskii
2018-04-29 17:08:35 UTC
Permalink
Date: Sun, 29 Apr 2018 09:30:58 -0700
I fixed the cases I found by installing the attached into master.
Thanks, but please backport to the release branch as well.
+ ./configure --enable-checking='yes,glyphs' --enable-check-lisp-object-type \
+ CFLAGS='-O0 -g3'
Please use one long line, to avoid problems when people naïvely
copy/paste the command into the shell prompt.
A few frequently used options are needed when you want to produce an
- CFLAGS='-O0 -g3' ./configure --prefix=PREFIX --enable-checking='yes,glyphs'
+ ./configure --prefix=PREFIX --enable-checking='yes,glyphs' \
+ CFLAGS='-O0 -g3'
Likewise here.
Paul Eggert
2018-04-29 17:18:59 UTC
Permalink
Post by Eli Zaretskii
Please use one long line, to avoid problems when people naïvely
copy/paste the command into the shell prompt.
Users can copy-paste the first example as-is already, since the earlier line
ends in backslash. (The second example can't be copy-pasted as-is because of the
metavariable, though the backslash doesn't hurt.)

If we're talking about truly naive users, then these commands are too long
anyway. Is there some way we can shorten the commands to make them less
error-prone? Maybe use shell scripts and tell users to run 'build-aux/thing1'
and 'build-aux/thing2', that sort of thing?

I'll hold off backporting until we get the important matter of backslashes
resolved. :-)
Eli Zaretskii
2018-04-29 17:40:54 UTC
Permalink
Date: Sun, 29 Apr 2018 10:18:59 -0700
Post by Eli Zaretskii
Please use one long line, to avoid problems when people naïvely
copy/paste the command into the shell prompt.
Users can copy-paste the first example as-is already, since the earlier line
ends in backslash.
Long lines without any backslashes are safer, so I'd prefer that. But
I won't have another bikeshedding argument over that, so if you don't
feel like changing it, so be it.
If we're talking about truly naive users, then these commands are too long
anyway.
I don't see any real problem with that, all supported platforms can
handle much longer commands.
I'll hold off backporting until we get the important matter of backslashes
resolved. :-)
It's resolved already, if it's up to me.

Eli Zaretskii
2018-04-29 16:31:35 UTC
Permalink
Date: Sun, 29 Apr 2018 11:26:29 -0400
the autoconf manual recommends setting variables (apart from
CONFIG_SHELL) in the ./configure command line rather than the
environment.
Fine with me, feel free (on the release branch, please).
Post by Eli Zaretskii
I'm not sure the script will work for non-Bourne shells, but I'm not
an expert on that.
The configure script has #!/bin/sh at the top
Granted I knew that. But I stopped using tcsh 20 years ago, so I
don't feel confident having any intelligent discourse about its
quirks.
Uwe Brauer
2018-04-29 15:01:52 UTC
Permalink
Post by Eli Zaretskii
Your Emacs was not built with debugging symbols. The "Preliminaries"
section of etc/DEBUG explains how to build with debugging symbols.
Because you didn't start it. The GDB "run" command starts the
executable. This is again described in etc/DEBUG.
It seems that I compiled now the error checking enabled emacs. BTW I
just found out that even for the vanilla compiled emacs there is bug
trace file in /tmp, however its around 300 Mega, so basically worse less
so I continue to give the error enabled emacs a try.

But I still don't get it to work. I do

cd src/emacs/src (dir where the new emacs is compiled)
gdb
run /home/oub/src/emacs/src/emacs

un /home/oub/src/emacs/src/emacs
Starting program: /home/oub/src/emacs/src/emacs
No executable file specified.Use the "file" or "exec-file" command.

exec-file /home/oub/src/emacs/src/emacs

And nothing happens.

What do I miss?
Noam Postavsky
2018-04-29 15:33:01 UTC
Permalink
Post by Uwe Brauer
But I still don't get it to work. I do
cd src/emacs/src (dir where the new emacs is compiled)
gdb
run /home/oub/src/emacs/src/emacs
What do I miss?
It should be

cd src/emacs/src
gdb emacs
run

Although if you follow etc/DEBUG, you would be running gdb from within
Emacs using M-x gdb.
Eli Zaretskii
2018-04-29 16:33:07 UTC
Permalink
Date: Sun, 29 Apr 2018 11:33:01 -0400
cd src/emacs/src
gdb emacs
I suggest

gdb ./emacs

to be sure you run the correct executable.
Although if you follow etc/DEBUG, you would be running gdb from within
Emacs using M-x gdb.
Right.
Uwe Brauer
2018-04-29 16:39:40 UTC
Permalink
Post by Eli Zaretskii
Date: Sun, 29 Apr 2018 11:33:01 -0400
cd src/emacs/src
gdb emacs
I suggest
gdb ./emacs
to be sure you run the correct executable.
Yes of course!
Post by Eli Zaretskii
Although if you follow etc/DEBUG, you would be running gdb from within
Emacs using M-x gdb.
Right.
Uwe Brauer
2018-04-29 16:39:20 UTC
Permalink
Post by Noam Postavsky
Post by Uwe Brauer
But I still don't get it to work. I do
cd src/emacs/src (dir where the new emacs is compiled)
gdb
run /home/oub/src/emacs/src/emacs
What do I miss?
It should be
cd src/emacs/src
gdb emacs
run
That it was, thanks!! May I suggest, again, to add just these lines to
the DEBUG file. Most likely this all trivial stuff for you but I found
it somehow difficult to deduce.
Post by Noam Postavsky
Although if you follow etc/DEBUG, you would be running gdb from within
Emacs using M-x gdb.
Eli Zaretskii
2018-04-29 17:09:34 UTC
Permalink
Date: Sun, 29 Apr 2018 18:39:20 +0200
That it was, thanks!! May I suggest, again, to add just these lines to
the DEBUG file.
You don't know me very well, do you? Already done.
Loading...