Bug 271185 - "Attach Debugger" menu item generates "Failed to parse OutputStream of ps command" warning
"Attach Debugger" menu item generates "Failed to parse OutputStream of ps com...
Status: RESOLVED FIXED
Product: cnd
Classification: Unclassified
Component: Debugger
Dev
PC Linux
: P2 (vote)
: Dev
Assigned To: Maria Tishkova
issues@cnd
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-28 09:17 UTC by soldatov
Modified: 2017-08-03 01:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
IDE log (166.50 KB, text/plain)
2017-07-31 14:56 UTC, soldatov
Details
'/bin/ps -e -o user,pid,ppid,stime,cmd' command (23.46 KB, text/plain)
2017-07-31 14:59 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2017-07-28 09:17:33 UTC
Scenario:
- Launch NetBeans on any Windows
- Push Debug|Attach Debugger menu item
==> "Failed to parse OutputStream of ps command" message appears
Comment 1 soldatov 2017-07-28 09:21:48 UTC
INFO [org.netbeans.modules.cnd.utils.cache.CndFileUtils]: C/C++ File Utils: using case-insensitive file system
SEVERE
org.openide.ErrorManager$AnnException: msg
	at org.openide.ErrorManager$AnnException.findOrCreate0(ErrorManager.java:885)
	at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:865)
	at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
	at org.openide.ErrorManager.annotate(ErrorManager.java:455)
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1035)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
msg
Caused: java.util.NoSuchElementException
	at java.util.LinkedList$ListItr.next(LinkedList.java:890)
	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
[catch] at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1019)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
ALL [null]: Failed to parse OutputStream of ps command
SEVERE: No lines from
Comment 2 soldatov 2017-07-28 14:10:24 UTC
Hm. I see this error on Oracle Linux 7 too.
Comment 3 Maria Tishkova 2017-07-31 12:06:30 UTC
Here are details I've got from the windows:
FINEST [nativeexecution.support.logger]: [22804 ms.] localhost C:\cygwin64\bin\ps.exe -W [0]: State changed: INITIAL -> STARTING
FINEST [nativeexecution.support.logger]: [22806 ms.] Command: [C:\cygwin64\bin\ps.exe -W]
FINEST [nativeexecution.support.logger]: [22812 ms.] localhost C:\cygwin64\bin\ps.exe -W [0]: State changed: STARTING -> ERROR
FINE [nativeexecution.support.logger]: [22812 ms.] Error occurred: Cannot run program "C:\cygwin64\bin\ps.exe -W": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "C:\cygwin64\bin\ps.exe -W": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at org.netbeans.modules.nativeexecution.LocalNativeProcess.createWin(LocalNativeProcess.java:193)
	at org.netbeans.modules.nativeexecution.LocalNativeProcess.create(LocalNativeProcess.java:85)
[catch] at org.netbeans.modules.nativeexecution.AbstractNativeProcess.createAndStart(AbstractNativeProcess.java:154)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:279)
	at org.netbeans.modules.nativeexecution.api.util.ProcessUtils.execute(ProcessUtils.java:568)
	at org.netbeans.modules.nativeexecution.api.util.ProcessUtils.execute(ProcessUtils.java:550)
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1014)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Comment 4 Maria Tishkova 2017-07-31 12:10:12 UTC
(In reply to soldatov from comment #2)
> Hm. I see this error on Oracle Linux 7 too.

Please add  -J-Dnativeexecution.support.logger.level=100 when starting NetBeans and send me the details
Comment 5 soldatov 2017-07-31 12:13:08 UTC
Garbage collector: PS Scavenge (Collections=16 Total time spent=0s)
Garbage collector: PS MarkSweep (Collections=4 Total time spent=0s)
Classes: loaded=8619 total loaded=8619 unloaded 0
INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 16,578,994,176
WARNING [null]: Note - org.netbeans.modules.cnd.debugger.common2.ui.processlist.AttachToProcessTopComponent ought to override getPersistenceType() rather than using the client property or accepting the default.
FINEST [nativeexecution.support.logger]: [6684 ms.] localhost /bin/ps -e  -o user,pid,ppid,stime,cmd [0]: State changed: INITIAL -> STARTING
FINEST [nativeexecution.support.logger]: [6685 ms.] localhost /bin/ps -e  -o user,pid,ppid,stime,cmd [16703]: State changed: STARTING -> RUNNING
FINEST [nativeexecution.support.logger]: [6724 ms.] localhost /bin/ps -e  -o user,pid,ppid,stime,cmd [16703]: State changed: RUNNING -> FINISHING
FINEST [nativeexecution.support.logger]: [6724 ms.] localhost /bin/ps -e  -o user,pid,ppid,stime,cmd [16703]: State changed: FINISHING -> FINISHED
SEVERE: 4
org.openide.ErrorManager$AnnException: msg
	at org.openide.ErrorManager$AnnException.findOrCreate0(ErrorManager.java:885)
	at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:865)
	at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
	at org.openide.ErrorManager.annotate(ErrorManager.java:455)
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1035)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
msg
Caused: java.lang.ArrayIndexOutOfBoundsException: 4
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider$PsData.addProcess(PsProvider.java:240)
[catch] at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1023)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
ALL [null]: Failed to parse OutputStream of ps command
Comment 6 Maria Tishkova 2017-07-31 13:36:50 UTC
please add -J-Dcnd.nativedebugger.Ps.debug=true and please send me the result of terminal execution of /bin/ps -e  -o user,pid,ppid,stime,cmd
Comment 7 soldatov 2017-07-31 14:56:50 UTC
Created attachment 164870 [details]
IDE log
Comment 8 soldatov 2017-07-31 14:59:18 UTC
Created attachment 164871 [details]
'/bin/ps -e  -o user,pid,ppid,stime,cmd' command
Comment 9 Maria Tishkova 2017-07-31 15:21:18 UTC
(In reply to soldatov from comment #8)
> Created attachment 164871 [details]
> '/bin/ps -e  -o user,pid,ppid,stime,cmd' command

Thanks.

Now I can see that there is a process with empty command (it is at the end of the result list)
Will fix.
Can you send me the same info for your Windows machine?
Comment 10 Maria Tishkova 2017-07-31 16:02:47 UTC
fix for linux case is below (unit test is added).
changeset:   304396:008e25a9a230
tag:         tip
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Mon Jul 31 19:00:48 2017 +0300
summary:     fixed first part of bz#271185  - "Attach Debugger" menu item generates "Failed to parse OutputStream of ps command" warning
Comment 11 soldatov 2017-07-31 17:00:00 UTC
In Cygwin I see:
FINEST [nativeexecution.support.logger]: [7115 ms.] localhost D:\cygwin64\bin\ps.exe -W [0]: State changed: INITIAL -> STARTING
FINEST [nativeexecution.support.logger]: [7115 ms.] Command: [D:\cygwin64\bin\ps.exe -W]
FINEST [nativeexecution.support.logger]: [7115 ms.] localhost D:\cygwin64\bin\ps.exe -W [0]: State changed: STARTING -> ERROR
FINE [nativeexecution.support.logger]: [7115 ms.] Возникла ошибка: Cannot run program "D:\cygwin64\bin\ps.exe -W": CreateProcess error=2, Не удается найти указанный файл
java.io.IOException: CreateProcess error=2, Не удается найти указанный файл
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "D:\cygwin64\bin\ps.exe -W": CreateProcess error=2, Не удается найти указанный файл
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at org.netbeans.modules.nativeexecution.LocalNativeProcess.createWin(LocalNativeProcess.java:193)
	at org.netbeans.modules.nativeexecution.LocalNativeProcess.create(LocalNativeProcess.java:85)
[catch] at org.netbeans.modules.nativeexecution.AbstractNativeProcess.createAndStart(AbstractNativeProcess.java:154)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:279)
	at org.netbeans.modules.nativeexecution.api.util.ProcessUtils.execute(ProcessUtils.java:568)
	at org.netbeans.modules.nativeexecution.api.util.ProcessUtils.execute(ProcessUtils.java:550)
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1014)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
SEVERE
org.openide.ErrorManager$AnnException: msg
	at org.openide.ErrorManager$AnnException.findOrCreate0(ErrorManager.java:885)
	at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:865)
	at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
	at org.openide.ErrorManager.annotate(ErrorManager.java:455)
	at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1035)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
msg
Caused: java.util.NoSuchElementException
	at java.util.LinkedList$ListItr.next(LinkedList.java:890)
	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
[catch] at org.netbeans.modules.cnd.debugger.common2.utils.PsProvider.getData(PsProvider.java:1019)
	at org.netbeans.modules.cnd.debugger.common2.utils.ProcessListSupport$Provider$ProcessListUpdater.run(ProcessListSupport.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
ALL [null]: Failed to parse OutputStream of ps command
SEVERE: No lines from 
WARNING [org.netbeans.modules.options.keymap.KeymapModel]: Duplicate action ID used: copy-to-clipboard
WARNING [org.netbeans.modules.options.keymap.LayersBridge]: Invalid shortcut: org.openide.loaders.BrokenDataShadow@4b6762fe[MultiFileObject@5fad92ef[Keymaps/NetBeans/D-BACK_QUOTE.shadow]]
WARNING [null]: Last record repeated again.
Comment 12 Maria Tishkova 2017-08-01 13:02:16 UTC
windows case is fixed

changeset:   304397:f86eb6cf64b8
tag:         tip
user:        Maria Dalmatova <mromashova@netbeans.org>
date:        Tue Aug 01 16:00:33 2017 +0300
summary:     fixed bz#271185 - - "Attach Debugger" menu item generates "Failed to parse OutputStream of ps command" warning
Comment 13 Quality Engineering 2017-08-02 02:02:48 UTC
Integrated into 'main-silver', will be available in build *201708020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/008e25a9a230
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed first part of bz#271185  - "Attach Debugger" menu item generates "Failed to parse OutputStream of ps command" warning
for Linux
Still need to create fix for Windows
Comment 14 Quality Engineering 2017-08-03 01:56:43 UTC
Integrated into 'main-silver', will be available in build *201708030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f86eb6cf64b8
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed bz#271185 - - "Attach Debugger" menu item generates "Failed to parse OutputStream of ps command" warning
windows part - do not use command for NativeProcessBuilder - use execuable + arguments instead


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo