gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

GPT4All crashing after inputting long text.

Open chenwei025025 opened this issue 1 year ago • 6 comments

Have any of you encountered the problem of GPT4All crashing? Whenever I input a slightly longer text and hit enter, the software just crashes.

chenwei025025 avatar Apr 06 '23 07:04 chenwei025025

this is caused by a buffer overflow in the interactive mode of alpaca.cpp, of which GPT4All is a fork. The input buffer is only 256 bytes long, so inputting more than 254 characters of text (plus the carriage return and line feed) will overflow this buffer and cause the program to crash, see: https://github.com/antimatter15/alpaca.cpp/issues/119

pkootstra avatar Apr 06 '23 08:04 pkootstra

thank you very much.

chenwei025025 avatar Apr 06 '23 16:04 chenwei025025

how do we increase this buffer?

Villagerjj avatar Apr 07 '23 15:04 Villagerjj

Anyway to increase the buffer?

PlutoniaX avatar Apr 11 '23 13:04 PlutoniaX

Anyway to increase the buffer?

Not without recompiling the program. But you can work around it by splitting up long lines using a backslash, like this:

Pretend this is a very long line, \
that has been split up into two lines.\
This is the final line...

pkootstra avatar Apr 11 '23 14:04 pkootstra

Let's do a recompile to at least catch the long string and exit with a graceful message vs crashing

pomeara avatar Apr 13 '23 10:04 pomeara

Stale, please open a new issue if this is still relevant.

niansa avatar Aug 11 '23 10:08 niansa