Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opera browser #107

Closed
jniehus opened this issue Oct 11, 2012 · 5 comments
Closed

opera browser #107

jniehus opened this issue Oct 11, 2012 · 5 comments

Comments

@jniehus
Copy link

jniehus commented Oct 11, 2012

navigating to vibed.org with Opera browser results in bad request (see below).
Do you intend to support Opera?

400 - Bad Request

Bad Request

Internal error information:
core.exception.RangeError AT vibe.utils.memory(266): Range violation

./app(_d_array_bounds+0x26) [0x5f3752]
./app() [0x5dd709]
./app(void[] vibe.utils.memory.PoolAllocator.realloc(void[], ulong)+0xd6) [0x5da5ba]
./app(void vibe.utils.array.AllocAppender!(ubyte[]).AllocAppender.reserve(ulong)+0xc6) [0x5aba9e]
./app(void vibe.stream.memory.MemoryOutputStream.reserve(ulong)+0x6c) [0x5ab7a0]
./app(ubyte[] vibe.stream.stream.readUntil(vibe.stream.stream.InputStream, const(ubyte[]), ulong, vibe.utils.memory.Allocator)+0x88) [0x5d469c]
./app(ubyte[] vibe.stream.stream.readLine(vibe.stream.stream.InputStream, ulong, immutable(char)[], vibe.utils.memory.Allocator)+0x38) [0x5d4610]
./app(void vibe.inet.message.parseRfc5322Header(vibe.stream.stream.InputStream, ref vibe.http.common.StrMapCI, ulong, vibe.utils.memory.Allocator)+0x68) [0x5871c0]
./app(void vibe.http.server.parseRequest(vibe.http.server.HttpServerRequest, vibe.stream.stream.InputStream, vibe.utils.memory.Allocator)+0x277) [0x59c14f]
./app(bool vibe.http.server.handleRequest(vibe.stream.stream.Stream, immutable(char)[], vibe.http.server.HTTPServerListener, ref vibe.http.server.HttpServerSettings)+0x408) [0x59a6b0]
./app(void vibe.http.server.handleHttpConnection(vibe.core.net.TcpConnection, vibe.http.server.HTTPServerListener)+0x1f1) [0x59a1e5]
./app(void vibe.http.server.listenHttpPlain(vibe.http.server.HttpServerSettings, void delegate(vibe.http.server.HttpServerRequest, vibe.http.server.HttpServerResponse)).void doListen(vibe.http.server.HttpServerSettings, vibe.http.server.HTTPServerListener, immutable(char)[]).void __lambda12(vibe.core.net.TcpConnection)+0x36) [0x59735e]
./app(extern (C) void vibe.core.drivers.libevent2_tcp.onConnect(int, short, void*).void ClientTask.execute()+0x2a5) [0x5954a9]
./app(void vibe.core.core.CoreTask.run()+0x7e) [0x5e59fa]
./app(void core.thread.Fiber.run()+0x2a) [0x61d87a]
./app(fiber_entryPoint+0x61) [0x61d78d]
[(nil)]

@s-ludwig
Copy link
Member

That's a bit misterious. I just tested with the latest Opera and everything seems to work. But even stranger is the fact that the realloc() function where the RangeViolation happens is not supposed to have any operation in it that could cause this:

    void[] realloc(void[] arr, size_t newsize)
    {
        bool last_in_pool = m_freePools && arr.ptr+arr.length == m_freePools.remaining.ptr;
        if( last_in_pool && m_freePools.remaining.length+arr.length >= newsize ){
// failing line:
            m_freePools.remaining = arr.ptr[newsize .. m_freePools.remaining.length+arr.length-newsize];
            arr = arr.ptr[0 .. newsize];
            return arr;
        } else {
            auto ret = alloc(newsize);
            assert(ret.ptr >= arr.ptr+arr.length, "New block overlaps old one!?");
            ret[0 .. min(arr.length, newsize)] = arr[0 .. min(arr.length, newsize)];
            return ret;
        }
    }

I can't see a logic error there either...

@jniehus
Copy link
Author

jniehus commented Oct 11, 2012

Could be an OSX thing maybe?
Opera:
Version - 12.02
Build - 1578
Platform - Mac OS X
System - 10.8.2

  • update:
    I just checked the windows side of things and everything appears to work...

@s-ludwig
Copy link
Member

That was it - I do get it from OSX. Off to debugging...

@s-ludwig
Copy link
Member

It was the "-newsize" in the slice end value - I confused it with the slice size. The site is also updated now.

@jniehus
Copy link
Author

jniehus commented Oct 12, 2012

oh nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants