[Webkit-unassigned] [Bug 65399] New: StackBounds checker fails on custom stack implementations (typically in a coroutine setting)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 29 16:08:23 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65399

           Summary: StackBounds checker fails on custom stack
                    implementations (typically in a coroutine setting)
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: coffeemug at gmail.com


Much of the code in JavaScriptCore (specifically the parser), rely on the StackBounds class to check that the interpreter doesn't blow the stack in deeply recursive situations. StackBounds sets the m_origin and m_bound member variables in its initialize() member in order to define the stack limits and has custom implementations for different platforms. We're embedding JavaScriptCore into our database project, and the bounds checking breaks down for us for the following reason. Our project is heavily event-driven, and instead of starting a thread per client, we start a thread per CPU core, and multiplex multiple coroutines within each thread. Our coroutine implementation manually manages the stack pointer register, and allocates the stack space for each coroutine on the heap. This is pretty common in event-driven systems, and is typically achieved via getcontext/setcontext API on POSIX platforms, and the Fibers API on Windows platforms. In order for us to successfully integrat
 e JavaScriptCore we need it to be able to set custom stack bounds, as opposed to using the default implementation provided by the StackBounds class.

I propose adding a function to the API that explicitly sets the stack bounds for a given JSContext. It would be immensely useful for projects that have custom stack implementations:

JS_EXPORT bool JSSetStackBounds(JSContextRef ctx, void *origin, void *bound);

This would set m_origin and m_bound members of the StackBounds class for the given context. I am working on the patch now and would love to see it committed to the tree, however I am new to WebKit and would appreciate any guidance or suggestions for making this change (or perhaps structuring it differently).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list