unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Debugging low level problems with Valgrind
@ 2014-01-29  9:04 Alex Bennée
  2014-01-29 11:34 ` Dmitry Antipov
  2014-01-29 11:36 ` Andreas Schwab
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Bennée @ 2014-01-29  9:04 UTC (permalink / raw)
  To: emacs-devel

Hi,

I'm currently trying to track down the rather annoying --daemon crash
when I delete-frame (reported on list). As it's a access after free I
thought I would try using valgrind to find where the free occurs (it's
also sporadic, it doesn't happen every delete frame).

So far I've had no joy getting valgrind to run. I've built with

CFLAGS="-O0 0g3" ./configure --with-x-toolkit=lucid

But valgrind keeps complaining when I run:

--17777-- Contents of /proc/version:
--17777--   Linux version 3.8.11 (chrome-bot@build31-m2) (gcc version 4.8.x-google 20130905 (prerelease) (4.8.1_cos_gg_b42cc22_4.8.1-r62) ) #1 SMP Thu Jan 23 19:39:17 PST 2014
--17777-- Arch and hwcaps: AMD64, amd64-cx16-rdtscp-sse3-avx
--17777-- Page sizes: currently 4096, max supported 4096
--17777-- Valgrind library directory: /usr/lib/valgrind
--17777-- Reading syms from /home/alex/src/emacs/emacs.git/src/emacs
--17777-- WARNING: Serious error when reading debug info
--17777-- When reading debug info from /home/alex/src/emacs/emacs.git/src/emacs:
--17777-- Can't make sense of .data section mapping

And then later on is finding stuff but can't resolv the symbols:

==17803== Invalid free() / delete / delete[] / realloc()
==17803==    at 0x4C2C72E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17803==    by 0x5A840B: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x59ED7A: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x5A748C: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x58D045: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x58D30A: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x58DD14: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x5F6B9A: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x5F72C9: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x5CEF1F: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x610E8B: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==    by 0x5CF53E: ??? (in /home/alex/src/emacs/emacs.git/src/emacs)
==17803==  Address 0x1014070 is not stack'd, malloc'd or (recently) free'd

I'm wondering if I have a subtly busted toolchain or there are some
other magic runes I should use to set emacs up for valgrinding.

-- 
Alex Bennée




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

* Re: Debugging low level problems with Valgrind
  2014-01-29  9:04 Debugging low level problems with Valgrind Alex Bennée
@ 2014-01-29 11:34 ` Dmitry Antipov
  2014-01-29 11:36 ` Andreas Schwab
  1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Antipov @ 2014-01-29 11:34 UTC (permalink / raw)
  To: Alex Bennée; +Cc: emacs-devel

On 01/29/2014 01:04 PM, Alex Bennée wrote:

> --17777-- Reading syms from /home/alex/src/emacs/emacs.git/src/emacs
> --17777-- WARNING: Serious error when reading debug info
> --17777-- When reading debug info from /home/alex/src/emacs/emacs.git/src/emacs:
> --17777-- Can't make sense of .data section mapping

IIUC the only reliable way is to use undumped (temacs) binary instead.

Dmitry





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

* Re: Debugging low level problems with Valgrind
  2014-01-29  9:04 Debugging low level problems with Valgrind Alex Bennée
  2014-01-29 11:34 ` Dmitry Antipov
@ 2014-01-29 11:36 ` Andreas Schwab
  2014-01-29 15:44   ` Alex Bennée
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2014-01-29 11:36 UTC (permalink / raw)
  To: Alex Bennée; +Cc: emacs-devel

Alex Bennée <kernel-hacker@bennee.com> writes:

> So far I've had no joy getting valgrind to run. I've built with
>
> CFLAGS="-O0 0g3" ./configure --with-x-toolkit=lucid
>
> But valgrind keeps complaining when I run:

You need to run valgrind on temacs, since valgrind can't handle the
dumping process.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Debugging low level problems with Valgrind
  2014-01-29 11:36 ` Andreas Schwab
@ 2014-01-29 15:44   ` Alex Bennée
  2014-01-29 17:42     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Bennée @ 2014-01-29 15:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Alex Bennée, emacs-devel


schwab@linux-m68k.org writes:

> Alex Bennée <kernel-hacker@bennee.com> writes:
>
>> So far I've had no joy getting valgrind to run. I've built with
>>
>> CFLAGS="-O0 0g3" ./configure --with-x-toolkit=lucid
>>
>> But valgrind keeps complaining when I run:
>
> You need to run valgrind on temacs, since valgrind can't handle the
> dumping process.

Ahh is that what the mysterious second .data section is in the emacs
binary? Maybe all valgrind needs to do is ignore it?

Sadly although I could get temacs to start I couldn't get a working
--daemon process needed to trigger the failure.

>
> Andreas.

-- 
Alex Bennée




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

* Re: Debugging low level problems with Valgrind
  2014-01-29 15:44   ` Alex Bennée
@ 2014-01-29 17:42     ` Eli Zaretskii
  2014-01-29 20:54       ` Alex Bennée
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2014-01-29 17:42 UTC (permalink / raw)
  To: Alex Bennée; +Cc: schwab, kernel-hacker, emacs-devel

> From: Alex Bennée <kernel-hacker@bennee.com>
> Date: Wed, 29 Jan 2014 15:44:05 +0000
> Cc: Alex Bennée <kernel-hacker@bennee.com>,
> 	emacs-devel <emacs-devel@gnu.org>
> 
> Sadly although I could get temacs to start I couldn't get a working
> --daemon process needed to trigger the failure.

What prevented you from getting a daemon with temacs?  Please report
the details.

Also, do you really need a deamonized Emacs to reproduce the problem?
AFAICS, it happens when you delete the last frame from a display,
which can be done in a "normal" Emacs session.




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

* Re: Debugging low level problems with Valgrind
  2014-01-29 17:42     ` Eli Zaretskii
@ 2014-01-29 20:54       ` Alex Bennée
  2014-01-30  3:45         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Bennée @ 2014-01-29 20:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, kernel-hacker, emacs-devel


eliz@gnu.org writes:

>> From: Alex Bennée <kernel-hacker@bennee.com>
>> Date: Wed, 29 Jan 2014 15:44:05 +0000
>> Cc: Alex Bennée <kernel-hacker@bennee.com>,
>> 	emacs-devel <emacs-devel@gnu.org>
>> 
>> Sadly although I could get temacs to start I couldn't get a working
>> --daemon process needed to trigger the failure.
>
> What prevented you from getting a daemon with temacs?  Please report
> the details.

There isn't much reported by emacs apart from the rather terse:

...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Pure-hashed: 23631 strings, 3428 vectors, 37030 conses, 3224 bytecodes, 82 others
Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
Error: server did not start correctly

> Also, do you really need a deamonized Emacs to reproduce the problem?
> AFAICS, it happens when you delete the last frame from a display,
> which can be done in a "normal" Emacs session.

In the set-up I'm running on (ChromeOS) I can only have one X frame at a
time. --daemon mode is the only way I know of to keep a running Emacs
and create and delete X frames to trigger this crash (it doesn't happen
every time).

How would I start Emacs with a terminal session from which I could
create X frames? I tried "emacs -nw" but when I execute (new-frame) it
only brings up a new tty frame.

-- 
Alex Bennée




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

* Re: Debugging low level problems with Valgrind
  2014-01-29 20:54       ` Alex Bennée
@ 2014-01-30  3:45         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2014-01-30  3:45 UTC (permalink / raw)
  To: Alex Bennée; +Cc: schwab, kernel-hacker, emacs-devel

> From: Alex Bennée <kernel-hacker@bennee.com>
> Cc: schwab@linux-m68k.org, kernel-hacker@bennee.com, emacs-devel@gnu.org
> Date: Wed, 29 Jan 2014 20:54:49 +0000
> 
> >> From: Alex Bennée <kernel-hacker@bennee.com>
> >> Date: Wed, 29 Jan 2014 15:44:05 +0000
> >> Cc: Alex Bennée <kernel-hacker@bennee.com>,
> >> 	emacs-devel <emacs-devel@gnu.org>
> >> 
> >> Sadly although I could get temacs to start I couldn't get a working
> >> --daemon process needed to trigger the failure.
> >
> > What prevented you from getting a daemon with temacs?  Please report
> > the details.
> 
> There isn't much reported by emacs apart from the rather terse:
> 
> ...
> Finding pointers to doc strings...
> Finding pointers to doc strings...done
> Pure-hashed: 23631 strings, 3428 vectors, 37030 conses, 3224 bytecodes, 82 others
> Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
> Error: server did not start correctly

I would suggest a separate bug report about that.  This shouldn't
happen.

> How would I start Emacs with a terminal session from which I could
> create X frames? I tried "emacs -nw" but when I execute (new-frame) it
> only brings up a new tty frame.

You should use "emacsclient -c", after starting the server in Emacs.
That is,

  temacs -nw
  emacsclient -c

should open a GUI frame.





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

end of thread, other threads:[~2014-01-30  3:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29  9:04 Debugging low level problems with Valgrind Alex Bennée
2014-01-29 11:34 ` Dmitry Antipov
2014-01-29 11:36 ` Andreas Schwab
2014-01-29 15:44   ` Alex Bennée
2014-01-29 17:42     ` Eli Zaretskii
2014-01-29 20:54       ` Alex Bennée
2014-01-30  3:45         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).