zsh-workers
 help / color / mirror / code / Atom feed
From: Jim <linux.tech.guy@gmail.com>
To: devs <zsh-workers@zsh.org>
Subject: Re: out of memory error after "edit-command-line"
Date: Fri, 12 Aug 2022 10:33:45 -0500	[thread overview]
Message-ID: <CA+rB6GLESuh=VAybFCg9RrTJ-C2_wQ8XUc4G6OGaEyEX=QRw9A@mail.gmail.com> (raw)
In-Reply-To: <CA+rB6GJLBv1uRauTnBAPihETrzox8wC1wXT8KsZ=J8r2y+qeMA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]

Hi again,

Update:

Tried to isolate what causes the 'out of memory' errors and found that if
I added quotes the error stopped.
  CL=${(0A)"$(< /proc/$P/cmdline)"}  # OK
  CL=${(0A)$(< /proc/$P/cmdline)}  # out of memory error

I had another script and it worked without the quotes. Compared the two
and found the other script had the option 'extendedglob' set. After adding
the option to the script I attached in the original email the 'out of
memory'
errors stopped when there are no quotes.

Not sure what globbing has to do with this. Hopefully someone can
enlighten me. But even so, should zsh ever fail with an 'out of memory'
error? Again, it only happens after exiting 'edit-command-line'.

Regards,

Jim

On Mon, Aug 1, 2022 at 10:47 PM Jim <linux.tech.guy@gmail.com> wrote:

> Hi everyone,
>
> ZSH_VERSION: 5.8 (Distribution, Devuan, still hasn't update)
> $ZSH_PATCHLEVEL:  debian/5.8-6+deb11u1
> default editor nvim version v0.4.4
> Also tested with VIM - Vi IMproved 8.2
> terminal emulators/multiplexer:  tmux, xfce4-terminal, st, and
> kitty(checked on all)
>
> .zshrc
>   autoload -Uz edit-command-line
>   zle -N edit-command-line
>   bindkey -M vicmd v edit-command-line
>
> Created an anonymous function(see attachment ps_via_zsh) by entering
> edit-command-line
> which seems to work ok after exiting editor and hitting enter. But
> then(after adding code) started
> getting out of memory errors(see attachment out_of_memory).  When I recall
> the anonymous
> function from history and execute, no error. Started commenting out lines
> and found that the issues
> stops with the line:
>
> CL=${(0A)$(</proc/$P/cmdline)} ; PP=${AA[PPid]} ; Cmd=${AA[Name]}
>
> commented out. Splitting line found issue to be with
> CL=${(0A)$(</proc/$P/cmdline)}
> Again, recalling from history -- no edit-command-line -- no error.
> BTW: /proc/<pid>/cmdline uses NULL as the separator.
>
> QUESTION:  Bug, or am I doing something stupid? Or something with nvim and
> vim?
>
> Thanks for listening,
>
> Jim Murphy
>

[-- Attachment #2: Type: text/html, Size: 2921 bytes --]

  reply	other threads:[~2022-08-12 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  3:47 Jim
2022-08-12 15:33 ` Jim [this message]
2022-08-12 20:18   ` Bart Schaefer
2022-08-13  0:10     ` [PATCH] " Bart Schaefer
2022-10-18 15:07       ` [PATCH] " Jun. T
2022-10-18 20:08         ` Bart Schaefer
2022-10-19  9:12         ` Jun T
2022-10-27  5:34           ` Jun T

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

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

  git send-email \
    --in-reply-to='CA+rB6GLESuh=VAybFCg9RrTJ-C2_wQ8XUc4G6OGaEyEX=QRw9A@mail.gmail.com' \
    --to=linux.tech.guy@gmail.com \
    --cc=linuxtechguy@gmail.com \
    --cc=zsh-workers@zsh.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.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).