Project

General

Profile

Backport #8606

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

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

Status:
Closed
Priority:
Normal
[ruby-core:55815]

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.

Associated revisions

Revision 2b5f033c
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 41815
Added by nobu (Nobuyoshi Nakada) over 6 years ago

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

Revision 2114ad42
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision 41816
Added by nobu (Nobuyoshi Nakada) over 6 years ago

configure.in: check exit statuses

  • configure.in (RUBY_DTRACE_POSTPROCESS): check exit statuses of commands. [Bug #8606]

Revision e62660c9
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 41943
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

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

History

Updated by sax (Eric Saxby) over 6 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 6 years ago

linking miniruby
Undefined first referenced
symbol in file
dtraceenabled_rubyrequireentry load.o
__dtrace_ruby
cmethodentry vm.o
dtrace_rubyparsebegin parse.o
__dtraceenabled_ruby
cmethodentry vm.o
dtrace_rubyrequireentry load.o
__dtrace_ruby
findrequire_entry load.o
__dtrace_ruby
methodreturn vm.o
dtraceenabled_rubyfindrequireentry load.o
__dtrace_ruby
hashcreate hash.o
dtraceenabled_rubyloadreturn load.o
__dtraceenabled_ruby
requirereturn load.o
dtrace_rubyobjectcreate object.o
__dtrace_ruby
methodentry vm.o
dtraceenabled_rubyparsebegin parse.o
__dtraceenabled_ruby
objectcreate object.o
dtraceenabled_rubygcmarkend gc.o
__dtrace_ruby
gcmark_begin gc.o
__dtraceenabled_ruby
hashcreate hash.o
dtrace_rubystringcreate string.o
__dtraceenabled_ruby
findrequire_return load.o
__dtraceenabled_ruby
cmethodreturn vm.o
dtrace_rubygcmarkend gc.o
__dtraceenabled_ruby
parseend parse.o
dtraceenabled_rubymethodentry vm.o
__dtrace_ruby
gcsweep_begin gc.o
__dtraceenabled_ruby
stringcreate string.o
dtrace_rubyraise eval.o
__dtrace_ruby
requirereturn load.o
dtraceenabled_rubyloadentry load.o
__dtrace_ruby
parseend parse.o
dtraceenabled_rubyarraycreate array.o
__dtraceenabled_ruby
gcsweep_end gc.o
__dtraceenabled_ruby
gcsweep_begin gc.o
__dtrace_ruby
gcsweep_end gc.o
__dtraceenabled_ruby
methodreturn vm.o
dtraceenabled_rubyraise eval.o
__dtrace_ruby
cmethodreturn vm.o
dtraceenabled_rubygcmarkbegin gc.o
__dtrace_ruby
loadreturn load.o
dtrace_rubyarraycreate array.o
__dtrace_ruby
findrequire_return load.o
__dtrace_ruby
loadentry load.o

Updated by sax (Eric Saxby) over 6 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 6 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!

#5

Updated by nobu (Nobuyoshi Nakada) over 6 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].
#6

Updated by nagachika (Tomoyuki Chikanaga) over 6 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)
#7

Updated by nagachika (Tomoyuki Chikanaga) over 6 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].

Also available in: Atom PDF