[v8-users] Re: v8 link error when generate cctest.exe

2018-09-18 Thread YJ
Hey Quan,

Sorry. I found time to look into my issue again. I am now fairly certain 
that problem is posix specific. You must have a different issue than what I 
was thinking.


On Wednesday, August 29, 2018 at 11:11:49 PM UTC-7, Quan Chen wrote:
>
> From what I can see in the static lib template, it looks like the thin 
> archive config is removed:
> template("v8_static_library") {
>   static_library(target_name) {
> complete_static_lib = true
> forward_variables_from(invoker, "*", [ "configs" ])
> configs += invoker.configs
> configs -= v8_remove_configs
>* configs -= [ "//build/config/compiler:thin_archive" ]*
> configs += v8_add_configs
>   }
> }
>
> or is it the same thing you mentioned? 
>
> On Thursday, August 30, 2018 at 1:44:37 AM UTC+8, YJ wrote:
>>
>> I might have a similar issue but im on linux. At least in my case, the 
>> problem is that at "some" point since 6.5, v8's build config for 
>> "v8_static_library" starts to do thin archive vs the fat archive(which is 
>> more "static"). I've filed a bug but I haven't had time to track down the 
>> offending commit as they asked.
>>
>> I don't know if it is for sure the same problem on windows. So just an 
>> FYI.
>>
>> On Wednesday, August 29, 2018 at 7:08:59 AM UTC-7, Quan Chen wrote:
>>>
>>> I'm having the same issue now. And same to you I'm trying to build the 
>>> static libs of V8.  Have you come up with any solution?
>>>
>>> On Thursday, June 21, 2018 at 2:32:26 PM UTC+8, Amaranth F wrote:

 I use this parameter to generate the ninja project:

 gn gen out/Release "--args=is_debug=false target_cpu=\"x64\" 
 v8_static_library=true v8_use_snapshot=true 
 v8_use_external_startup_data=false"

 and then run:

 ninja -C out\Release

 when it finally says:

 ninja: Entering directory `out\Release'
 [1/58] LINK cctest.exe cctest.exe.pdb
 FAILED: cctest.exe cctest.exe.pdb
 G:/program/v8new3/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe 
 ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 
 False ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe 
 /nologo 
 /OUT:./cctest.exe /PDB:./cctest.exe.pdb @./cctest.exe.rsp
 G:\program\v8new3\v8\third_party\llvm-build\Release+Asserts\bin\lld-link.exe:
  
 error: : undefined symbol: mainCRTStartup

 How can I compile it, please?

>>>

-- 
-- 
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] Arraybuffer

2018-09-18 Thread dan Med
I was reading this code but i can't figure outwhat av_..._.. stands for
is it already opening the connection here?

static int tcp_open(URLContext *h, const char *uri, int flags){
struct addrinfo hints = { 0 }, *ai, *cur_ai;int port, fd = -1;
TCPContext *s = h->priv_data;const char *p;char buf[256];
int ret;char hostname[1024],proto[1024],path[1024];char
portstr[10];s->open_timeout = 500;av_url_split(proto,
sizeof(proto), NULL, 0, hostname, sizeof(hostname),,
path, sizeof(path), uri);if (strcmp(proto, "tcp"))return
AVERROR(EINVAL);if (port <= 0 || port >= 65536) {av_log(h,
AV_LOG_ERROR, "Port missing in uri\n");return AVERROR(EINVAL);
   }p = strchr(uri, '?');if (p) {if
(av_find_info_tag(buf, sizeof(buf), "listen", p)) {char
*endptr = NULL;s->listen = strtol(buf, , 10);
 /* assume if no digits were found it is a request to enable it */
   if (buf == endptr)s->listen = 1;}
 if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
 s->rw_timeout = strtol(buf, NULL, 10);}if
(av_find_info_tag(buf, sizeof(buf), "listen_timeout", p)) {
s->listen_timeout = strtol(buf, NULL, 10);}}if
(s->rw_timeout >= 0) {s->open_timeout =h->rw_timeout
= s->rw_timeout;}hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;snprintf(portstr, sizeof(portstr),
"%d", port);if (s->listen)hints.ai_flags |= AI_PASSIVE;
if (!hostname[0])ret = getaddrinfo(NULL, portstr, ,
);elseret = getaddrinfo(hostname, portstr, ,
);if (ret) {av_log(h, AV_LOG_ERROR,
"Failed to resolve hostname %s: %s\n",   hostname,
gai_strerror(ret));return AVERROR(EIO);}cur_ai = ai;
restart:#if HAVE_STRUCT_SOCKADDR_IN6// workaround for IOS9
getaddrinfo in IPv6 only network use hardcode IPv4 address can not
resolve port number.if (cur_ai->ai_family == AF_INET6){
struct sockaddr_in6 * sockaddr_v6 = (struct sockaddr_in6
*)cur_ai->ai_addr;if (!sockaddr_v6->sin6_port){
sockaddr_v6->sin6_port = htons(port);}}#endiffd =
ff_socket(cur_ai->ai_family,   cur_ai->ai_socktype,
   cur_ai->ai_protocol);if (fd < 0) {ret =
ff_neterrno();goto fail;}/* Set the socket's send or
receive buffer sizes, if specified.   If unspecified or setting
fails, system default is used. */if (s->recv_buffer_size > 0) {
setsockopt (fd, SOL_SOCKET, SO_RCVBUF, >recv_buffer_size,
sizeof (s->recv_buffer_size));}if (s->send_buffer_size > 0) {
  setsockopt (fd, SOL_SOCKET, SO_SNDBUF, >send_buffer_size,
sizeof (s->send_buffer_size));}if (s->tcp_nodelay > 0) {
 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, >tcp_nodelay, sizeof
(s->tcp_nodelay));}if (s->listen == 2) {//
multi-clientif ((ret = ff_listen(fd, cur_ai->ai_addr,
cur_ai->ai_addrlen)) < 0)goto fail1;} else if
(s->listen == 1) {// single clientif ((ret =
ff_listen_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
  s->listen_timeout, h)) < 0)goto fail1;
 // Socket descriptor already closed here. Safe to overwrite to
client one.fd = ret;} else {if ((ret =
ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
s->open_timeout / 1000, h, !!cur_ai->ai_next))
< 0) {if (ret == AVERROR_EXIT)goto fail1;
  elsegoto fail;}}
h->is_streamed = 1;s->fd = fd;freeaddrinfo(ai);return 0;
fail:if (cur_ai->ai_next) {/* Retry with the next sockaddr
*/cur_ai = cur_ai->ai_next;if (fd >= 0)
closesocket(fd);ret = 0;goto restart;} fail1:
if (fd >= 0)closesocket(fd);freeaddrinfo(ai);return
ret;}


Il giorno mar 18 set 2018 alle ore 21:54 dan Med 
ha scritto:

> I know that i might have written the same thing over and over again but i
> didn't get an answer (which i really need)
>
> When is ArrayBufferBuilder::Append called ?
> Thank you
>
> Il giorno sab 15 set 2018 alle ore 12:34 dan Med 
> ha scritto:
>
>> That’s all.
>>
>> On Fri, 14 Sep 2018 at 21:53, dan Med  wrote:
>>
>>> I don’t understand how that code could be helpful to me..
>>>
>>> On Fri, 14 Sep 2018 at 21:51, dan Med  wrote:
>>>
 Technica question, when Arraybufferbuilder:append will be called ?

 On Fri, 14 Sep 2018 at 01:14, Peter Schow  wrote:

> On Thu, Sep 13, 2018 at 10:45 AM dan Med 
> wrote:
> > That isn’t my question
> > Arraybufferbuilder:append how could I get that to be called.
> > What I really need is a little guidance on how to understand how v8
> will parse my JavaScript script and how it will allocate the data.
> > Maybe even how a buffer or if there’s something that describes how
> 

[v8-users] Re: ChromeDevTools connected to Inspector, but error responses... missing native JS functions?

2018-09-18 Thread @soylentgraham
YetAnotherUpdate

After some more digging, I found the issue I have is identified node and 
chromium too... 
https://github.com/nodejs/node/commit/b1e26128f317a6f5a5808a0a727e98f80f088b84

So, it looks like the default v8 [platform] isn't chrome-dev-tools 
compatible.
Ibon's case worked as it has a specific Android platform implementation. 
Chromium and Node also have their own platform.

So, I made the most basic platform proxy possible to work around it...
https://github.com/SoylentGraham/V8InspectorMinimal/blob/master/src/TV8Platform.h

And it works!
I can now modify code on the fly, execute from the console.
I can't seem to debug, and pressing pause-execution a few times gives me a 
new assert, but the higher level code is a bit of a mess at this point, so 
I'm probably implementing something wrong...

Still, if anyone else ever finds this problem... V8 alone cannot be used 
with chrome dev tools. (as of 7.1.0.0  

4544e18b0c3845a9fca422cf0903df4803343cf1)

On Friday, 14 September 2018 11:44:33 UTC+1, @soylentgraham wrote:
>
> So the core of my issue at the moment, is this assert (UNIMPLEMENTED)
>
> void 
> DefaultWorkerThreadsTaskRunner::PostDelayedTask(std::unique_ptr task,
>
>  double 
> delay_in_seconds) {
>
>   base::LockGuard guard(_);
>
>   if (terminated_) return;
>
>   if (delay_in_seconds == 0) {
>
> queue_.Append(std::move(task));
>
> return;
>
>   }
>
>   // There is no use case for this function with non zero delay_in_second 
> on a
>
>   // worker thread at the moment, but it is still part of the interface.
>
>   UNIMPLEMENTED();
>
> }
>
> from 
>
> DefaultPlatform::CallDelayedOnWorkerThread(
>
> being called by
>
> protocol::Response V8InspectorImpl::EvaluateScope::setTimeout(double 
> timeout) {
>
>   if (m_isolate->IsExecutionTerminating()) {
>
> return protocol::Response::Error("Execution was terminated");
>
>   }
>
>   m_cancelToken.reset(new CancelToken());
>
>   v8::debug::GetCurrentPlatform()->CallDelayedOnWorkerThread(
>
>   v8::base::make_unique(m_isolate, m_cancelToken), 
> timeout);
>
>   return protocol::Response::OK();
>
> }
>
>
>
> so, SetTimeout in the inspector, explicitly uses something we[developers] 
> know isn't implemented...
> From reading things before, Node.js was using the default platform, I 
> think now it has it's own platform. Maybe chromium does too...
> Perhaps the demo/unittest debugger/d8/inspector doesn't call settimeout, 
> so this hasn't been found with default setups...
>
> Maybe I HAVE to implement my own platform to support chrome dev tools and 
> handle delayed jobs...
>
>
> On Thursday, 13 September 2018 17:14:58 UTC+1, @soylentgraham wrote:
>>
>> For any future readers;
>> I went back to trying to build a debug v8 set of libs (wouldnt compile 
>> before, added is_component_build=false which I think fixed that)
>> Built with latest master (4544e18b0c3845a9fca422cf0903df4803343cf1) 
>>
>> Which forced me to correct a few uses of deprecated functions, including 
>> v8::String::NewFromUtf8() with no isolate, so *possibly* that was the 
>> source of the crash re: scriptorigin. I now get an origin in CDT (kinda, it 
>> still breaks in a VMXX file)
>>
>> Then asserts as before in "code that should never be reached" (see 
>> earlier in the thread)
>>
>> [image: Screen Shot 2018-09-13 at 17.08.09.png]
>>
>>
>>
>> On Wednesday, 12 September 2018 17:34:30 UTC+1, @soylentgraham wrote:
>>>
>>> With a lot of back & forth help from Ibon/hyperandroid, we've got a bit 
>>> further in working out which things are good, and which are bad. 
>>> Feels like we're close, but things are still unstable, and a bit 
>>> unresponsive.
>>>
>>> I can kinda break into the code (which only shows *this *in sources)
>>> Still get the assert above from trying to autocomplete too many times. 
>>> (albeit after a RunMessageLoop callback now)
>>> And if I add a script origin, I get a crash trying to stacktrace 
>>> (immediately when connecting, still trying to figure this out, as my 
>>> scriptorigin is okay)
>>>
>>> More stripped back version here (cutting more dependencies out, but all 
>>> my setup, inspector, frontend, messaging is in v8minimal.cpp)
>>> https://github.com/SoylentGraham/V8InspectorMinimal
>>>
>>> On Monday, 27 August 2018 13:49:37 UTC+1, @soylentgraham wrote:

 Through various sources (ie, googling & github) I've finally got a bit 
 of a grasp of the flow for connecting chrome dev tools to my v8 app. 
 (which 
 is using a pretty recent HEAD build I've built myself with all default 
 settings other than compiling as a static lib[s]. v8-version.h says 
 7.0.0.0)

 I connect via an explicit url (can't quite get json/list/ to show up in 
 chrome yet)
 *chrome-devtools://devtools/bundled/inspector.html?experiments=true=true=127.0.0.1:8008
  
 *
 (Not sure how relevant the v8only=true and experiments=true are, 
 couldn't