RejectedSoftware Forums

Sign up

memory error after file upload

I've been testing the file uploader for my site, and it's been working great for images/small files. After trying a 6.4MB .ogg, however, I've been receiving a memory error and the site crashes. Iterating through the req.files to see if the file is arriving does not show a result, assuming it makes it that far. The memory error handler is functioning properly for everything else.

etc.linux.memoryerror.NullPointerError@src/etc/linux/memoryerror.d(325)
----------------
??:? void etc.linux.memoryerror.sigsegvUserspaceProcess(void*) [0xf7b0a341]
??:? void etc.linux.memoryerror.sigsegvDataHandler() [0xf7b0a282]
??:? @safe void vibe.stream.operations.readUntilSmall!(vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, vibe.core.stream.InputStream).readUntilSmall(vibe.core.stream.InputStream, ref vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, const(ubyte[]), ulong) [0xf79a881c]
??:? @safe void vibe.stream.operations.readUntil!(vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, vibe.core.stream.InputStream).readUntil(vibe.core.stream.InputStream, ref vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, const(ubyte[]), ulong) [0xf79a87a2]
??:? @safe void vibe.stream.operations.readLine!(vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, vibe.core.stream.InputStream).readLine(vibe.core.stream.InputStream, ref vibe.utils.array.AllocAppender!(ubyte[], ubyte).AllocAppender, ulong, immutable(char)[]) [0xf79a8744]
??:? @safe ubyte[] vibe.stream.operations.readLine!(vibe.core.stream.InputStream).readLine(vibe.core.stream.InputStream, ulong, immutable(char)[], std.experimental.allocator.IAllocator) [0xf79a86fe]
??:? @trusted immutable(char)[] vibe.inet.webform.parseMultiPartForm!(vibe.core.stream.InputStream).parseMultiPartForm(ref vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], true, 16uL, false).DictionaryList, ref vibe.utils.dictionarylist.DictionaryList!(vibe.inet.webform.FilePart, true, 0uL, false).DictionaryList, immutable(char)[], vibe.core.stream.InputStream, ulong).__lambda7() [0xf7a39686]
??:? @safe void vibe.inet.webform.parseMultiPartForm!(vibe.core.stream.InputStream).parseMultiPartForm(ref vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], true, 16uL, false).DictionaryList, ref vibe.utils.dictionarylist.DictionaryList!(vibe.inet.webform.FilePart, true, 0uL, false).DictionaryList, immutable(char)[], vibe.core.stream.InputStream, ulong) [0xf7a394ff]
??:? @safe bool vibe.inet.webform.parseFormData(ref vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], true, 16uL, false).DictionaryList, ref vibe.utils.dictionarylist.DictionaryList!(vibe.inet.webform.FilePart, true, 0uL, false).DictionaryList, immutable(char)[], vibe.core.stream.InputStream, ulong) [0xf7a38de1]
??:? @safe void vibe.http.server.HTTPServerRequest.parseFormAndFiles() [0xf79af449]
??:? ref @property @safe vibe.utils.dictionarylist.DictionaryList!(vibe.inet.webform.FilePart, true, 0uL, false).DictionaryList vibe.http.server.HTTPServerRequest.files() [0xf79af490]
??:? @safe bool vibe.http.server.handleRequest(vibe.core.stream.Stream, vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext, ref vibe.http.server.HTTPServerSettings, ref bool, scope std.experimental.allocator.IAllocator) [0xf79f5c56]
??:? @trusted void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext).__lambda4() [0xf79f3fe4]
??:? @safe void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPServerContext) [0xf79f3e0f]
??:? nothrow @safe void vibe.http.server.listenHTTPPlain(vibe.http.server.HTTPServerSettings, void delegate(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) @safe).doListen(vibe.http.server.HTTPServerContext, bool, bool).__lambda4(vibe.core.net.TCPConnection) [0xf79b2984]
??:? void vibe.core.drivers.libevent2_tcp.ClientTask.execute() [0xf7ac8e11]
??:? void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) [0xf7a7047b]
??:? void vibe.core.core.CoreTask.run() [0xf7a6cd1e]
??:? void core.thread.Fiber.run() [0xf7b5aa53]
??:? fiber_entryPoint [0xf7b5a7b2]
??:? [0xffffffff]

Re: memory error after file upload

Am 08.11.2017 um 01:01 schrieb Chuck:

I've been testing the file uploader for my site, and it's been working great for images/small files. After trying a 6.4MB .ogg, however, I've been receiving a memory error and the site crashes. Iterating through the req.files to see if the file is arriving does not show a result, assuming it makes it that far. The memory error handler is functioning properly for everything else.

This bug was introduced in the last release and is fixed on master,
as well as in 0.8.2-alpha.3. Running "dub upgrade --prerelease" should
fix it.