Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Possible Bug



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.


Messages sorted by: Reverse Date, Date, Thread, Author