[v8-users] Segfault calling v8::Persistent::Reset.

2016-12-01 Thread Jane Chen
Embedding v8 5.3.  Seeing a segfault in our stress test:

Critical: #6  0x7fbf3f6c0173 in 
v8::internal::GlobalHandles::Node::Release() () from lib/libv8.so

This happens when v8::Persistent::Reset is called.

Has anyone else seen this?  Any clues on what might be wrong?

Thanks.


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


Re: [v8-users] [novice] SIGSEGV upon entering new top of the stack context

2016-12-01 Thread Ben Noordhuis
On Thu, Dec 1, 2016 at 9:55 PM, Thomas Barusseau
 wrote:
> I read somewhere that if Isolate::GetCurrent() returned NULL, it was
> because the current isolate was being already used, I guess by the running
> node.js itself?

Node.js never unlocks the isolate while running so if
Isolate::GetCurrent() returns NULL, you either call it from a
different thread or at program exit when the VM has been shut down.

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


Re: [v8-users] [novice] SIGSEGV upon entering new top of the stack context

2016-12-01 Thread Thomas Barusseau
Hello,

That makes sense, and I was pretty sure that just creating a new isolate was
clearly not the way to go. Since I'm dealing with Persistent objects, what 
should
I do, then? I read somewhere that if Isolate::GetCurrent() returned NULL, 
it was
because the current isolate was being already used, I guess by the running
node.js itself?

If so, I really need assistance, because I technically can't stop it 
(because other
modules are running on it and some are time-sensitive), and even if I 
could, I don't
see how I'd do that.

I can't test your suggestions right now but will try tomorrow and make a 
follow-up.

Thanks a lot!

On Thursday, December 1, 2016 at 8:34:41 PM UTC+1, Ben Noordhuis wrote:
>
> On Thu, Dec 1, 2016 at 5:09 PM, Thomas Barusseau 
>  wrote: 
> > Hello, 
> > 
> > I'm having a hard time making this piece of code work. Basically, I need 
> to 
> > take a node.js function (in this case : `process.emit()`), 
> > store it in a C++ class, and use it at runtime whenever a callback 
> method is 
> > called. 
> > 
> > Here is the code : 
> > https://gist.github.com/Neph0/21bcfcebc23596f76defad0e743ec929 
> > 
> > And here is gdb's output : 
> > https://gist.github.com/Neph0/0e668d427e2788c54f3d9b744c9a7abc 
> > 
> > Could anyone help me with that? There's no doubt my code has stupid 
> things 
> > in it. 
> > I've read a lot of documentation today but somehow I can't figure out 
> some 
> > things and I'm stuck trying things without fully understanding 
> > the big picture... 
> > 
> > Thanks in advance. 
>
> From your gist: 
>
>  Local context = isolate->GetCurrentContext(); 
> context->Enter(); // /!\ SIGSEGV HAPPENS HERE /!\ 
>
> I bet that context.IsEmpty() is true.  You could move this line up: 
>
>  Local lpe = Local::New(isolate, process_emit); 
>
> And then you can get its context with lpe->CreationContext(). 
>
> One last word of advice: conditionally creating a new isolate when 
> Isolate::GetCurrent() returns NULL is not going to work.  Objects and 
> functions are intrinsically tied to the isolate that created them. 
>

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


[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
That didn't work. V8 insisted on linking with the asan runtime included 
with it's special version of clang, so mkpeephole wouldn't run because it 
couldn't find ___asan_version_mismatch_check_apple_800. I'm going to try 
playing with the executable path.

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


[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
Well, I looked a little more closely at the compiler options and discovered 
that my library is not, in fact, getting compiled with ASAN. Only V8 is.

Now the problem is that if I compile the library with the same compiler as 
V8, it can't find @executable_path/libclang_rt.asan_osx_dynamic.dylib, but 
if I compile it with the system version of clang, I still get a missing 
___asan_version_mismatch_check_v8, because the binary includes 
___asan_version_mismatch_check_apple_800 instead.

I'm going to try compiling V8 with system clang, hopefully that'll work.

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


[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
I just tried compiling my library with the same prebuilt compiler used for 
v8 (third_party/llvm-build/Release+Asserts/bin/clang), and it still didn't 
work.

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


[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
Also, d8 loads fine.

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


[v8-users] Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
I'm trying to build both V8 and my library that embeds with the address 
sanitizer, and I'm getting this error when trying to load my library:

dlopen(v8py.so, 2): Symbol not found: ___asan_version_mismatch_check_v8
  Referenced from: v8py.so
  Expected in: flat namespace
 in v8py.so

What's going on?

Potentially relevant information:

   - My library is a dynamic-link library that statically links with V8. 
   I'm building V8 with -fPIC so that this can work.
   - V8 is being built with the prebuilt version of clang downloaded by 
   gclient sync, and my library is built with the version of clang that comes 
   with macos.
   - I can't find ___asan_version_mismatch_check_v8 anywhere in the V8 
   source, or anywhere on Google or Github. So I have no idea what it's for or 
   what it does.

~Theodore

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


[v8-users] Re: [novice] SIGSEGV upon entering new top of the stack context

2016-12-01 Thread Zac Hansen
I don't know the exact answer ottomh, but make sure you're running against 
a debug build - the error messages are a little better.  Also, maybe try 
putting a handlescope before th eline that's crashing?

--Zac

On Thursday, December 1, 2016 at 8:09:01 AM UTC-8, Thomas Barusseau wrote:
>
> Hello,
>
> I'm having a hard time making this piece of code work. Basically, I need 
> to take a node.js function (in this case : `process.emit()`),
> store it in a C++ class, and use it at runtime whenever a callback method 
> is called.
>
> Here is the code : 
> https://gist.github.com/Neph0/21bcfcebc23596f76defad0e743ec929
>
> And here is gdb's output : 
> https://gist.github.com/Neph0/0e668d427e2788c54f3d9b744c9a7abc
>
> Could anyone help me with that? There's no doubt my code has stupid things 
> in it.
> I've read a lot of documentation today but somehow I can't figure out some 
> things and I'm stuck trying things without fully understanding
> the big picture...
>
> Thanks in advance.
>

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


[v8-users] [novice] SIGSEGV upon entering new top of the stack context

2016-12-01 Thread Thomas Barusseau
Hello,

I'm having a hard time making this piece of code work. Basically, I need to 
take a node.js function (in this case : `process.emit()`),
store it in a C++ class, and use it at runtime whenever a callback method 
is called.

Here is the code 
: https://gist.github.com/Neph0/21bcfcebc23596f76defad0e743ec929

And here is gdb's output 
: https://gist.github.com/Neph0/0e668d427e2788c54f3d9b744c9a7abc

Could anyone help me with that? There's no doubt my code has stupid things 
in it.
I've read a lot of documentation today but somehow I can't figure out some 
things and I'm stuck trying things without fully understanding
the big picture...

Thanks in advance.

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