Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2008 15:19:27 +0300
From:      Eugeny N Dzhurinsky <bofh@redwerk.com>
To:        freebsd-java@freebsd.org
Subject:   NetBeans 6.1 Profiler, Sun JDK 1.5/1.6
Message-ID:  <20080516121927.GA13485@office.redwerk.com>

next in thread | raw e-mail | index | archive | help

--45Z9DzgjV8m4Oswq
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello everytbody!

I recently installed NetBeans 6.1 from ports and noticed there is no
libprofilerinterface.so library for FreeBSD, and NetBeans complains the pro=
filing=20
wouldn't work. I've downloaded the sources of NetBeans and was able to buil=
d the=20
libprofilerinterface.so from sources, once I placed it into the appropriate=
 directory=20
NetBeans expects it to appear in - NetBeans stops reporting the error, howe=
ver profiling=20
still doesn't work for some another reason - it just hands on the "calibrat=
ion" stage.

I had built the module with -ggdb option, and found there is java.core file=
 and=20
GDB shows this stack trace:


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
(gdb) bt
#0  0x2817f9fb in kill () from /lib/libc.so.6
#1  0x280a3236 in raise () from /lib/libpthread.so.2
#2  0x2817e6a8 in abort () from /lib/libc.so.6
#3  0x2815a898 in __assert () from /lib/libc.so.6
#4  0x28808fda in initializeJVMTI (jvm=3D0x287b6ae0) at
=2E./src-jdk15/common_functions.c:122
#5  0x2880911c in Agent_OnLoad (jvm=3D0x287b6ae0, options=3D0x0, reserved=
=3D0x0)
    at ../src-jdk15/common_functions.c:147
#6  0x286dfd3d in Threads::create_vm_init_agents ()
       from /usr/local/jdk1.5.0/jre/lib/i386/server/libjvm.so
#7  0x286e2b5f in Threads::create_vm () from
       /usr/local/jdk1.5.0/jre/lib/i386/server/libjvm.so
#8  0x284627a1 in JNI_CreateJavaVM () from
       /usr/local/jdk1.5.0/jre/lib/i386/server/libjvm.so
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D

the function initializeJVMTI dumped below:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
void initializeJVMTI(JavaVM *jvm) {
    jvmtiError err;
    jvmtiCapabilities capas;
    jint res;

    /* Obtain the JVMTI environment to be used by this agent */
#ifdef JNI_VERSION_1_6
    (*jvm)->GetEnv(jvm, (void**)&_jvmti, JVMTI_VERSION_1_1);
#else
    (*jvm)->GetEnv(jvm, (void**)&_jvmti, JVMTI_VERSION_1_0);
#endif

    /* Enable runtime class redefinition capability */
    err =3D (*_jvmti)->GetCapabilities(_jvmti, &capas);
    assert(err =3D=3D JVMTI_ERROR_NONE);
    capas.can_redefine_classes =3D 1;
#ifdef JNI_VERSION_1_6=20
    capas.can_retransform_classes =3D 1;
#endif
    capas.can_generate_garbage_collection_events =3D 1;
    capas.can_generate_native_method_bind_events =3D 1;
    capas.can_generate_monitor_events =3D 1;
    capas.can_get_current_thread_cpu_time =3D 1;
    capas.can_generate_vm_object_alloc_events =3D 1;
    err =3D (*_jvmti)->AddCapabilities(_jvmti, &capas);
    if (err !=3D JVMTI_ERROR_NONE) {
        fprintf(stderr, "Profiler Agent Error: Failed to obtain JVMTI capab=
ilities, error code: %d\n", err);
    }

    /* Zero out the callbacks data structure for future use*/
    _jvmti_callbacks =3D &_jvmti_callbacks_static;
    memset(_jvmti_callbacks, 0, sizeof(jvmtiEventCallbacks));

    /* Enable class load hook event, that captures class file bytes for cla=
sses loaded by non-system loaders */
    _jvmti_callbacks->ClassFileLoadHook =3D class_file_load_hook;
    _jvmti_callbacks->NativeMethodBind =3D native_method_bind_hook;
    _jvmti_callbacks->MonitorContendedEnter =3D monitor_contended_enter_hoo=
k;
    _jvmti_callbacks->MonitorContendedEntered =3D monitor_contended_entered=
_hook;
    _jvmti_callbacks->VMObjectAlloc =3D vm_object_alloc;
    res =3D (*_jvmti)->SetEventCallbacks(_jvmti, _jvmti_callbacks, sizeof(*=
_jvmti_callbacks));
    assert (res =3D=3D JVMTI_ERROR_NONE);

    res =3D (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI=
_EVENT_CLASS_FILE_LOAD_HOOK, NULL);
    assert(res =3D=3D JVMTI_ERROR_NONE);

    res =3D (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI=
_EVENT_NATIVE_METHOD_BIND, NULL);
   =20
    /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! line 122  !!!!!!!!!!!!!!!!!!!!=
!!!!!!!!!!!!!!!!!!*/
    assert(res =3D=3D JVMTI_ERROR_NONE);

    res =3D (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI=
_EVENT_MONITOR_CONTENDED_ENTER, NULL);
    assert(res =3D=3D JVMTI_ERROR_NONE);

    res =3D (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI=
_EVENT_MONITOR_CONTENDED_ENTERED, NULL);
    assert(res =3D=3D JVMTI_ERROR_NONE);
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D

Does it makes sense for anybody? Is it possible to fix this somehow?

Thank you in advance!

--=20
Eugene N Dzhurinsky

--45Z9DzgjV8m4Oswq
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkgte84ACgkQy/i/DoZLbHwhdwCeOi6G+Wu8Tgc57leIlnpuypf+
cNkAni1kMMhjJRZz88xo2aTn+IBKaMS+
=iEWy
-----END PGP SIGNATURE-----

--45Z9DzgjV8m4Oswq--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080516121927.GA13485>