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 249030 - Unexpected character (C) at position 4767. at org.json.simple.parser.Yylex.yylex
Summary: Unexpected character (C) at position 4767. at org.json.simple.parser.Yylex.yylex
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Node.js Debugger (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 249501 250925 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-01 10:34 UTC by Vladimir Riha
Modified: 2015-03-26 03:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 213815


Attachments
stacktrace (1.04 KB, text/plain)
2014-12-01 10:34 UTC, Vladimir Riha
Details
profiling snapshot (2.89 MB, application/octet-stream)
2015-03-23 08:45 UTC, terje7601
Details
messages.log (55.43 KB, application/octet-stream)
2015-03-23 08:47 UTC, terje7601
Details
simple NetBeans project to reproduce (2.34 KB, application/zip)
2015-03-24 10:36 UTC, terje7601
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-12-01 10:34:27 UTC
Build: NetBeans IDE Dev (Build 201412010001)
VM: Java HotSpot(TM) Client VM, 24.71-b01, Java(TM) SE Runtime Environment, 1.7.0_71-b14
OS: Linux

User Comments:
vriha: Debugging NodeJS application. The setup is a bit complicated and requires private data but I can share it offline




Stacktrace: 
Unexpected character (C) at position 4767.
   at org.json.simple.parser.Yylex.yylex(Yylex.java:610)
   at org.json.simple.parser.JSONParser.nextToken(JSONParser.java:269)
   at org.json.simple.parser.JSONParser.parse(JSONParser.java:118)
   at org.json.simple.parser.JSONParser.parse(JSONParser.java:81)
   at org.netbeans.lib.v8debug.client.ClientConnection.received(ClientConnection.java:308)
   at org.netbeans.lib.v8debug.client.ClientConnection.runEventLoop(ClientConnection.java:147)
Comment 1 Vladimir Riha 2014-12-01 10:34:29 UTC
Created attachment 150808 [details]
stacktrace
Comment 2 Martin Entlicher 2015-01-02 15:24:23 UTC
*** Bug 249501 has been marked as a duplicate of this bug. ***
Comment 3 Martin Entlicher 2015-03-17 13:47:28 UTC
*** Bug 250925 has been marked as a duplicate of this bug. ***
Comment 4 Martin Entlicher 2015-03-18 19:13:12 UTC
Hopefully fixed by changeset:   285053:a895028feee8
http://hg.netbeans.org/web-main/rev/a895028feee8
A stress test written to catch errors in the communication/JSON parsing:
http://hg.netbeans.org/web-main/rev/54ccfc80dd09
Comment 5 Quality Engineering 2015-03-20 03:25:01 UTC
Integrated into 'main-silver', will be available in build *201503200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a895028feee8
User: mentlicher@netbeans.org
Log: #249030: Fix parsing errors caused by bad chunks interpretation.
Comment 6 terje7601 2015-03-20 08:29:43 UTC
I just downloaded the latest dev build from http://bits.netbeans.org/dev/nightly/2015-03-20_00-01-28/ (Java EE, OS Independent Zip). However, I still get this error when trying to debug our NodeJS application. The new exception report is #771446: http://statistics.netbeans.org/analytics/exception.do?id=771446

Will you please have a look at the report? The stack trace is exactly the same, so it seems this issue isn't completely fixed yet.

PS: I noted the version shows "Product Version: NetBeans IDE Dev (Build 1)"
so maybe there's just something wrong with the .zip I downloaded?
Comment 7 Martin Entlicher 2015-03-20 12:34:27 UTC
The stack trace really corresponds to the new code, which was supposed to fix the issue.
Unfortunately, I'm not able to reproduce the bug manually and the automatic test did not reveal any other problem.
I've included the parsed message text into the exception description so that we get at least some hint next time the problem occurs:
http://hg.netbeans.org/web-main/rev/3ae7cfc15b7b

Can you please provide some sample node.js application that can be used to reproduce the bug?
Also, does the bug occur right after the debugger is suspended on the first line or after some more debugging actions? Exact steps are welcomed.
Comment 8 Quality Engineering 2015-03-21 07:56:06 UTC
Integrated into 'main-silver', will be available in build *201503210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3ae7cfc15b7b
User: mentlicher@netbeans.org
Log: Include the parsed message when ParseException is thrown - issue #249030.
Comment 9 terje7601 2015-03-23 08:45:38 UTC
Created attachment 152783 [details]
profiling snapshot

I just reproduced the issue this morning with the latest dev build (netbeans-trunk-nightly-201503230001-javaee.zip).

Here is what I did:
- delete C:\Users\me\AppData\Local\NetBeans\Cache\dev and C:\Users\me\AppData\Roaming\NetBeans\dev to make sure to start with a clean environment
- start netbeans64.exe
- start NetBeans profiling
- open the project
- resolve the project problem by downloading Node.js sources
- wait until Background scanning is finished
- do "Debug" on the project
- wait until everything is done: Chrome is opened & the debugger is halted on the first line of app.js
- at this point, I noticed the memory was increasing up to over 500MB (coming from less than 300MB), only to drop back to less than 300MB (after garbage collection, I'd guess) & start increasing again (most likely, this has nothing to do with this issue, but I found it weird. Is this expected behavior?)
- do "Continue" & wait a bit
- in Google Chrome, hit Ctrl + F5. As soon as I hit it, the error occurs.
- send the exception report ( http://statistics.netbeans.org/analytics/exception.do?id=771759 )
- stop NetBeans profiling


Version info:

Google Chrome
Version 41.0.2272.101 m

node --version
v0.12.0

Product Version: NetBeans IDE Dev (Build 1)
Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 10 terje7601 2015-03-23 08:47:02 UTC
Created attachment 152784 [details]
messages.log

the messages.log that goes with the attached profiling snapshot
Comment 11 terje7601 2015-03-24 10:36:57 UTC
Created attachment 152808 [details]
simple NetBeans project to reproduce

The .zip contains a NetBeans project. It's a Node.js application & only contains 2 files: main.js & package.json

The issue is (most likely) due to some character encoding issue. The contents of main.js is simply:

function abc(de) {}
abc('è');
Comment 12 Martin Entlicher 2015-03-24 14:50:30 UTC
Thanks for the testcase! Yes, the bug is caused by 'è'. JSONParser is not able to handle it.
Comment 13 Martin Entlicher 2015-03-25 07:22:48 UTC
The unicode characters are handled correctly by changeset:   285403:ce61ae79eff1
http://hg.netbeans.org/web-main/rev/ce61ae79eff1

It's possible to debug the sample project now and a test checking all characters in the unicode range was written.

Thanks for your cooperation.
Comment 14 Martin Entlicher 2015-03-25 07:39:34 UTC
The slowness in the attached profiling snapshot is most likely caused by parsing. And parsing seems to be slow due to a slow file access. It spends 50 seconds in FileInputStream.open(). Please check if your computer does not run out of memory and makes the disk busy with memory swapping. If the problem persists, please file a separate issue.
Comment 15 Quality Engineering 2015-03-26 03:23:41 UTC
Integrated into 'main-silver', will be available in build *201503260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ce61ae79eff1
User: mentlicher@netbeans.org
Log: #249030: Assure that unicode characters are handled correctly.