This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252745 - Distributed deadlock in profiler engine
Summary: Distributed deadlock in profiler engine
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2015-06-02 11:35 UTC by Tomas Hurka
Modified: 2015-06-03 02:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiled NetBeans IDE (33.61 KB, text/plain)
2015-06-02 11:35 UTC, Tomas Hurka
Details
Profiling NetBeans IDE (24.69 KB, text/plain)
2015-06-02 11:35 UTC, Tomas Hurka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2015-06-02 11:35:09 UTC
Created attachment 154010 [details]
Profiled NetBeans IDE

Steps:
External attach to another NetBeans instance,
all allocations of java.lang.String,
expanded Java2Demo sources in Projects window and tried to open a source file.

See attached thread dumps from profiled and profiling NetBeans.
Comment 1 Tomas Hurka 2015-06-02 11:35:58 UTC
Created attachment 154012 [details]
Profiling NetBeans IDE
Comment 2 Tomas Hurka 2015-06-02 11:36:41 UTC
This is not always reproducible.
Comment 3 Tomas Hurka 2015-06-02 11:59:38 UTC
"Thread-8" (handleServerCommand thread) tries to obtain ProfilingSessionStatus transaction. ProfilingSessionStatus transaction is held by "pool-2-thread-1" in MemoryResultsSnapshot.<init>. "pool-2-thread-1" waits for AllocatedObjectsCountResults, but this response from TA cannot be processed, since  "Thread-8" (handleServerCommand thread) is blocked.
Comment 4 Tomas Hurka 2015-06-02 12:09:33 UTC
Fixed in profiler-main

changeset:   287904:28c30eb9ba0e
user:        Tomas Hurka <thurka@netbeans.org>
date:        Tue Jun 02 13:52:55 2015 +0200
summary:     bugfix #252745, use instrumentation filter as early as possible; use correct class name for array classes

The above fix significantly lowers the chance that this deadlock happened again. The proper fix should be probably done in MemoryResultsSnapshot to avoid calling ProfilerClient.getAllocatedObjectsCountResults() under ProfilingSessionStatus transaction.
Comment 5 Quality Engineering 2015-06-03 02:27:08 UTC
Integrated into 'main-silver', will be available in build *201506030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/28c30eb9ba0e
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #252745, use instrumentation filter as early as possible; use correct class name for array classes