Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Crash in webserver when declaring very first HandleScope
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stephan Beal  
View profile  
 More options Jun 7 2011, 10:28 am
From: Stephan Beal <sgb...@googlemail.com>
Date: Tue, 7 Jun 2011 16:28:39 +0200
Local: Tues, Jun 7 2011 10:28 am
Subject: Re: [v8-users] Crash in webserver when declaring very first HandleScope

On Tue, Jun 7, 2011 at 10:02 AM, Stephan Beal <sgb...@googlemail.com> wrote:
> On Tue, Jun 7, 2011 at 7:50 AM, Charles Lowell <cowb...@thefrontside.net>wrote:

>> I noticed that if I initialize v8 in one thread, and then try and do
>> *anything* in a different thread without using a v8::Locker (even
>> ...

> To expand a tiny bit on Mads' answer: if your library-level routines will
> use a Locker, be sure that you main() (or pre-v8-setup) routine also
> contains a Locker in place. If you don't, the lib-level routines will crash
> with a

Correction: if you use an UNLocker in library-level code, be sure that at
least one Locker is in place (ideally in main() or equivalent).

A bit of background: i added a v8 binding for the C sleep() routine and it
looked something like this:

Unlocker sentry;
::sleep(...);

the point being to free up v8 for activity while sleep() was doing nothing.

The problem is that if there is no Locker in place, the Unlocker will
trigger an assertion, killing v8 and your app. When working at the
library-level, as opposed to the app level, we cannot assume that a Locker
is always in place (as that assumption causes the above code to crash the
client's app), and we have no way of knowing if one is active.

So i recommend adding a Locker to the base v8 initialization code for a
given app, since that app might run scripts which themselves run a function
(like sleep()) which uses an Unlocker.

--
----- stephan beal
http://wanderinghorse.net/home/stephan/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.