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 137375 - URL breakpoints do not work and may cause the IDE to hang
Summary: URL breakpoints do not work and may cause the IDE to hang
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ deva
URL: http://statistics.netbeans.org/except...
Keywords:
: 138029 139189 142719 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-17 01:06 UTC by _ krystyna
Modified: 2008-08-15 00:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 66126


Attachments
stacktrace (5.92 KB, text/plain)
2008-06-17 01:06 UTC, _ krystyna
Details
thread dump (6.00 KB, text/plain)
2008-07-30 02:33 UTC, _ krystyna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ krystyna 2008-06-17 01:06:03 UTC
Build: NetBeans IDE Dev (Build 200806161203)
VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b21
OS: Windows XP, 5.1, x86

User Comments: 
-second debug URL attempt with the following query:

http://www.google.com/search?q=hello+there&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a


In the first debug URL, openeed the source and set a breakpoint.
Then received this NPE
Comment 1 _ krystyna 2008-06-17 01:06:12 UTC
Created attachment 62898 [details]
stacktrace
Comment 2 _ krystyna 2008-06-18 22:17:30 UTC
Upgrading this to P2 as feature to set a breakpoint on a remote file is prevented; and subsequent launch of debug 
session for plain web project,  DebugURL to same or new URL will fail. Restart of IDE does not help for existing
and/or new projects. New debug launches result in build failure due to the same NPE.
NetBeans IDE Dev (Build 200806181204)
Comment 3 Quy Nguyen 2008-06-19 01:39:17 UTC
It looks like this exception occurs because the breakpoint annotations are being added before the debugger is launched,
so NbJSDebugger.getInputStreamForURL() returns null.
Comment 4 Quy Nguyen 2008-06-20 00:59:35 UTC
It turns out that there are many problems with URL breakpoints, so this will not be fixed for M1.  The known issues are:

1) A dataloaders performance fix causes the MIME type for each FileObject to be computed when DataObject.find() is
called on it.  The calculation of the MIME type opens the FileObject's InputStream, which eventually retrieves the data
from the browser.  The URLFileObject class needs to be changed to not use this behavior, since retrieval of files from
the browser cache is unreliable during debugger startup or URL loading.

2) The breakpoint annotations and line updaters are initialized before the debugger launches the browser, so cache
information is not available to get the LineCookie instances.  These initializations need to be deferred until the
debugger is in the 'Running' state.  This causes problems with the display of URLs, which will sometimes display a blank
page.  This happens because the editor caches the result of FileObject.getInputStream().

3) The browser extension sometimes stops responding or crashes the Firefox browser when the "source" command is sent to
it.  It appears that nsIChannel.open() never returns in these cases.


I've fixed the NPE in changeset b4c4f7543b0e, but that exposes the above problems.
Comment 5 Quy Nguyen 2008-06-21 00:48:38 UTC
After some more investigation, the root cause of these problems appears to be the Firefox browser.  While a URL is being
loaded in the browser, the services used to retrieve URLs either return empty data or hang, causing the IDE and the
browser to stop responding.  Switching to asynchronous streaming of data does not appear to help.  Possible workarounds
to this may be to:

a) retrieve all the URLs in the breakpoints window before the URL to be debugged starts to load in the browser

b) suppress/defer attempts to retrieve the URL source while the browser is loading said URL; this might involve
preventing the IDE from showing the editor window for the current breakpoint when that breakpoint is a URIBreakpoint
Comment 6 Joelle Lam 2008-07-29 22:48:38 UTC
Krys, can you retest this to see what the current symptoms are.
Comment 7 Quy Nguyen 2008-07-30 01:14:02 UTC
*** Issue 139189 has been marked as a duplicate of this issue. ***
Comment 8 Quy Nguyen 2008-07-30 01:16:20 UTC
The wait time for the browser response now has a timeout, so the IDE no longer hangs indefinitely.  However, the editor
comes up with a blank page since no source could be retrieved from the browser.
Comment 9 _ krystyna 2008-07-30 02:32:39 UTC
NetBeans IDE Dev (Build 20080729221255)
Still happens with some URL breakpoints. 
Testing with the google url above, the IDE did hang once a breakpoint is set and
subsequent URL debugging. URL breakpoints for cnn.com seems on the other hand seem 
to work fine.

Attaching partial thread dump from the google hang.


Comment 10 _ krystyna 2008-07-30 02:33:43 UTC
Created attachment 66013 [details]
thread dump
Comment 11 Quy Nguyen 2008-08-03 21:47:33 UTC
*** Issue 142719 has been marked as a duplicate of this issue. ***
Comment 12 _ sandipchitale 2008-08-09 17:40:17 UTC
Fixed due to the following changes:

changeset 95471	06e4cede558e - use base64 encoding to transmit sources from FF extension to NetBeans IDE
changeset 95184	20050017c650 - use Firebugs cache to get the source
Comment 13 _ krystyna 2008-08-11 19:34:24 UTC
Verified fixed with NetBeans IDE Dev (Build 20080811162939)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Windows XP version 5.1
Comment 14 Quy Nguyen 2008-08-15 00:02:48 UTC
*** Issue 138029 has been marked as a duplicate of this issue. ***