agent_sdk_samples icon indicating copy to clipboard operation
agent_sdk_samples copied to clipboard

Compile time error

Open maximecarey opened this issue 11 years ago • 7 comments

I'm trying to build on Ubuntu 13.10 the HHVM plugin and I get this error :

Scanning dependencies of target newrelic
[100%] Building CXX object CMakeFiles/newrelic.dir/newrelic.cpp.o
/home/max/agent_sdk_samples/hhvm/extension/newrelic.cpp: In function ‘int HPHP::f_hhvm_newrelic_transaction_set_threshold(int)’:
/home/max/agent_sdk_samples/hhvm/extension/newrelic.cpp:118:73: error: ‘newrelic_transaction_set_threshold’ was not declared in this scope
  return newrelic_transaction_set_threshold(NEWRELIC_AUTOSCOPE, threshold);
                                                                         ^

Using latest HHVM sources and GCC 4.8.1. Any clues?

maximecarey avatar Apr 18 '14 16:04 maximecarey

Thanks for bringing this to our attention. We removed newrelic_transaction_set_threshold from the API and needed to update the extension. It should work now.

sssoleileraaa avatar Apr 18 '14 17:04 sssoleileraaa

Great! However, using test.sh, the extension is loaded but functions aren't exposed?

newrelic loaded: 1
hhvm_newrelic_enable_instrumentation exists: 
hhvm_newrelic_disable_instrumentation exists: 
hhvm_newrelic_transaction_begin exists: 
hhvm_newrelic_transaction_notice_error exists: 
hhvm_newrelic_transaction_add_attribute exists: 
hhvm_newrelic_transaction_set_name exists: 
hhvm_newrelic_transaction_set_request_url exists: 
hhvm_newrelic_transaction_set_max_trace_segments exists: 
hhvm_newrelic_transaction_end exists: 
hhvm_newrelic_segment_generic_begin exists: 
hhvm_newrelic_segment_datastore_begin exists: 
hhvm_newrelic_segment_end exists: 
hhvm_newrelic_get_scoped_generic_segment: 
hhvm_newrelic_get_scoped_database_segment: 
hhvm_newrelic_get_scoped_transaction: 

Fatal error: Call to undefined function hhvm_newrelic_disable_instrumentation()

maximecarey avatar Apr 18 '14 20:04 maximecarey

You might want to try running hphpize and make again. Also, just in case, run ldd on newrelic.so to make sure it's pointing to the latest libnewrelic-transaction.so, libnewrelic-collector-client.so, and libnewrelic-common.so.

On Fri, Apr 18, 2014 at 1:03 PM, werfu [email protected] wrote:

Great! However, using test.sh, the extension is loaded but functions aren't exposed?

newrelic loaded: 1 hhvm_newrelic_enable_instrumentation exists: hhvm_newrelic_disable_instrumentation exists: hhvm_newrelic_transaction_begin exists: hhvm_newrelic_transaction_notice_error exists: hhvm_newrelic_transaction_add_attribute exists: hhvm_newrelic_transaction_set_name exists: hhvm_newrelic_transaction_set_request_url exists: hhvm_newrelic_transaction_set_max_trace_segments exists: hhvm_newrelic_transaction_end exists: hhvm_newrelic_segment_generic_begin exists: hhvm_newrelic_segment_datastore_begin exists: hhvm_newrelic_segment_end exists: hhvm_newrelic_get_scoped_generic_segment: hhvm_newrelic_get_scoped_database_segment: hhvm_newrelic_get_scoped_transaction:

Fatal error: Call to undefined function hhvm_newrelic_disable_instrumentation()

Reply to this email directly or view it on GitHubhttps://github.com/newrelic/agent_sdk_samples/issues/4#issuecomment-40839680 .

sssoleileraaa avatar Apr 18 '14 20:04 sssoleileraaa

Tried many time to clean, hphpize and rebuild. Everytime still got the same results. I did rebuild HHVM this morning too with a clean repo. Against what version of HHVM are you building?

The ldd output looks clean too :

max@max-ThinkPad-Edge-E531:~/agent_sdk_samples/hhvm/extension$ ldd newrelic.so 
    linux-vdso.so.1 =>  (0x00007f4216f1a000)
    libnewrelic-transaction.so => /usr/local/lib/libnewrelic-transaction.so (0x00007f4216aa8000)
    libnewrelic-collector-client.so => /usr/local/lib/libnewrelic-collector-client.so (0x00007f4216826000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42164fa000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42162e4000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4215f1c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f4216f1c000)
    libnewrelic-common.so => /usr/local/lib/libnewrelic-common.so (0x00007f4215c1a000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42159fd000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f42157f5000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f42155db000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42152d7000)
    libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f4215073000)
    libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f4214e3f000)
    librtmp.so.0 => /usr/lib/x86_64-linux-gnu/librtmp.so.0 (0x00007f4214c25000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f42149c6000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f42145ea000)
    libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f42143ac000)
    liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f421419c000)
    libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f4213f4b000)
    libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f4213c8d000)
    libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f4213a0e000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f421380a000)
    libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f421353b000)
    libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f4213312000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f421310e000)
    libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f4212f06000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4212ceb000)
    libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f4212ad0000)
    libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f4212892000)
    libtasn1.so.3 => /usr/lib/x86_64-linux-gnu/libtasn1.so.3 (0x00007f4212680000)
    libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f4212460000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f421225b000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f4212056000)
    libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f4211e4f000)
    libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f4211bcb000)
    libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f4211931000)
    libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f42116fd000)
    libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f42114e7000)
    libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f42112be000)
    libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f42110af000)
    libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f4210e67000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f4210bb4000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f421097a000)

maximecarey avatar Apr 18 '14 21:04 maximecarey

We tried this with HipHop VM 2.5.0-dev (rel) and 2.4.0-dev. I just pushed a change that might make a difference for you. I was using int instead of int64_t for some of our return codes and integer parameters. Your version of hhvm might do some data type checking that mine doesn't, so if you give it a try now, it might work. If not, could you check your hhvm access and error logs?

Thanks,

Allie

On Fri, Apr 18, 2014 at 2:01 PM, werfu [email protected] wrote:

Tried many time to clean, hphpize and rebuild. Everytime still got the same results. I did rebuild HHVM this morning too with a clean repo. Against what version of HHVM are you building?

The ldd output looks clean too : ``` max@max-ThinkPad-Edge-E531:~/agent_sdk_samples/hhvm/extension$ ldd newrelic.so linux-vdso.so.1 => (0x00007f4216f1a000) libnewrelic-transaction.so => /usr/local/lib/libnewrelic-transaction.so (0x00007f4216aa8000) libnewrelic-collector-client.so => /usr/local/lib/libnewrelic-collector-client.so (0x00007f4216826000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42164fa000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42162e4000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4215f1c000) /lib64/ld-linux-x86-64.so.2 (0x00007f4216f1c000) libnewrelic-common.so => /usr/local/lib/libnewrelic-common.so (0x00007f4215c1a000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42159fd000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f42157f5000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f42155db000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42152d7000) libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f4215073000) libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f4214e3f000) librtmp.so.0 => /usr/lib/x86_64-linux-gnu/librtmp.so.0 (0x00007f4214c25000) libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f42149c6000) libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f42145ea000) libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f42143ac000) liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f421419c000) libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f4213f4b000) libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f4213c8d000) libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f4213a0e000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f421380a000) libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f421353b000) libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f4213312000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f421310e000) libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f4212f06000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4212ceb000) libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f4212ad0000) libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f4212892000) libtasn1.so.3 => /usr/lib/x86_64-linux-gnu/libtasn1.so.3 (0x00007f4212680000) libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f4212460000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f421225b000) libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f4212056000) libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f4211e4f000) libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f4211bcb000) libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f4211931000) libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f42116fd000) libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f42114e7000) libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f42112be000) libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f42110af000) libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f4210e67000) libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f4210bb4000) libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f421097a000)

Reply to this email directly or view it on GitHubhttps://github.com/newrelic/agent_sdk_samples/issues/4#issuecomment-40844108 .

sssoleileraaa avatar Apr 18 '14 21:04 sssoleileraaa

I guess you nailed it! I'm running HHVM 3.1.0-dev. There surely has been change in the module API between the version. I'll try to have a look more extensively at the API to see if I can submit something. In the mean time thanks a lot :+1:

maximecarey avatar Apr 18 '14 21:04 maximecarey

Glad we could help. Let us know if you have any additional questions!

sssoleileraaa avatar Apr 18 '14 21:04 sssoleileraaa