zsh-workers
 help / color / mirror / code / Atom feed
From: Brian Millar <D00144121@student.dkit.ie>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Possible Bug
Date: Mon, 31 Aug 2015 21:30:34 +0000	[thread overview]
Message-ID: <AM2PR03MB0980E6D5549A6ABD3EB9D43BEA6B0@AM2PR03MB0980.eurprd03.prod.outlook.com> (raw)

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

Hi, I think I may have discovered a bug in ZSH.

I was trying to install a prompt theme and I mixed things up moved things and named things wrong.

This resulted in the file wanted by the set_prompt actually being a directory.

ZSH would crash on start, if I ran it on top of another shell I could see the error was "set_prompt:100: fatal error: out of memory".

I traced it and found that the open() syscall ran on the directory, the result was passed to lseek() with argument SEEK_END which I don't think makes any sense for a directory.

lseek() returned an astronomically huge value which was passed to mmap() as bytes to allocate. Thats when the crash happens.

I talked to some kernel folks who say you should check that the file coming from open() is not anything other than a normal file.

If this is not a ZSH  bug I'm sorry for wasting your time.

             reply	other threads:[~2015-08-31 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 21:30 Brian Millar [this message]
2015-09-01  5:53 ` Bart Schaefer
2015-09-01 12:02   ` Brian Millar
2015-09-01 20:51   ` Peter Stephenson

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=AM2PR03MB0980E6D5549A6ABD3EB9D43BEA6B0@AM2PR03MB0980.eurprd03.prod.outlook.com \
    --to=d00144121@student.dkit.ie \
    --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).