Bug 194757 - www/seamonkey: DTRACE is broken on 11.0-CURRENT
Summary: www/seamonkey: DTRACE is broken on 11.0-CURRENT
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-02 11:50 UTC by mikhail.rokhin
Modified: 2014-11-26 19:48 UTC (History)
1 user (show)

See Also:


Attachments
proposed fix (3.25 KB, patch)
2014-11-06 19:41 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mikhail.rokhin 2014-11-02 11:50:46 UTC
Executing: c++ -o js -Qunused-arguments -isystem/usr/local/include -DLIBICONV_PLUG -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Werror=conversion-null -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -O2 -pipe -march=native -O3 -DLIBICONV_PLUG -fno-strict-aliasing -DLIBICONV_PLUG -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -O2 -O3 -fno-omit-frame-pointer /usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla/js/src/shell/tmpwi9BHS.list -pthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib/seamonkey -Wl,-z,noexecstack -Wl,-z,text -Wl,-rpath-link,../../../dist/bin -Wl,-rpath-link,/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla/dist/lib -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread -lz -Wl,--whole-archive ../../../dist/lib/libmozglue.a -Wl,--no-whole-archive -rdynamic -lm -lelf -L/usr/local/lib -lffi -licui18n -L/usr/local/lib -licuuc -licudata
/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla/js/src/shell/tmpwi9BHS.list:
    INPUT("Unified_cpp_js_src_shell0.o")
    INPUT("../editline/Unified_c_js_src_editline0.o")
    INPUT("../RegExp.o")
    INPUT("../Parser.o")
    INPUT("../jsarray.o")
    INPUT("../jsatom.o")
    INPUT("../jsmath.o")
    INPUT("../jsutil.o")
    INPUT("../ExecutableAllocatorPosix.o")
    INPUT("../MacroAssemblerX86Common.o")
    INPUT("../CTypes.o")
    INPUT("../Library.o")
    INPUT("../pm_stub.o")
    INPUT("../Unified_cpp_js_src0.o")
    INPUT("../Unified_cpp_js_src1.o")
    INPUT("../Unified_cpp_js_src2.o")
    INPUT("../Unified_cpp_js_src3.o")
    INPUT("../Unified_cpp_js_src4.o")
    INPUT("../Unified_cpp_js_src5.o")
    INPUT("../Unified_cpp_js_src6.o")
    INPUT("../Unified_cpp_js_src7.o")
    INPUT("../Unified_cpp_js_src8.o")
    INPUT("../Unified_cpp_js_src9.o")
    INPUT("../Unified_cpp_js_src10.o")
    INPUT("../Unified_cpp_js_src11.o")
    INPUT("../mozjs-dtrace.o")

../mozjs-dtrace.o:(.SUNW_dof+0x420): undefined reference to `_ZN2js23NewObjectWithGivenProtoEPNS_16ExclusiveContextEPKNS_5ClassENS_11TaggedProtoEP8JSObjectNS_2gc9AllocKindENS_13NewObjectKi'
../mozjs-dtrace.o:(.SUNW_dof+0x450): undefined reference to `_ZN2js23NewObjectWithGivenProtoEPNS_16ExclusiveContextEPKNS_5ClassENS_11TaggedProtoEP8JSObjectNS_2gc9AllocKindENS_13NewObjectKi'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/ports/www/seamonkey/work/comm-release/mozilla/config/rules.mk:719: recipe for target 'js' failed
gmake[7]: *** [js] Error 1
gmake[7]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla/js/src/shell'
/usr/ports/www/seamonkey/work/comm-release/mozilla/config/recurse.mk:98: recipe for target 'js/src/shell/libs' failed
gmake[6]: *** [js/src/shell/libs] Error 2
gmake[6]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla'
/usr/ports/www/seamonkey/work/comm-release/mozilla/config/recurse.mk:42: recipe for target 'libs' failed
gmake[5]: *** [libs] Error 2
gmake[5]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla'
/usr/ports/www/seamonkey/work/comm-release/mozilla/config/rules.mk:584: recipe for target 'default' failed
gmake[4]: *** [default] Error 2
gmake[4]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0/mozilla'
Makefile:52: recipe for target 'default' failed
gmake[3]: *** [default] Error 2
gmake[3]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0'
/usr/ports/www/seamonkey/work/comm-release/client.mk:398: recipe for target 'build' failed
gmake[2]: *** [build] Error 2
gmake[2]: Leaving directory '/usr/ports/www/seamonkey/work/comm-release/obj-i386-portbld-freebsd11.0'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/seamonkey
*** Error code 1

Stop.
make: stopped in /usr/ports/www/seamonkey

===>>> make build failed for www/seamonkey
===>>> Aborting update
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-02 11:50:46 UTC
Maintainers CC'd
Comment 2 Jan Beich freebsd_committer freebsd_triage 2014-11-04 08:14:00 UTC
Regressed since base r271413 and at least affects www/firefox-esr as well. Fortunately, the commit hasn't been MFC'd to /stable/10 yet.

I think www/firefox-nightly may not be affected.
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2014-11-04 18:45:33 UTC
Thanks for CCing me. I'll have a look.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2014-11-04 19:05:16 UTC
Workaround: MOZ_OPTIONS += --enable-gcgenerational
It's enabled by default in Firefox 32.0, Thunderbird 36.0 and SeaMonkey 2.32.

https://hg.mozilla.org/mozilla-central/rev/786057e01ef3
https://hg.mozilla.org/comm-central/rev/75d4ca0905b6
https://hg.mozilla.org/comm-central/rev/34a381aecdf7
Comment 5 Mark Johnston freebsd_committer freebsd_triage 2014-11-06 02:54:03 UTC
Looks like dtrace(1) is truncating somewhere. It's missing 

_ZN2js23NewObjectWithGivenProtoEPNS_16ExclusiveContextEPKNS_5ClassENS_11TaggedProtoEP8JSObjectNS_2gc9AllocKindENS_13NewObjectKi

which isn't defined anywhere. But we do have

_ZN2js23NewObjectWithGivenProtoEPNS_16ExclusiveContextEPKNS_5ClassENS_11TaggedProtoEP8JSObjectNS_2gc9AllocKindENS_13NewObjectKindE

defined in one of the other object files.
Comment 6 Mark Johnston freebsd_committer freebsd_triage 2014-11-06 19:41:02 UTC
Created attachment 149133 [details]
proposed fix

This is happening because DTrace enforces a 128-byte limit on the function component of a probe name. This happens when it builds the DOF for the program object files, so it writes a truncated symbol name into the generated object file, causing the link error. Sigh.

The attached patch fixes the build error by not truncating the function name when the DOF is written. DTrace still won't work, since the kernel will reject the DOF for having excessively long (> 128 bytes) function names. I'll look into fixing that, but it's a separate issue.

Anyway, this problem existed before base r271413; those fixes just exposed further breakage.
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-11-17 22:23:15 UTC
A commit references this bug:

Author: markj
Date: Mon Nov 17 22:22:18 UTC 2014
New revision: 274637
URL: https://svnweb.freebsd.org/changeset/base/274637

Log:
  DTrace imposes a 128-byte limit on the length of the function component of
  a probe name. When dtrace -G builds up a DOF section for the specified
  provider(s), the probe function names are truncated to fit in this limit.
  The DOF is later used to build the symbol table for the generated object
  file, so the table can end up with truncated references, causing link
  errors.

  Instead of potentially truncating symbol table entries, write the full
  function name to the DOF string table and allow the kernel to enforce the
  128-byte function name limit when a process attempts to load its DOF.

  PR:		194757
  Differential Revision:	https://reviews.freebsd.org/D1175
  Reviewed by:	rpaulo
  MFC after:	2 weeks

Changes:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h
Comment 8 Mark Johnston freebsd_committer freebsd_triage 2014-11-26 19:48:56 UTC
The build issues with DTrace enabled have been fixed in HEAD.