It might be, but normally I build my .so with the exact same custom libc++ 
which I use to build my android app. I am also able to perform other 
operations on the object such as ->Get

On Thursday, September 12, 2019 at 4:16:00 PM UTC+3, Jakob Gruber wrote:
>
> Could this be another libcxx mismatch issue and 7.7 just exposes it 
> incidentally?
>
> On Thu, Sep 12, 2019 at 2:54 PM Darin Dimitrov <darin....@gmail.com 
> <javascript:>> wrote:
>
>> I am cross compiling V8 for android and I have created a shared library 
>> containing a simple function which adds some property to a provided object:
>>
>> extern "C" void MyFunc(Isolate* isolate, Local<Object>& obj) {
>>     Local<Context> context = isolate->GetCurrentContext();
>>     obj->Set(context, v8::String::NewFromUtf8(isolate, 
>> "someProp").ToLocalChecked(), Number::New(isolate, 500));
>> }
>>
>>
>> My goal  purpose is to call this function from my android application in 
>> which I have embedded V8:
>>
>>
>> typedef void (*MyCallback)(Isolate* isolate, Local<Object>& obj);
>>
>>
>> void* handle = 
>> dlopen("/data/data/com.tns.testapplication/files/app/modules/libCalc-x86_64.so",
>>  RTLD_LAZY);
>>
>> MyCallback func = reinterpret_cast<MyCallback>(dlsym(handle, "MyFunc"));
>> Local<Object> exportsObj = Object::New(isolate);
>> func(isolate, exportsObj);
>>
>>
>> This successfully invokes "MyFunc" from the shared library and sets the 
>> "someProp" property on the passed object. 
>>
>>
>> Starting from V8 *7.7.299.11* calling obj->Set() inside the library crashes 
>> with SIGSEGV and without any stacktrace.
>>
>>
>> I have noticed that if I set the property before calling the function then 
>> it works:
>>
>>
>> exportsObj->Set(context, v8::String::NewFromUtf8(isolate, 
>> "someProp").ToLocalChecked(), v8::Null(isolate));
>> func(isolate, exportsObj);
>>
>>
>> Any idea what might have changed between the official V8 7.6 and 7.7 
>> releases that might explain this behaviour or any tips that would allow me 
>> to debug this further?
>>
>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@googlegroups.com <javascript:>
>> 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-u...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/v8-users/48a71b41-b96e-41ec-9450-fa36d6f1bb45%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/v8-users/48a71b41-b96e-41ec-9450-fa36d6f1bb45%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/296771f5-3a59-4d58-be15-7ed23f1b4a1b%40googlegroups.com.

Reply via email to