[ 
https://issues.apache.org/jira/browse/NETBEANS-3900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17040524#comment-17040524
 ] 

David Costanzo commented on NETBEANS-3900:
------------------------------------------

{quote}I appreciate you can't share your web app source over the internet but 
would you be OK with replacing the native component of the NetBeans profiler 
(libprofilerinterface.so) with a custom version that had more checks or more 
logging? Obviously I would give you the source code so you can audit or rebuild 
yourself.
{quote}
I can share the source code of my web apps, but they're complicated and can't 
be run except on a few machines within my LAN.  I don't expect they'd be 
enlightening.

I would be happy to replace my libprofilerinterface.so.  That seems like the 
easiest way forward.  My dev machine at work is locked down and doesn't have 
any native build tools, so it'll be easier if you provide me with the compiled 
binary.

The Play framework does a lot of weird stuff in Java.  It's got an embedded 
compiler so that it can re-compile the app if any source code changes.  (I 
disable the recompiling when profiling.)  It's got some kind of byte code 
rewriting library to be able to "enhance" classes at runtime.  It's got 
continuations where execution pauses and resumes with a different stack on the 
same thread.  I don't know if any of that matters, but it might not be the 
normal byte code or control flow that javac produces.  Even so, I used to be 
able to profile these apps with NetBeans and now I can't.  The machine I used 
to use has been wiped, so I can't use it as a reference.

> Using netbeans to profile a Play1 app crashes the app after a while
> -------------------------------------------------------------------
>
>                 Key: NETBEANS-3900
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-3900
>             Project: NetBeans
>          Issue Type: Bug
>          Components: profiler - Base
>    Affects Versions: 11.0, 11.2
>         Environment: JDK: OpenJDK 11 or HotSpot Java 8.
> OS: 64-bit Ubuntu or OpenSUSE
>            Reporter: David Costanzo
>            Priority: Major
>         Attachments: hs_err_pid24234.log, hs_err_pid24980.log
>
>
> When I use NetBeans 11.2 to profile a stand alone web application that is 
> based on the Play 1 framework, the profiling works for a little while, then 
> the JVM that's being profiled crashes.
> I cannot reproduce a crash when using a java command-line tool, only my web 
> apps crash.
> I am able to profile using visualvm.
> If I use Java 8 for both the target app's JVM and netbean's JVM, I can still 
> reproduce the crash.  (Mixing a Java 8 app with a Java 11 netbeans makes it 
> so that the profiler cannot attach).
> If I drop down to NetBeans 9, I can still reproduce the crash.  (NetBeans 8.2 
> cannot attach a profiler).
> Unfortunately, I have been unsuccessful at creating a small, isolated repro.  
> All of our applications rely heavily our corporate file system, our corporate 
> databases, and ancillary services that are only available on our LAN.  When I 
> try to remove these dependencies, I also lose the repro.
> Also unfortunate is that I don't understand how a Java profiler is 
> implemented, so I don't know how to investigate this.  I also don't know how 
> to build a profiler with symbols, which I assume would help.
> A possibly relevant bit for one log is (included for searchability): 
> {noformat}
> ---------------  T H R E A D  ---------------
> Current thread (0x00007fae40021000):  JavaThread "*** Profiler Agent 
> Communication Thread" daemon [_thread_in_vm, id=5892, 
> stack(0x00007fad2b68b000,0x00007fad2b78c000)]
> Stack: [0x00007fad2b68b000,0x00007fad2b78c000],  sp=0x00007fad2b78a560,  free 
> space=1021k
> Native frames: (J=compiled Java code, A=aot compiled Java code, 
> j=interpreted, Vv=VM code, C=native code)
> V  [libjvm.so+0xb8a836]  Method::checked_resolve_jmethod_id(_jmethodID*)+0x26
> V  [libjvm.so+0x9ac918]  jvmti_GetMethodDeclaringClass+0x1d8
> Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
> j  
> org.netbeans.lib.profiler.server.system.Stacks.getMethodNamesForJMethodIds(I[I[I)[B+0
> j  
> org.netbeans.lib.profiler.server.ProfilerInterface.getMethodNamesForJMethodIds([I)Lorg/netbeans/lib/profiler/wireprotocol/MethodNamesResponse;+20
> j  
> org.netbeans.lib.profiler.server.ProfilerServer.handleClientCommand(Lorg/netbeans/lib/profiler/wireprotocol/Command;)V+691
> j  org.netbeans.lib.profiler.server.ProfilerServer.listenToClient()V+48
> j  org.netbeans.lib.profiler.server.ProfilerServer.run()V+22
> v  ~StubRoutines::call_stub
> siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 
> 0x0000000200000010
> Register to memory mapping:
> RAX=0x0000000200000000 is an unknown value
> RBX=0x00007fae00000020 points into unknown readable memory: 00 00 00 00 02 00 
> 00 00
> RCX=0x00007fad2b8954c0: <offset 0x00000000001094c0> in 
> /local/netbeans_11_2/profiler/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so
>  at 0x00007fad2b78c000
> RDX=0x00007faed95ee300: <offset 0x000000000067c300> in 
> /scharp/xapps/fw/share/jdk-11.0.5_10-hotspot/lib/server/libjvm.so at 
> 0x00007faed8f72000
> RSP=0x00007fad2b78a560 is pointing into the stack for thread: 
> 0x00007fae40021000
> RBP=0x00007fad2b78a570 is pointing into the stack for thread: 
> 0x00007fae40021000
> RSI=0x00007fae40021000 is a thread
> RDI=0x00007fae00000000 points into unknown readable memory: 20 00 00 00 ae 7f 
> 00 00
> R8 =0x0000000000000002 is an unknown value
> R9 =0x00000000000000ad is an unknown value
> R10=0x0000000000000011 is an unknown value
> R11=0x00007faeda5ae4c0: <offset 0x00000000001af4c0> in 
> /lib/x86_64-linux-gnu/libc.so.6 at 0x00007faeda3ff000
> R12=0x00007fae3401cdc0 points into unknown readable memory: 60 49 38 da ae 7f 
> 00 00
> R13=0x00007fad2b78a650 is pointing into the stack for thread: 
> 0x00007fae40021000
> R14=0x00007fae00000000 points into unknown readable memory: 20 00 00 00 ae 7f 
> 00 00
> R15=0x00007fad2b78a5a0 is pointing into the stack for thread: 
> 0x00007fae40021000
> {noformat}
> I have opened this bug at the suggestion of [~peterhull90] on NETBEANS-1428.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to