On Thu, Jul 13, 2017 at 3:21 AM, Sam Weaver <[email protected]> wrote:
>
> If this isn't the right place for this, please direct me to where I can
> submit a proper bug report. Keep in mind I'm a web developer with limited
> knowledge of lower level systems programming, so please forgive me if I make
> some mistake or error in explaining.
>
> Over on sass/node-sass, I found an odd issue compiling Sass code, causing
> the error code 3221225477, which is the Windows C0000005 error,
> ACCESS_VIOLATION. An access violation is something that should never be
> possible within node, and I believe I've traced the issue to V8.
>
> I caught the exception and began debugging the program in Visual Studio
> 2015. The point at which the error occurred was on line 5880 (actually, that
> is the version of v8 in the nodejs/node repository for node version v6.9.1,
> the version I found in the code in the v8/v8 repository on GitHub today is
> on line 6862) of api.cc:
>
> if (length < 0) length = StringLength(data);
>
> Further drilling in to the StringLength function presents this code:
>
> inline int StringLength(const char* string) {
>   return i::StrLength(string);
> }
>
> And then drilling into the StrLength function, there is this code:
>
> inline int StrLength(const char* string) {
>    size_t length = strlen(string);
>    ASSERT(length == static_cast<size_t>(static_cast<int>(length)));
>    return static_cast<int>(length);
> }
>
> With my limited knowledge of C++, I believe that passing a null pointer to
> this function would cause the error I'm encountering... is this accurate? If
> so, should there be some sort of check here?
>
> Much thanks,
> Sam

Looking at the node-sass issue you figured this out already but for
posterity, calling String::NewFromUtf8(), String::NewFromTwoByte(),
etc. with a nullptr is not legal.

It works when you pass length=0 but not length=-1, because that
signifies the string is zero-terminated.

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to