vpupkin / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Debugger doesn't work with Node.JS 0.6.2 #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
SDK/Debugger version: 0.3.0
Eclipse version: (for Linux, other platforms not tested)
Google Chrome/V8 Embedder + version: Node.JS 0.6.2

What steps will reproduce the problem?
1. <unspecified work with Node.JS>
2. Connect to Node.JS from Debugger (as V8 Standalone)

What is the expected result?
All scripts appears under VirtualProject

What happens instead?
!ENTRY org.eclipse.core.jobs 4 2 2011-11-22 16:59:24.166
!MESSAGE An internal error occurred during: "Debug session
initialization: NodeJS".
!STACK 0
java.lang.RuntimeException: Exception occured in callback
       at
org.chromium.sdk.CallbackSemaphore.tryAcquire(CallbackSemaphore.java:
68)
       at
org.chromium.sdk.CallbackSemaphore.tryAcquireDefault(CallbackSemaphore.java:
33)
       at
org.chromium.sdk.internal.v8native.JavascriptVmImpl.getScripts(JavascriptVmImpl.
java:
40)
       at
org.chromium.debug.core.model.VProjectWorkspaceBridge.reloadScriptsAtStart(VProj
ectWorkspaceBridge.java:
127)
       at
org.chromium.debug.core.model.LaunchInitializationProcedure.execute(LaunchInitia
lizationProcedure.java:
81)
       at org.chromium.debug.core.model.LaunchInitializationProcedure.access
$0(LaunchInitializationProcedure.java:65)
       at org.chromium.debug.core.model.LaunchInitializationProcedure
$2.run(LaunchInitializationProcedure.java:39)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.Exception: Exception saved from callback
       at
org.chromium.sdk.CallbackSemaphore.callbackDone(CallbackSemaphore.java:
80)
       at org.chromium.sdk.internal.v8native.V8CommandProcessor
$2.run(V8CommandProcessor.java:96)
       at org.chromium.sdk.internal.transport.SocketConnection
$4.report(SocketConnection.java:318)
       at org.chromium.sdk.internal.transport.SocketConnection
$ResponseDispatcherThread.run(SocketConnection.java:209)
Caused by: java.lang.IllegalArgumentException: Cannot add files to the
root
       at org.chromium.debug.core.efs.ChromiumScriptStorage
$RootNode.add(ChromiumScriptStorage.java:82)
       at org.chromium.debug.core.efs.ChromiumScriptStorage
$CommonNode.<init>(ChromiumScriptStorage.java:57)
       at org.chromium.debug.core.efs.ChromiumScriptStorage
$FileNode.<init>(ChromiumScriptStorage.java:119)
       at
org.chromium.debug.core.efs.ChromiumScriptStorage.createFile(ChromiumScriptStora
ge.java:
317)
       at
org.chromium.debug.core.efs.ChromiumScriptStorage.openOutputStream(ChromiumScrip
tStorage.java:
191)
       at
org.chromium.debug.core.efs.ChromiumScriptFileStore.openOutputStream(ChromiumScr
iptFileStore.java:
82)
       at
org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemR
esourceManager.java:
1101)
       at
org.eclipse.core.internal.resources.File.internalSetContents(File.java:
321)
       at org.eclipse.core.internal.resources.File.create(File.java:154)
       at org.eclipse.core.internal.resources.File.create(File.java:187)
       at org.chromium.debug.core.util.ChromiumDebugPluginUtil
$5.tryCreate(ChromiumDebugPluginUtil.java:261)
       at org.chromium.debug.core.util.ChromiumDebugPluginUtil
$5.tryCreate(ChromiumDebugPluginUtil.java:1)
       at
org.chromium.debug.core.util.UniqueKeyGenerator.createUniqueKey(UniqueKeyGenerat
or.java:
22)
       at
org.chromium.debug.core.util.ChromiumDebugPluginUtil.createFile(ChromiumDebugPlu
ginUtil.java:
270)
       at
org.chromium.debug.core.util.ChromiumDebugPluginUtil.createFile(ChromiumDebugPlu
ginUtil.java:
232)
       at
org.chromium.debug.core.model.ResourceManager.createAndRegisterResourceFile(Reso
urceManager.java:
122)
       at
org.chromium.debug.core.model.ResourceManager.addScript(ResourceManager.java:
82)
       at org.chromium.debug.core.model.VProjectWorkspaceBridge
$3.success(VProjectWorkspaceBridge.java:137)
       at org.chromium.sdk.internal.v8native.DebugSession$ScriptManagerProxy
$2.run(DebugSession.java:217)
       at org.chromium.sdk.internal.v8native.V8CommandProcessor
$2.run(V8CommandProcessor.java:90)
       ... 2 more

Investigation:
script name "binding:script" crashes ResourceManager in Debugger because ":" 
symbol is incorrectly processed by a file system.

Original issue reported on code.google.com by peter.ry...@gmail.com on 23 Nov 2011 at 4:24

GoogleCodeExporter commented 9 years ago
I was able to reproduce the bug on Windows with several versions of Node.js. 
Cause seems to be in ChromiumDebugPluginUtil.java, where the following regular 
expression is used to sanitize a file name:

private static final Pattern FILE_NAME_BAD_CHARS = Pattern.compile("[?<>/]");

Suggested fix:

Change the regular expression to [^A-Za-z0-9]

This would replace all characters that are not alphanumerical.

Original comment by zirg...@gmail.com on 25 Nov 2011 at 2:00

GoogleCodeExporter commented 9 years ago
Zirgion, thank you for your help.

You are right about diagnose. However RegExp probably should allow full 
alpha-number category to support non-english names, but that are details.

We are planning on releasing 0.3.2 with the patch soon.

Would you like also to try the quick 7k patch file "issue_53_patch.jar" that I 
published in the mail group (see instructions)?
http://groups.google.com/group/chromedevtools-dev/browse_thread/thread/9e33db90e
fdbdc92

So that we have some report about whether it works "in the field".

Original comment by peter.ry...@gmail.com on 25 Nov 2011 at 2:55

GoogleCodeExporter commented 9 years ago
fixed in HEAD

Original comment by peter.ry...@gmail.com on 6 Dec 2011 at 7:57

GoogleCodeExporter commented 9 years ago
Hey Peter,
Do you know when this will be released ?
Thanks.

Original comment by lenin.ku...@gmail.com on 7 Dec 2011 at 3:43

GoogleCodeExporter commented 9 years ago
Hey Lenin,

Should be on update site in a week.

Peter

Original comment by peter.ry...@gmail.com on 7 Dec 2011 at 7:34

GoogleCodeExporter commented 9 years ago
Fixed in 0.3.2

Original comment by peter.ry...@gmail.com on 13 Dec 2011 at 12:13