zsh-workers
 help / color / mirror / code / Atom feed
* -o nobanghist -o emacs segfaults
@ 2020-04-03  8:11 Daniel Shahaf
  2020-04-03 10:15 ` Peter Stephenson
  2020-04-05 18:34 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Shahaf @ 2020-04-03  8:11 UTC (permalink / raw)
  To: zsh-workers

[[[
% b/Src/zsh -f -o nobanghist -o emacs
zsh: segmentation fault  b/Src/zsh -f -o nobanghist -o emacs
% lldb -- b/Src/zsh -f -o nobanghist -o emacs
(lldb) r
Process 27470 launched: '/home/daniel/src/zsh/b/Src/zsh' (x86_64)
Process 27470 stopped
* thread #1, name = 'zsh', stop reason = signal SIGSEGV: invalid address (fault address: 0x48)
    frame #0: 0x000000000049171b zsh`find_module(name="zsh/zle", flags=1, namep=0x00007fffffffdf60) at module.c:1657
   1654 {
   1655     Module m;
   1656
-> 1657     m = (Module)modulestab->getnode2(modulestab, name);
   1658     if (m) {
   1659         if ((flags & FINDMOD_ALIASP) && (m->node.flags & MOD_ALIAS)) {
   1660             if (namep)
(lldb) p modulestab
(HashTable) $0 = 0x0000000000000000
(lldb) bt
* thread #1, name = 'zsh', stop reason = signal SIGSEGV: invalid address (fault address: 0x48)
  * frame #0: 0x000000000049171b zsh`find_module(name="zsh/zle", flags=1, namep=0x00007fffffffdf60) at module.c:1657
    frame #1: 0x00000000004918cf zsh`load_module(name="zsh/zle", enablesarr=0x0000000000000000, silent=0) at module.c:2213
    frame #2: 0x000000000047480b zsh`zleentry(cmd=6) at init.c:1614
    frame #3: 0x000000000049a038 zsh`dosetopt(optno=50, value=1, force=1, new_opts="") at options.c:897
    frame #4: 0x00000000004707fa zsh`parseopts(nam="zsh", argvp=0x00007fffffffe320, new_opts="", cmdp=0x00007fffffffe370, optlist=0x0000000000000000, flags=1) at init.c:488
    frame #5: 0x000000000047501c zsh`parseargs(zsh_name="zsh", argv=0x00007fffffffe4b0, runscript=0x00007fffffffe380, cmdptr=0x00007fffffffe370) at init.c:268
    frame #6: 0x0000000000474d7f zsh`zsh_main(argc=6, argv=0x00007fffffffe4a8) at init.c:1756
    frame #7: 0x0000000000420702 zsh`main(argc=6, argv=0x00007fffffffe4a8) at main.c:93
    frame #8: 0x00007ffff7c1909b libc.so.6`__libc_start_main(main=(zsh`main at main.c:92), argc=6, argv=0x00007fffffffe4a8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffe498) at libc-start.c:308
    frame #9: 0x000000000042061a zsh`_start + 42
(lldb) 
]]]

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

* Re: -o nobanghist -o emacs segfaults
  2020-04-03  8:11 -o nobanghist -o emacs segfaults Daniel Shahaf
@ 2020-04-03 10:15 ` Peter Stephenson
  2020-04-05 18:34 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2020-04-03 10:15 UTC (permalink / raw)
  To: zsh-workers


> On 03 April 2020 at 09:11 Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> % b/Src/zsh -f -o nobanghist -o emacs
> zsh: segmentation fault  b/Src/zsh -f -o nobanghist -o emacs

The option parser is passing the keymap to ZLE, which hasn't been loaded yet.
Attempting to load it doesn't work because at the point of initial option parsing
the basic definitions for the module system aren't set up.

Moving up the initialisation of the module system could possibly expose some hairy
dependencies.

Probably the right thing to do is to detect this condition, remember the keymap,
and pass it in later.  I'm not entirely sure where the best place for this is,
but as it's specific to initialisation and depends on the sequencing of that I
suppose up in that code, rather than down in anything ZLE-specific.  But
at least the option parser needs to be aware this is init rather than run time.

(See my previous ramblings on the theme "ZLE isn't really a self-contained module in
the fullest acceptance of the term".)

pws

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

* Re: -o nobanghist -o emacs segfaults
  2020-04-03  8:11 -o nobanghist -o emacs segfaults Daniel Shahaf
  2020-04-03 10:15 ` Peter Stephenson
@ 2020-04-05 18:34 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2020-04-05 18:34 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-workers

On Fri, Apr 3, 2020 at 1:12 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> [[[
> % b/Src/zsh -f -o nobanghist -o emacs
> zsh: segmentation fault  b/Src/zsh -f -o nobanghist -o emacs

The solution to this is probably simpler than the segfault makes it appear.

schaefer[528] Src/zsh -o emacs
Src/zsh: invalid module name `zsh/zle'

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

end of thread, other threads:[~2020-04-05 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03  8:11 -o nobanghist -o emacs segfaults Daniel Shahaf
2020-04-03 10:15 ` Peter Stephenson
2020-04-05 18:34 ` Bart Schaefer

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).