unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 38309@debbugs.gnu.org, a@ajgrf.com
Subject: bug#38309: Recent $EMACSLOADPATH changes crash gnome-session
Date: Wed, 27 Nov 2019 12:12:32 +0900	[thread overview]
Message-ID: <87v9r6t3kv.fsf@gmail.com> (raw)
In-Reply-To: <87y2w3c8y1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 26 Nov 2019 09:56:22 +0100")

Hello Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> I could reproduce the gnome-session crash by generating a Guix VM with
>> the attached OS configuration (it has about 100 Emacs packages installed
>> to its system profile, which gives an EMACSLOADPATH length of about
>> 13000 characters), and got the following backtrace (no debugging
>> symbols):
>>
>> #0  0x00007ffff7837e27 in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #1  0x00007ffff78467de in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #2  0x00007ffff783ac48 in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> [...]
>> #17435 0x00007ffff78467de in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #17436 0x00007ffff783ac48 in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #17437 0x00007ffff78399c6 in match () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #17438 0x00007ffff784a441 in pcre_exec () from /gnu/store/5j6w0x3aq0i5r9565w92lrh016vlmv2d-pcre-8.43/lib/libpcre.so.1
>> #17439 0x00007ffff7ceca8b in g_match_info_next () from /gnu/store/b8pr2k0i2zd07zmb7kpffmcimqi337if-glib-2.60.6/lib/libglib-2.0.so.0
>> #17440 0x00007ffff7cee21f in g_regex_match_full () from /gnu/store/b8pr2k0i2zd07zmb7kpffmcimqi337if-glib-2.60.6/lib/libglib-2.0.so.0
>> #17441 0x00007ffff7cee36a in g_regex_match () from /gnu/store/b8pr2k0i2zd07zmb7kpffmcimqi337if-glib-2.60.6/lib/libglib-2.0.so.0
>> #17442 0x000000000042b779 in gsm_util_export_activation_environment ()
>> #17443 0x000000000040adde in main ()
>>
>> This tells us that the problem originates from glib.  Looking at the
>> number of match calls, libpcre is probably blowing up its stack as
>> described in this ticket [0].  According to this link, it seems glib
>> should be making use of PCRE's facilities to limit the depth of search,
>> e.g. by using "match limit" and "recursion limit" as documented here [1]
>> (search for "int pcre_exec(" on that page).
>>
>> Parallel to this, perhaps the regexp used by glib could be rewritten to
>> not rely as much on the stack.
>
> Oh great, thanks for investigating!
>
> I have a shallow understanding of the issues, but (1) are we not going
> overboard with that big a environment variable? :-), and (2) fixing GLib
> or PCRE would require a full rebuild, can you think of a way to work
> around the issue?

About (1); it's definitely bigger than others environment variables we
set in Guix (but not that different from PYTHONPATH when it is used on
the build side), but it hasn't posed a problem so far outside of glib.

I think having a recursive EMACSLOADPATH could be useful here and more
convenient for all Emacs users, so probably would be a welcome change in
upstream Emacs.  That'd reduce the length of our EMACSLOADPATH greatly.

I'm also interested in studying if we could use package.el to do the
load the autoloads files and put the packages present under a directory
in the load-path of Emacs.  It seems its variable `package-user-dir'
could play a role there.

About (2), I was thinking about using grafts -- IIUC this is one use
case where they can be useful (to fix a bug and avoid rebuilding many
packages).

Maxim

  reply	other threads:[~2019-11-27  3:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21  2:25 bug#38309: Recent $EMACSLOADPATH changes crash gnome-session Alex Griffin
2019-11-22 13:00 ` Clément Lassieur
2019-11-22 13:15   ` Mathieu Othacehe
2019-11-22 17:40     ` Maxim Cournoyer
2019-11-23 18:05       ` Ludovic Courtès
2019-11-24  3:45         ` Maxim Cournoyer
2019-11-24 17:56           ` Ludovic Courtès
2019-11-25 17:23             ` Maxim Cournoyer
2019-11-26  9:20               ` Clément Lassieur
2019-11-26  9:30                 ` Ludovic Courtès
2019-11-27 14:10                 ` Maxim Cournoyer
2019-11-27 14:15                   ` Clément Lassieur
2019-11-27 17:30                   ` Clément Lassieur
2019-11-26  9:43               ` Clément Lassieur
2019-11-26  4:04             ` Maxim Cournoyer
2019-11-26  8:56               ` Ludovic Courtès
2019-11-27  3:12                 ` Maxim Cournoyer [this message]
2019-11-27  9:04                   ` Clément Lassieur
2019-11-27  0:01 ` Leo Prikler
2019-11-27 13:58   ` Maxim Cournoyer
2019-11-27 14:21     ` Jelle Licht
2019-11-28  5:28       ` Maxim Cournoyer
2019-12-02 10:36     ` Clément Lassieur
2019-12-03  9:38       ` Arne Babenhauserheide
2019-12-04  9:14       ` Ludovic Courtès
2019-12-04 10:14         ` Clément Lassieur
2019-12-04 12:31           ` Arne Babenhauserheide
2019-12-04 11:11         ` Arne Babenhauserheide
2019-12-06 17:02           ` Maxim Cournoyer
2019-12-07 16:18             ` Arne Babenhauserheide

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87v9r6t3kv.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=38309@debbugs.gnu.org \
    --cc=a@ajgrf.com \
    --cc=ludo@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.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).