d8 binary seg faults when moved?

62 views
Skip to first unread message

Charlie Andrews

unread,
Sep 3, 2015, 2:13:14 PM9/3/15
to v8-u...@googlegroups.com
Hi all,

I can check out and build v8, and everything works peachy:

$ mkdir /tmp/v8 && cd /tmp/v8
$ fetch v8 && cd v8
$ build/gyp_v8 -Dtarget_arch=x64
$ ninja -C out/Release/ d8
$ out/out/Release/d8
V8 version 4.5.103.29 [console: dumb]
d8> 

however, then if I move the binary, I receive a segfault when I try to start it:

$ mv out/Release/d8 /tmp/d8
$ /tmp/d8
Segmentation fault (core dumped)
 
Does anyone know why this happens? Is there a way to build v8 so that I can move it around and still have it start properly?

Thanks!

--

Charlie Andrews | Software Engineer | char...@google.com
 

Marcin Cieslak

unread,
Sep 3, 2015, 2:19:31 PM9/3/15
to 'Charlie Andrews' via v8-users
On Thu, 3 Sep 2015, 'Charlie Andrews' via v8-users wrote:

> $ mv out/Release/d8 /tmp/d8
> > $ /tmp/d8
> > Segmentation fault (core dumped)
>
>
> Does anyone know why this happens? Is there a way to build v8 so that I can
> move it around and still have it start properly?

What does your "ldd /tmp/d8" say? Also any backtrace?

~Marcin

Jakob Kummerow

unread,
Sep 4, 2015, 4:14:35 AM9/4/15
to v8-users
You need to copy natives_blob.bin and snapshot_bob.bin along with d8.

(There should probably be a better error message to indicate this.)

Charlie Andrews

unread,
Sep 4, 2015, 2:37:49 PM9/4/15
to v8-users
ldd /tmp/d8 gives:

linux-vdso.so.1 =>  (0x00007ffd7bc52000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efedc7a5000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efedc59d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007efedc299000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007efedbf93000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007efedbd7d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efedbb5f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efedb79a000)
/lib64/ld-linux-x86-64.so.2 (0x00007efedc9a9000)

Moving natives_blob.bin and snapshot_blob.bin along with d8 does fix the problem! Is there any way to avoid having to do this and to package it up as one file instead? We use d8 as a dependency in our project, and ideally we'd like to only have to keep around one file rather than three. (This was how things worked as of 4.3.61, and is also how things seem to work on Mac.)

Jakob Kummerow

unread,
Sep 4, 2015, 2:42:45 PM9/4/15
to v8-users
GYP_DEFINES="v8_use_external_startup_data=0" should do the trick, but I haven't tried it.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Charlie Andrews

unread,
Sep 4, 2015, 3:39:00 PM9/4/15
to v8-u...@googlegroups.com
That did the trick. Thank you both!

You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/3fQiwMi6_jc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages