Project

General

Profile

Actions

Backport #8606

closed

compile with --enable-dtrace fails with dtrace version SUN D 1.11

Added by sax (Eric Saxby) over 10 years ago. Updated over 10 years ago.


Description

When compiling Ruby 2.0 with --enable-dtrace on platforms with dtrace version SUN D 1.11 (for example, SmartOS with platform image joyent_20130521T084103Z or greater), the compile fails just after linking miniruby. The compile fails on linking dtrace symbols, as they are missing.

The problem is that in dtrace 1.11, the compiler was changed to fail if no probes are found. configure runs a test to check whether dtrace -G is needed, I believe because OS X does not need it.

https://github.com/ruby/ruby/blob/1c0abbf07692b21835f6c81f759b8d2d6b8963c2/configure.in#L536-L539

On newer dtrace, this results in the following error:
"dtrace: failed to link script conftest_provider: No probe sites found for declared provider"

So configure incorrectly determines that dtrace -G is not needed, and compilation fails.

From the #smartos irc channel on freenode:
rmustacc: So, the most correct solution would be to use the probe from the header file in the conftest.o that they try and run dtrace -G on.

Updated by sax (Eric Saxby) over 10 years ago

This is High priority for me, as it is blocking me from deploying Ruby 2.0 in the Joyent Public Cloud. I understand if others feel it is lower priority.

Thank you for your consideration! I will try to try to find a solution myself and submit a pull request, but I do not have much experience in this regard.

Updated by sax (Eric Saxby) over 10 years ago

linking miniruby
Undefined first referenced
symbol in file
__dtraceenabled_ruby___require__entry load.o
__dtrace_ruby___cmethod__entry vm.o
__dtrace_ruby___parse__begin parse.o
__dtraceenabled_ruby___cmethod__entry vm.o
__dtrace_ruby___require__entry load.o
__dtrace_ruby___find__require__entry load.o
__dtrace_ruby___method__return vm.o
__dtraceenabled_ruby___find__require__entry load.o
__dtrace_ruby___hash__create hash.o
__dtraceenabled_ruby___load__return load.o
__dtraceenabled_ruby___require__return load.o
__dtrace_ruby___object__create object.o
__dtrace_ruby___method__entry vm.o
__dtraceenabled_ruby___parse__begin parse.o
__dtraceenabled_ruby___object__create object.o
__dtraceenabled_ruby___gc__mark__end gc.o
__dtrace_ruby___gc__mark__begin gc.o
__dtraceenabled_ruby___hash__create hash.o
__dtrace_ruby___string__create string.o
__dtraceenabled_ruby___find__require__return load.o
__dtraceenabled_ruby___cmethod__return vm.o
__dtrace_ruby___gc__mark__end gc.o
__dtraceenabled_ruby___parse__end parse.o
__dtraceenabled_ruby___method__entry vm.o
__dtrace_ruby___gc__sweep__begin gc.o
__dtraceenabled_ruby___string__create string.o
__dtrace_ruby___raise eval.o
__dtrace_ruby___require__return load.o
__dtraceenabled_ruby___load__entry load.o
__dtrace_ruby___parse__end parse.o
__dtraceenabled_ruby___array__create array.o
__dtraceenabled_ruby___gc__sweep__end gc.o
__dtraceenabled_ruby___gc__sweep__begin gc.o
__dtrace_ruby___gc__sweep__end gc.o
__dtraceenabled_ruby___method__return vm.o
__dtraceenabled_ruby___raise eval.o
__dtrace_ruby___cmethod__return vm.o
__dtraceenabled_ruby___gc__mark__begin gc.o
__dtrace_ruby___load__return load.o
__dtrace_ruby___array__create array.o
__dtrace_ruby___find__require__return load.o
__dtrace_ruby___load__entry load.o

Updated by sax (Eric Saxby) over 10 years ago

The following code does not error on newer dtrace:

echo "provider conftest{ probe fire(); };" > conftest_provider.d
dtrace -h -o conftest_provider.h -s conftest_provider.d

cat >conftest.c <<_ACEOF
#include "conftest_provider.h"
int main(void){
CONFTEST_FIRE();
return 0;
}
_ACEOF

gcc -c -o conftest.o conftest.c
dtrace -G -s conftest_provider.d conftest.o

Updated by sax (Eric Saxby) over 10 years ago

Please find a pull request here:
https://github.com/ruby/ruby/pull/351

I apologize about setting the priority to High. I just saw in the documentation for filing reports to please leave priority unassigned. In the future I will do so!

Actions #5

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41815.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


configure.in: correctly tests dtrace -G in version 1.11

  • configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11
    introduces a check in the dtrace compiler to ensure that probes
    actually exist. If there are no probes, then the -G step will
    fail. As this test is only being used to determine whether -G is
    necessary (for instance, on OSX it is not), adding a real probe to
    the conftest allows it to succeed on newer versions of dtrace.
    Patch by Eric Saxby at
    [ruby-core:55826]. [Fix GH-351], [Bug #8606].
Actions #6

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Category deleted (build)
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Actions #7

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r41943.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41815,41816: [Backport #8606]

* configure.in (RUBY_DTRACE_POSTPROCESS): dtrace version SUN D 1.11
  introduces a check in the dtrace compiler to ensure that probes
  actually exist. If there are no probes, then the -G step will
  fail. As this test is only being used to determine whether -G is
  necessary (for instance, on OSX it is not), adding a real probe to
  the conftest allows it to succeed on newer versions of dtrace.
  Patch by Eric Saxby <sax AT livinginthepast.org> at
  [ruby-core:55826].  [Fix GH-351], [Bug #8606].
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0