unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Emanuel Berg <moasenwood@zoho.eu>, help-gnu-emacs@gnu.org
Subject: RE: Fatal error 11: Segmentation Fault
Date: Tue, 2 Apr 2019 09:27:40 -0700 (PDT)	[thread overview]
Message-ID: <b6fed635-1d2d-42f5-8c6c-add29cbec84b@default> (raw)
In-Reply-To: <86a7h85ru5.fsf@zoho.eu>

> > if those both work then bisect your init file to
> > find the culprit.
> 
> If it is in my init files, how come it
> works once? I type this using Emacs.

Wrong question, I think.  The right question is this:
"If it _doesn't_ happen when I _don't_ use my init
file then what part of my init file makes it happen?"

It doesn't matter, for this, whether "it works once".
What matters is that it (apparently) _always_ works
if you don't load your init file and it (apparently)
sometimes does not work if you do load your init file.

> Besides, doing a "binary search" isn't so easy.
> Many files are interconnected. To mot load one
> file does mean commenting out `require's in
> lots'a others, as well as functions who uses
> their stuff, then functions that uses those
> functions, and so on.

Not sure I understand your description there.

My init file and the many files it loads are likely
more ugly and convoluted than yours (and no, I'm not
proud/bragging about that).  But binary search still
helps and is not that hard.

I use this, bound to `C-x C-;`, to comment out or
(with plain `C-u`) uncomment a set of contiguous
lines.  It works also for nested commenting.

(defun comment-region-lines (beg end &optional arg)
  "Like `comment-region', but comment/uncomment whole lines."
  (interactive "*r\nP")
  (when (> beg end)
    (setq beg  (prog1 end (setq end  beg))))
  (let ((bol  (save-excursion
                (goto-char beg)
                (line-beginning-position)))
        (eol  (save-excursion
                (goto-char end)
                (if (bolp) (point) (line-end-position)))))
    (comment-region bol eol arg)))

Yes, if a binary search by commenting out 1/2,
3/4, 7/8... of my init file indicates that the
problem is in some file that that file loads,
then I do the same thing to that file.

Not immediate, but pretty quick.  Of course
it won't be all that quick if you don't get
a crash quickly or each time.

> Can't I use gdb or something to find it?

No doubt you can.  Someone else can help with that.
I doubt that it will be quicker than narrowing your
init file.  But it will have the advantage of
indicating just what the problem is.  I'd suggest
first narrow the code to debug, then use gdb etc.
on that narrowed code.

The worst way to test/debug something is typically
to try to just run a giant sack of stuff.  It's
almost always beneficial to narrow the test space
to a small sack.



  reply	other threads:[~2019-04-02 16:27 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02  1:33 Fatal error 11: Segmentation Fault Emanuel Berg
2019-04-02  2:39 ` Emanuel Berg
2019-04-02  2:48   ` Drew Adams
2019-04-02 15:50     ` Emanuel Berg
2019-04-02 16:27       ` Drew Adams [this message]
2019-04-02 23:54         ` Emanuel Berg
2019-04-03  1:37           ` Drew Adams
2019-04-03  5:30             ` Emanuel Berg
2019-04-03  6:47               ` Emanuel Berg
2019-04-03  7:08                 ` Eli Zaretskii
2019-04-03  7:49                   ` Emanuel Berg
2019-04-03  8:18               ` tomas
2019-04-03 10:51                 ` Using 'git bisect' to pinpoint errors in .emacs. Was: " Vegard Vesterheim
2019-04-03 11:14                   ` Eli Zaretskii
2019-04-03 12:47                     ` Vegard Vesterheim
2019-04-03 14:48                     ` Emanuel Berg
2019-04-03 12:14                   ` Skip Montanaro
2019-04-03 12:30                     ` Eli Zaretskii
2019-04-03 14:52                       ` Emanuel Berg
2019-04-03 15:41                         ` Eli Zaretskii
2019-04-03 15:47                           ` Emanuel Berg
2019-04-03 14:35                   ` Emanuel Berg
2019-04-04  7:40                     ` Vegard Vesterheim
2019-04-03 14:34                 ` Emanuel Berg
2019-04-03 16:29                   ` tomas
2019-04-03 17:06                     ` Drew Adams
2019-04-03 19:19                       ` tomas
2019-04-03 17:41                     ` Robert Thorpe
2019-04-03 21:03                       ` Emanuel Berg
2019-04-03 21:07                         ` Robert Thorpe
2019-04-03 21:16                           ` Emanuel Berg
2019-04-03 20:56                     ` Emanuel Berg
2019-04-02 17:14       ` Óscar Fuentes
2019-04-02 23:56         ` Emanuel Berg
2019-04-03  0:05           ` Emanuel Berg
2019-04-03  0:13             ` Emanuel Berg
2019-04-03  1:20               ` Óscar Fuentes
2019-04-03  1:28                 ` Óscar Fuentes
2019-04-03  2:33                 ` Emanuel Berg
2019-04-03  2:39                   ` Emanuel Berg
2019-04-03  4:47                 ` Emanuel Berg
2019-04-03  5:23                   ` Eli Zaretskii
2019-04-03  5:31                     ` Emanuel Berg
2019-04-03  5:56                       ` Eli Zaretskii
2019-04-03  6:48                         ` Emanuel Berg
2019-04-03  6:59                           ` Eli Zaretskii
2019-04-03  7:51                             ` Emanuel Berg
2019-04-03  8:12                               ` Eli Zaretskii
2019-04-03 14:21                                 ` Emanuel Berg
2019-04-03 14:36                                   ` Eli Zaretskii
2019-04-03 14:57                                     ` Emanuel Berg
2019-04-03 15:48                                       ` Eli Zaretskii
2019-04-03 21:05                                         ` Emanuel Berg
2019-04-04 12:51                                           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6fed635-1d2d-42f5-8c6c-add29cbec84b@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).