Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD Build --with-dtrace fails #461

Closed
No9 opened this issue Jan 16, 2015 · 23 comments
Closed

FreeBSD Build --with-dtrace fails #461

No9 opened this issue Jan 16, 2015 · 23 comments

Comments

@No9
Copy link
Member

No9 commented Jan 16, 2015

Apologies if this is a known issue as I seem to recall from a nodeup that there was some significant changes for DTrace going into 0.12.

Anyway I hope this is useful

The same issue presents on node v0.11.14 on the same system.
But on the same system v0.10.35 compiles OK
(But has the post compilation problem highlighted here
https://gist.github.com/indutny/d3fee964995eea206fb3)

On a digital ocean droplet..
Full info on all the ENV config I did here:
http://venshare.com/2015/01/16/dtrace-with-iojs-on-freebsd-10-1-using-digital-ocean/

So the following:

> sudo ./configure --with-dtrace --dest-cpu=x64
> sudo gmake

Fails with

fockf /usr/home/freebsd/io.js/out/Release/linker.lock g++ -pthread -rdynamic -m64 -Wl,--export-dynamic -Wl,--whole-archive /usr/home/freebsd/io.js/out/Release/libopenssl.a -Wl,--no-whole-archive -Wl,-z,noexecstack -Wl,--whole-archive /usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a -Wl,--no-whole-archive -pthread  -o /usr/home/freebsd/io.js/out/Release/iojs -Wl,--start-group /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/debug-agent.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/async-wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/fs_event_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/cares_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/handle_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_buffer.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_constants.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_contextify.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_file.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_http_parser.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_javascript.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_main.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_os.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_v8.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_v8_platform.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_stat_watcher.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_watchdog.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_zlib.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_i18n.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/pipe_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/signal_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/smalloc.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/spawn_sync.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/string_bytes.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/stream_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/tcp_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/timer_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/tty_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/process_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/udp_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/uv.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/util.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_crypto.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_crypto_bio.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_crypto_clienthello.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/tls_wrap.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_ustack.o /usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_provider.o /usr/home/freebsd/io.js/out/Release/obj.target/deps/cares/libcares.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/openssl/libopenssl.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/zlib/libzlib.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/http_parser/libhttp_parser.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/uv/libuv.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_libbase.a /usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_snapshot.a -Wl,--end-group -lelf -lutil -lkvm -L/usr/local/lib -lexecinfo -lm
clang++: error: no such file or directory: '/usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_ustack.o'
clang++: error: no such file or directory: '/usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_provider.o'
iojs.target.mk:198: recipe for target '/usr/home/freebsd/io.js/out/Release/iojs' failed
gmake[1]: *** [/usr/home/freebsd/io.js/out/Release/iojs] Error 1
gmake[1]: Leaving directory '/usr/home/freebsd/io.js/out'
Makefile:52: recipe for target 'iojs' failed
gmake: *** [iojs] Error 2
@bnoordhuis
Copy link
Member

@indutny or @jbergstroem, maybe one of you can take a look?

@jbergstroem
Copy link
Member

Pretty busy at the moment, but the issue at least seems to start from tools/genv8constants.py not generating a proper header; the output is essentially empty from this:

builder% tools/genv8constants.py foo.h /usr/home/jbergstroem/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a && cat foo.h 

/*
 * File automatically generated by genv8constants. Do not edit.
 *
 * The following offsets are dynamically from libv8_base.a.  See src/v8ustack.d
 * for details on how these values are used.
 */

#ifndef V8_CONSTANTS_H
#define V8_CONSTANTS_H



#endif /* V8_CONSTANTS_H */

@indutny
Copy link
Member

indutny commented Jan 19, 2015

Oh gosh, need to look into it.

@No9
Copy link
Member Author

No9 commented Jan 23, 2015

So @indutny @jbergstroem spent a little time on this tonight.

objdump -z -D /usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a | grep frametype_EntryFrame
Returns nothing

But
objdump -z -D /usr/home/freebsd/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a | grep frametype_EntryFrame
In the node v.0.10.35 build returns
0000000000000000 <v8dbg_frametype_EntryFrame>:

So it would seem that the technique used to identify the V8_CONSTANTS in tools/genv8constants.py is not going to work with the current build output of
/usr/home/freebsd/io.js/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a

Could there be an option missing on the V8 build part that is preventing the inclusion of the v8dbg sym?
Or have they gone away completely in this version of V8?

@indutny
Copy link
Member

indutny commented Feb 2, 2015

Oddly, I got this:

clang++: error: no such file or directory: '/usr/home/indutny/io.js/out/Release/obj.target/iojs/src/node_dtrace_ustack.o'
clang++: error: no such file or directory: '/usr/home/indutny/io.js/out/Release/obj.target/iojs/src/node_dtrace_provider.o'
iojs.target.mk:198: recipe for target '/usr/home/indutny/io.js/out/Release/iojs' failed

When trying to build it... Will figure out details.

@indutny
Copy link
Member

indutny commented Feb 2, 2015

Should be fixed by https://codereview.chromium.org/894003003/, I guess.

@indutny
Copy link
Member

indutny commented Feb 2, 2015

And by partially reverting: 8a83eba

@No9
Copy link
Member Author

No9 commented Feb 2, 2015

@indutny Cheers Ill apply that and see where I get to.

Also can you verify that I will need to patch FreeBSD with
https://svnweb.freebsd.org/base/head/cddl/contrib/opensolaris/lib/lib0dtrace/common/drti.c?pathrev=276250&view=log&r1=276250&log_pagestart=0

Because of dtrace DOF node: .SUNW_dof section corrupt

As mentioned here https://gist.github.com/indutny/d3fee964995eea206fb3#comment-1373787

Thanks again for finding time to dive into these issues 👍

@indutny
Copy link
Member

indutny commented Feb 2, 2015

That svnweb link gives me 404... :(

@No9
Copy link
Member Author

No9 commented Feb 2, 2015

Hmmm yup broken for me too :(

This is the another view here.
https://svnweb.freebsd.org/base?view=revision&revision=276250

@indutny
Copy link
Member

indutny commented Feb 2, 2015

Yeah, this is the fix. Luckily, it does not require rebuilding kernel.

@No9
Copy link
Member Author

No9 commented Feb 3, 2015

So applyied the patches to
globals.h
objects.h
gen-postmortem-metadata.py
And common.gypi has the patch you mention
But still getting

clang++: error: no such file or directory: '/usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_ustack.o'
clang++: error: no such file or directory: '/usr/home/freebsd/io.js/out/Release/obj.target/iojs/src/node_dtrace_provider.o'
iojs.target.mk:198: recipe for target '/usr/home/freebsd/io.js/out/Release/iojs' failed
gmake[1]: *** [/usr/home/freebsd/io.js/out/Release/iojs] Error 1
gmake[1]: Leaving directory '/usr/home/freebsd/io.js/out'
Makefile:52: recipe for target 'iojs' failed
gmake: *** [iojs] Error 2

Have I missed something?

@indutny
Copy link
Member

indutny commented Feb 3, 2015

Looking...

@indutny
Copy link
Member

indutny commented Feb 3, 2015

@No9 see https://github.com/indutny/io.js/tree/fix/postmortem for progress. So far getting:

failed to resolve INP_IPV4: Unknown variable name

@indutny
Copy link
Member

indutny commented Feb 3, 2015

Yay, this was because I forgot to: kldload dtraceall. Next error:

V8DBG_ASCIISTRINGTAG

@indutny
Copy link
Member

indutny commented Feb 3, 2015

@No9 landed last patch, should be working fine now. Could you please verify?

@No9
Copy link
Member Author

No9 commented Feb 3, 2015

Cloning and testing now

@No9
Copy link
Member Author

No9 commented Feb 3, 2015

Yeah built !!

$ node
dtrace DOF iojs: .SUNW_dof section corrupt
dtrace DOF iojs: .SUNW_dof section corrupt
> process.version
> 'v1.0.5'

Now I have to put the BSD patch in to get rid of

dtrace DOF iojs: .SUNW_dof section corrupt
dtrace DOF iojs: .SUNW_dof section corrupt

Should we validate this on illumOS too?

@indutny
Copy link
Member

indutny commented Feb 3, 2015

idk, do we want to? :) Thanks for testing FreeBSD.

@No9
Copy link
Member Author

No9 commented Feb 3, 2015

LOL I have an openindiana I can take for a quick spin. Ill kick it off now "to be sure to be sure"

@indutny indutny mentioned this issue Feb 3, 2015
@indutny
Copy link
Member

indutny commented Feb 3, 2015

See #706 for complete rebased fix.

indutny added a commit that referenced this issue Feb 3, 2015
Fix: #461
PR-URL: #706
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
indutny added a commit that referenced this issue Feb 3, 2015
Fix: #461
PR-URL: #706
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
indutny added a commit that referenced this issue Feb 3, 2015
Fix: #461
PR-URL: #706
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@indutny
Copy link
Member

indutny commented Feb 3, 2015

Assuming "fixed"!

@indutny indutny closed this as completed Feb 3, 2015
@No9
Copy link
Member Author

No9 commented Feb 3, 2015

Yeah so all my illumOS distros are back at g++4.6 so I couldn't validate that easily
Happy to call it fixed too
Thanks for taking time on the @indutny

bnoordhuis pushed a commit to bnoordhuis/io.js that referenced this issue Feb 25, 2015
Fix: nodejs#461
PR-URL: nodejs#706
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants