From owner-freebsd-java@FreeBSD.ORG Fri May 16 23:40:58 2008 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C84D106567A for ; Fri, 16 May 2008 23:40:58 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id D39F98FC19 for ; Fri, 16 May 2008 23:40:57 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.13.1/8.13.3) with ESMTP id m4GNevgq044040 for ; Fri, 16 May 2008 16:40:57 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.13.1/8.13.3/Submit) id m4GNeuZa044039 for freebsd-java@freebsd.org; Fri, 16 May 2008 16:40:56 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Fri, 16 May 2008 16:40:56 -0700 From: Greg Lewis To: freebsd-java@freebsd.org Message-ID: <20080516234056.GB43930@misty.eyesbeyond.com> References: <20080516121927.GA13485@office.redwerk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080516121927.GA13485@office.redwerk.com> User-Agent: Mutt/1.4.2.2i Subject: Re: NetBeans 6.1 Profiler, Sun JDK 1.5/1.6 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2008 23:40:58 -0000 On Fri, May 16, 2008 at 03:19:27PM +0300, Eugeny N Dzhurinsky wrote: > Hello everytbody! > > I recently installed NetBeans 6.1 from ports and noticed there is no > libprofilerinterface.so library for FreeBSD, and NetBeans complains the profiling > wouldn't work. I've downloaded the sources of NetBeans and was able to build the > libprofilerinterface.so from sources, once I placed it into the appropriate directory > NetBeans expects it to appear in - NetBeans stops reporting the error, however profiling > still doesn't work for some another reason - it just hands on the "calibration" stage. > > I had built the module with -ggdb option, and found there is java.core file and > GDB shows this stack trace: > > > ============================================================================= > (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=0x287b6ae0) at > ../src-jdk15/common_functions.c:122 So, in the code you included below, which is line 122? > #5 0x2880911c in Agent_OnLoad (jvm=0x287b6ae0, options=0x0, reserved=0x0) > 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 > ============================================================================= > > the function initializeJVMTI dumped below: > > ============================================================================= > 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 = (*_jvmti)->GetCapabilities(_jvmti, &capas); > assert(err == JVMTI_ERROR_NONE); > capas.can_redefine_classes = 1; > #ifdef JNI_VERSION_1_6 > capas.can_retransform_classes = 1; > #endif > capas.can_generate_garbage_collection_events = 1; > capas.can_generate_native_method_bind_events = 1; > capas.can_generate_monitor_events = 1; > capas.can_get_current_thread_cpu_time = 1; > capas.can_generate_vm_object_alloc_events = 1; > err = (*_jvmti)->AddCapabilities(_jvmti, &capas); > if (err != JVMTI_ERROR_NONE) { > fprintf(stderr, "Profiler Agent Error: Failed to obtain JVMTI capabilities, error code: %d\n", err); > } > > /* Zero out the callbacks data structure for future use*/ > _jvmti_callbacks = &_jvmti_callbacks_static; > memset(_jvmti_callbacks, 0, sizeof(jvmtiEventCallbacks)); > > /* Enable class load hook event, that captures class file bytes for classes loaded by non-system loaders */ > _jvmti_callbacks->ClassFileLoadHook = class_file_load_hook; > _jvmti_callbacks->NativeMethodBind = native_method_bind_hook; > _jvmti_callbacks->MonitorContendedEnter = monitor_contended_enter_hook; > _jvmti_callbacks->MonitorContendedEntered = monitor_contended_entered_hook; > _jvmti_callbacks->VMObjectAlloc = vm_object_alloc; > res = (*_jvmti)->SetEventCallbacks(_jvmti, _jvmti_callbacks, sizeof(*_jvmti_callbacks)); > assert (res == JVMTI_ERROR_NONE); > > res = (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL); > assert(res == JVMTI_ERROR_NONE); > > res = (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI_EVENT_NATIVE_METHOD_BIND, NULL); > > /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! line 122 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ > assert(res == JVMTI_ERROR_NONE); > > res = (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL); > assert(res == JVMTI_ERROR_NONE); > > res = (*_jvmti)->SetEventNotificationMode(_jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL); > assert(res == JVMTI_ERROR_NONE); > } > ============================================================================= > > Does it makes sense for anybody? Is it possible to fix this somehow? > > Thank you in advance! > > -- > Eugene N Dzhurinsky -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org