tasklist output used in pipe is broken - windows-xp
OS: windows XP
In a cmd shell, piping the output from tasklist /v does some weird things. I am trying to pipe to grep so I can filter the output, and the results are intermittent and inconsistent. A simpler way to see that the problem resides with tasklist /v is to simply execute the command tasklist /v | more - there must be a bunch of weird (cursor-up??) characters that tasklist /v is spewing out. Anyone have any insight?
Here is the straight output from tasklist /v:
C:\Users\mcintd2\FPF\CVSROOT_working\bin
>tasklist /v
Image Name PID Session Name Session# Mem Usage Status User Name CPU Time Window Title
========================= ====== ================ ======== ============ =============== ================================================== ============ ========================================================================
System Idle Process 0 Console 0 28 K Running NT AUTHORITY\SYSTEM 258:04:49 N/A
System 4 Console 0 72 K Running NT AUTHORITY\SYSTEM 1:24:24 N/A
smss.exe 1448 Console 0 60 K Running NT AUTHORITY\SYSTEM 0:00:04 N/A
csrss.exe 1520 Console 0 3,144 K Running NT AUTHORITY\SYSTEM 0:07:35 N/A
winlogon.exe 1568 Console 0 9,440 K Running NT AUTHORITY\SYSTEM 0:03:03 N/A
services.exe 1612 Console 0 3,936 K Running NT AUTHORITY\SYSTEM 0:26:43 N/A
lsass.exe 1624 Console 0 3,628 K Running NT AUTHORITY\SYSTEM 0:07:55 N/A
ibmpmsvc.exe 1788 Console 0 724 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
nvsvc32.exe 1820 Console 0 4,408 K Running NT AUTHORITY\SYSTEM 0:02:37 NVSVCPMMWindowClass
svchost.exe 1924 Console 0 2,872 K Running NT AUTHORITY\SYSTEM 0:03:50 N/A
svchost.exe 1976 Console 0 2,520 K Running NT AUTHORITY\NETWORK SERVICE 0:01:28 N/A
svchost.exe 404 Console 0 35,864 K Running NT AUTHORITY\SYSTEM 0:31:27 N/A
Smc.exe 488 Console 0 7,612 K Running NT AUTHORITY\SYSTEM 0:32:32 SS
S24EvMon.exe 752 Console 0 5,688 K Running NT AUTHORITY\SYSTEM 0:00:02 IWMSWindow
svchost.exe 1064 Console 0 1,988 K Running NT AUTHORITY\NETWORK SERVICE 0:00:27 N/A
svchost.exe 1180 Console 0 1,732 K Running NT AUTHORITY\LOCAL SERVICE 0:03:04 N/A
ccSvcHst.exe 1300 Console 0 3,028 K Running NT AUTHORITY\SYSTEM 0:05:07 N/A
spoolsv.exe 324 Console 0 4,676 K Running NT AUTHORITY\SYSTEM 0:01:37 N/A
LVPrcSrv.exe 384 Console 0 1,240 K Running NT AUTHORITY\SYSTEM 0:00:20 N/A
svchost.exe 680 Console 0 1,908 K Running NT AUTHORITY\LOCAL SERVICE 0:00:01 N/A
tphkload.exe 1124 Console 0 320 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
TPHKSVC.exe 1368 Console 0 384 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
trcboot.exe 200 Console 0 256 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
PCS_AGNT.EXE 260 Console 0 460 K Running NT AUTHORITY\SYSTEM 0:00:01 PCS_AGNT
svchost.exe 1112 Console 0 412 K Running NT AUTHORITY\LOCAL SERVICE 0:00:00 N/A
CcmExec.exe 1168 Console 0 13,272 K Running NT AUTHORITY\SYSTEM 0:19:28 N/A
cvsservice.exe 1888 Console 0 508 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
cvslock.exe 2056 Console 0 464 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
DOZESVC.EXE 2264 Console 0 260 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
tpnumlk.exe 2400 Console 0 692 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
EvtEng.exe 2408 Console 0 4,080 K Running NT AUTHORITY\SYSTEM 0:00:01 N/A
PresentationFontCache.exe 2720 Console 0 1,004 K Running NT AUTHORITY\LOCAL SERVICE 0:00:00 N/A
unsecapp.exe 2828 Console 0 1,116 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
wmiprvse.exe 2888 Console 0 4,796 K Running NT AUTHORITY\SYSTEM 0:00:06 N/A
miragent.exe 3012 Console 0 3,624 K Running NT AUTHORITY\SYSTEM 0:00:57 N/A
jqs.exe 3468 Console 0 1,412 K Running NT AUTHORITY\SYSTEM 0:13:49 N/A
LMAgent.exe 3492 Console 0 5,280 K Running NT AUTHORITY\SYSTEM 0:00:41 N/A
CamMute.exe 3624 Console 0 204 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
micmute.exe 3640 Console 0 312 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
LMS.exe 3660 Console 0 848 K Running NT AUTHORITY\SYSTEM 0:01:23 N/A
mdm.exe 3692 Console 0 1,912 K Running NT AUTHORITY\SYSTEM 0:00:27 N/A
sqlservr.exe 3708 Console 0 6,836 K Running NT AUTHORITY\NETWORK SERVICE 1:34:58 N/A
NACAgent.exe 3780 Console 0 1,268 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
nvPDsvc.exe 3892 Console 0 500 K Running NT AUTHORITY\SYSTEM 0:00:19 N/A
PWMDBSVC.exe 3940 Console 0 1,464 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
RegSrvc.exe 640 Console 0 628 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
SgeCtl.exe 1220 Console 0 792 K Running NT AUTHORITY\SYSTEM 0:00:00 OleMainThreadWndName
sqlbrowser.exe 1912 Console 0 248 K Running NT AUTHORITY\NETWORK SERVICE 0:00:00 N/A
sqlwriter.exe 2072 Console 0 856 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
svchost.exe 2088 Console 0 2,116 K Running NT AUTHORITY\SYSTEM 0:00:07 N/A
SUService.exe 2100 Console 0 4,068 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
Rtvscan.exe 2168 Console 0 5,084 K Running NT AUTHORITY\SYSTEM 0:04:32 N/A
tvt_reg_monitor_svc.exe 2248 Console 0 1,032 K Running NT AUTHORITY\SYSTEM 0:00:17 OleMainThreadWndName
tvtsched.exe 2296 Console 0 2,376 K Running NT AUTHORITY\SYSTEM 0:00:00 OleMainThreadWndName
wdfmgr.exe 2212 Console 0 256 K Running NT AUTHORITY\LOCAL SERVICE 0:00:00 N/A
UNS.exe 2356 Console 0 14,756 K Running NT AUTHORITY\SYSTEM 0:04:37 N/A
WksCfgSrv.exe 2684 Console 0 1,508 K Running NT AUTHORITY\SYSTEM 0:01:04 SafeGuard Easy WksCfgSrv Class
Wuser32.exe 2812 Console 0 536 K Running NT AUTHORITY\SYSTEM 0:00:23 N/A
ldlcserv.exe 3980 Console 0 268 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
wmiprvse.exe 3148 Console 0 2,272 K Running NT AUTHORITY\SYSTEM 0:00:05 N/A
TPOSDSVC.exe 3420 Console 0 412 K Running MYFIRMMASKED\mywinid 0:00:14 tphkmgr
tpnumlkd.exe 3440 Console 0 2,008 K Running MYFIRMMASKED\mywinid 0:00:03 ThinkPad NumLock/CapsLock Indicator
TPONSCR.exe 3776 Console 0 688 K Running MYFIRMMASKED\mywinid 0:00:02 tpvolbar
TpScrex.exe 2860 Console 0 3,992 K Running MYFIRMMASKED\mywinid 0:00:01 TpUZoom
wmiprvse.exe 980 Console 0 8,456 K Running NT AUTHORITY\NETWORK SERVICE 0:01:58 N/A
explorer.exe 4112 Console 0 24,272 K Running MYFIRMMASKED\mywinid 0:21:22 N/A
SmcGui.exe 4388 Console 0 7,144 K Running MYFIRMMASKED\mywinid 0:17:52 Network Activity
wmiprvse.exe 4488 Console 0 3,436 K Running NT AUTHORITY\SYSTEM 0:00:03 N/A
rundll32.exe 1480 Console 0 364 K Running MYFIRMMASKED\mywinid 0:00:00 BluetoothNotificationAreaIconWindowClass
tpam.exe 4284 Console 0 340 K Running MYFIRMMASKED\mywinid 0:00:00 dummy
SynTPEnh.exe 4756 Console 0 4,000 K Running MYFIRMMASKED\mywinid 0:21:51 Syn Visual Window
ecview.exe 4804 Console 0 2,636 K Running MYFIRMMASKED\mywinid 0:00:39 SafeGuardr Easy
scheduler_proxy.exe 5264 Console 0 580 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
rundll32.exe 5292 Console 0 11,084 K Running MYFIRMMASKED\mywinid 0:02:33 ATM main window
tpfnf7sp.exe 5928 Console 0 1,748 K Running MYFIRMMASKED\mywinid 0:00:02 tpfnf7
SynTPLpr.exe 2600 Console 0 320 K Running MYFIRMMASKED\mywinid 0:00:00 Touchpad driver helper window
TpShocks.exe 4464 Console 0 424 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
rundll32.exe 4692 Console 0 5,760 K Running MYFIRMMASKED\mywinid 0:00:03 MediaCenter
GravitixService.exe 3620 Console 0 6,552 K Running NT AUTHORITY\SYSTEM 0:00:06 N/A
pddm.exe 3212 Console 0 360 K Running MYFIRMMASKED\mywinid 0:00:01 Desktop Deployment Manager
ccApp.exe 3460 Console 0 536 K Running MYFIRMMASKED\mywinid 0:00:09 CCALERT
ctfmon.exe 5252 Console 0 2,780 K Running MYFIRMMASKED\mywinid 0:01:05 N/A
SCHTASK.EXE 5144 Console 0 2,888 K Running MYFIRMMASKED\mywinid 0:00:21 ScheduledTask
cmd.exe 5364 Console 0 1,276 K Running MYFIRMMASKED\mywinid 0:00:00 cmd
thunderbird.exe 15540 Console 0 1,576 K Running MYFIRMMASKED\mywinid 0:00:19 MCI command handling window
notepad++.exe 5160 Console 0 11,960 K Running MYFIRMMASKED\mywinid 0:02:03 C:\Users\mcintd2\FPF\tasklistOut.txt - Notepad++
OUTLOOK.EXE 19324 Console 0 52,680 K Running MYFIRMMASKED\mywinid 0:25:49 Inbox - Microsoft Outlook
devenv.exe 28940 Console 0 154,576 K Running MYFIRMMASKED\mywinid 2:59:07 FPF - Microsoft Visual Studio
wfcrun32.exe 34880 Console 0 2,612 K Running MYFIRMMASKED\mywinid 0:00:02 Remote Application Runtime
mstsc.exe 40500 Console 0 29,568 K Running MYFIRMMASKED\mywinid 0:01:26 N/A
wincvs.exe 40780 Console 0 18,228 K Running MYFIRMMASKED\mywinid 0:27:55 wincvs - [C:\Users\mcintd2\FPF\CVSROOT_working\bin\]
firefox.exe 39996 Console 0 513,708 K Running MYFIRMMASKED\mywinid 0:41:35 windows xp - tasklist output used in pipe is broken - Stack Overflow - M
WinMergeU.exe 37836 Console 0 9,052 K Running MYFIRMMASKED\mywinid 0:00:03 WinMerge
cmd.exe 40036 Console 0 2,868 K Running MYFIRMMASKED\mywinid 0:00:00 dummyWindowTitle
cmd.exe 40600 Console 0 3,296 K Running MYFIRMMASKED\mywinid 0:00:00 cmd - tasklist /v
mspdbsrv.exe 42136 Console 0 3,032 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
cmd.exe 43364 Console 0 108 K Running MYFIRMMASKED\mywinid 0:00:00 TD
nsload.exe 43260 Console 0 13,672 K Running MYFIRMMASKED\mywinid 0:00:36 N/A
conset.exe 43592 Console 0 288 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
nsverctl.exe 44756 Console 0 5,748 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
tasklist.exe 43156 Console 0 5,740 K Running MYFIRMMASKED\mywinid 0:00:00 OleMainThreadWndName
Here is the output from tasklist /v | more :
C:\Users\mcintd2\FPF\CVSROOT_working\bin
>tasklist /v | more
Image Name PID Session Name Session# Mem Usage Status User Name CPU Time Window Title
winlogon.exe 1568 Console 0 9,440 K Running NT AUTHORITY\SYSTEM 0:03:03 N/A
services.exe 1612 Console 0 3,996 K Running NT AUTHORITY\SYSTEM 0:26:36 N/A
svchost.exe 1976 Console 0 2,520 K Running NT AUTHORITY\NETWORK SERVICE 0:01:28 N/A
svchost.exe 1180 Console 0 1,732 K Running NT AUTHORITY\LOCAL SERVICE 0:03:04 N/A
tphkload.exe 1124 Console 0 320 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
CcmExec.exe 1168 Console 0 13,180 K Running NT AUTHORITY\SYSTEM 0:19:28 N/A
EvtEng.exe 2408 Console 0 4,080 K Running NT AUTHORITY\SYSTEM 0:00:01 N/A
jqs.exe 3468 Console 0 1,440 K Running NT AUTHORITY\SYSTEM 0:13:45 N/A :00:00 N/A
mdm.exe 3692 Console 0 1,912 K Running NT AUTHORITY\SYSTEM 0:00:27 N/A
RegSrvc.exe 640 Console 0 628 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
SUService.exe 2100 Console 0 4,068 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
UNS.exe 2356 Console 0 14,680 K Running NT AUTHORITY\SYSTEM 0:04:35 N/A
TPOSDSVC.exe 3420 Console 0 412 K Running MYFIRMMASKED\mywinid 0:00:14 tphkmgr
notepad++.exe 5160 Console 0 11,960 K Running MYFIRMMASKED\mywinid 0:02:03 C:\Users\mcintd2\FPF\tasklistOut.txt - Notepad++
wincvs.exe 40780 Console 0 18,228 K Running MYFIRMMASKED\mywinid 0:27:25 wincvs - [C:\Users\mcintd2\FPF\CVSROOT_working\bin\]
mspdbsrv.exe 42136 Console 0 3,032 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
tasklist.exe 41524 Console 0 5,748 K Running MYFIRMMASKED\mywinid 0:00:00 OleMainThreadWndName
more.com 44544 Console 0 1,604 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
nsverctl.exe 44756 Console 0 5,748 K Running NT AUTHORITY\SYSTEM 0:00:00 N/A
tpfnf7sp.exe 5928 Console 0 1,748 K Running MYFIRMMASKED\mywinid 0:00:02 tpfnf7
C:\Users\mcintd2\FPF\CVSROOT_working\bin 0 320 K Running MYFIRMMASKED\mywinid 0:00:00 Touchpad driver helper window
>pShocks.exe 4464 Console 0 424 K Running MYFIRMMASKED\mywinid 0:00:00 N/A
rundll32.exe 4692 Console 0 5,760 K Running MYFIRMMASKED\mywinid 0:00:03 MediaCenter
gravitixService.exe 3620 Console 0 6,552 K Running NT AUTHORITY\SYSTEM 0:00:06 N/A
pddm.exe 3212 Console 0 360 K Running MYFIRMMASKED\mywinid 0:00:01 Desktop Deployment Manager
ccApp.exe 3460 Console 0 432 K Running MYFIRMMASKED\mywinid 0:00:09 CCALERT
ctfmon.exe 5252 Console 0 2,780 K Running MYFIRMMASKED\mywinid 0:01:03 N/A
SCHTASK.EXE 5144 Console 0 2,888 K Running MYFIRMMASKED\mywinid 0:00:21 ScheduledTask
cmd.exe 5364 Console 0 1,276 K Running MYFIRMMASKED\mywinid 0:00:00 cmd
thunderbird.exe 15540 Console 0 1,576 K Running MYFIRMMASKED\mywinid 0:00:19 MCI command handling window
Notice half the output is missing, and the command prompt winds up in the middle of the list. Invoking tasklist /v | more results in different, bizzare behaviour each time.
Here's a screenshot from the first pause by more:
Note how much data is missing and the odd position of the cursor. Here is a sreeenshot after hitting space in the above cmd shell window:
You can't see the cursor this time (I didn't hit the prtsc at the right time), but its on the line immediately above the --- more -- line.
Uh it turns out that tasklist spits garbage to stderr, which in turns causes issues in (display of) later pipe stages.
To see that, change console font to Lucida (in properties), codepage to 437 (chcp 437) and re-run tasklist
To get rid of use tasklist 2>nul | more (or grep, obviously)
(As far as I'm able to tell if affects only display, so tasklist |grep whatever >result.txt should also give consistent/proper results.
Tested under same version as yours (5.1.2600 SP3).
Annoying... looks like a bug to me.
Piping through more give me no less lines, more actually
C:\Steven\Desktop\etc>tasklist -v | C:\cygwin\bin\wc
39 448 8780
C:\Steven\Desktop\etc>tasklist -v | more | C:\cygwin\bin\wc
41 458 9013
Related
Centos not using available memory
I have Centos installed on a server with 64gb memory and it seems as if the memory usage is being suppressed. I came to this conclusion by running an insert statement where I insert 10million rows into a Postgres table in both a Timescaledb and a standard Postgres instance hosted on Docker. I monitored the insert process in three different ways: Docker stats timescaledb: CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS timescaledb 73.14% 10.42 MiB / 62.75 GiB 0.02% 8.46 kB / 8.39 kB 0 B / 15.1 GB 12 free -i gives the following: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 16298 avahi 20 0 16.2g 762356 759908 R 41.5 1.2 0:22.72 postgres 16127 avahi 20 0 16.2g 693080 691968 S 4.3 1.1 0:01.29 postgres 16129 avahi 20 0 16.2g 17748 16712 S 2.3 0.0 0:00.87 postgres 1578 root 30 10 1232780 86976 11568 S 0.7 0.1 0:46.34 osqueryd 17014 root 20 0 162264 2480 1596 R 0.7 0.0 0:00.03 top 928 root 20 0 90608 3212 2352 S 0.3 0.0 0:03.47 rngd 16128 avahi 20 0 16.2g 132064 131016 S 0.3 0.2 0:00.18 postgres free -h gives the following total used free shared buff/cache available Mem: 62G 1.0G 58G 1.1G 3.1G 56G Swap: 62G 0B 62G I know that Timescaledb is an extension of Postgres which comes with its own memory configurations, but the Docker container of Timescaledb configures these automatically for you (for instance effective cache size is set at 48gb as opposed to the default 4gb that Postgres ships with). I also ran a similar process with Apache spark with 16gb assigned to the worker and it ran into an oom error. Additionally, I did a similar test on a different smaller VM and the memory usage increased as expected. All of this leads me to believe that it's a Centos config setting that I am missing somewhere, and nothing to do with Timescale/Postgres? I have added the following parameters to vm.overcommit_memory = 2 and vm.overcommit_ratio = 95 in /etc/sysctl.conf and ran sysctl -p to implement the settings, but this didn't make a difference. kernel.shmall = 8224280 kernel.shmmax = 33686650880 kernel.shmmni = 4096 vm.overcommit_memory = 2 vm.overcommit_ratio = 95 Below is the output from cat /proc/meminfo MemTotal: 65794240 kB MemFree: 61098656 kB MemAvailable: 59252660 kB Buffers: 2120 kB Cached: 3467144 kB SwapCached: 0 kB Active: 2817620 kB Inactive: 884816 kB Active(anon): 1109220 kB Inactive(anon): 234708 kB Active(file): 1708400 kB Inactive(file): 650108 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 65535996 kB SwapFree: 65535996 kB Dirty: 88 kB Writeback: 0 kB AnonPages: 233188 kB Mapped: 1175120 kB Shmem: 1110756 kB Slab: 204044 kB SReclaimable: 142700 kB SUnreclaim: 61344 kB KernelStack: 7232 kB PageTables: 14672 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 128040524 kB Committed_AS: 18709300 kB VmallocTotal: 34359738367 kB VmallocUsed: 408824 kB VmallocChunk: 34325399548 kB Percpu: 9216 kB HardwareCorrupted: 0 kB AnonHugePages: 96256 kB CmaTotal: 0 kB CmaFree: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 133604 kB DirectMap2M: 66965504 kB Is there maybe something I can try to increase my memory usage? Is there maybe a config setting that I am missing somehere? Thanks in advance for any help
PostgreSQL also uses "unused" memory, because it uses buffered I/O. So this "unused memory" is used by the kernel to cache files – in the case of a database server, these will be database files. That way, I/O requests by PostgreSQL can be served from the kernel cache rather than causing disk I/O requests.
Save file in eclipse makes processor works hard
I am using eclipse juno. Every time i save a file, eclipse consume 100% processor. Here are the snapshot from top command : Tasks: 303 total, 1 running, 301 sleeping, 1 stopped, 0 zombie %Cpu(s): 31,2 us, 1,4 sy, 0,0 ni, 65,6 id, 0,4 wa, 0,0 hi, 1,4 si, 0,0 st KiB Mem: 8077332 total, 5122068 used, 2955264 free, 509476 buffers KiB Swap: 8252412 total, 0 used, 8252412 free, 2242736 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3816 iwan 20 0 1141m 410m 35m S 100,9 5,2 59:00.47 eclipse 3882 iwan 20 0 594m 162m 52m S 2,3 2,1 6:09.30 skype 2646 iwan 20 0 309m 82m 32m S 2,0 1,0 9:05.18 compiz 3894 iwan 20 0 851m 171m 42m S 2,0 2,2 3:00.66 thunderbird 1305 root 20 0 266m 68m 55m S 1,3 0,9 7:55.87 Xorg any ideas ?
Apply any available updates. If problems continue, keep an eye on http://bugs.eclipse.org/402018 .
What do these Windbg error messages mean?
I'm trying to do a !heap -s in Windbg to get heap information. When I attempt it I get the following output: Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast (k) (k) (k) (k) length blocks cont. heap ----------------------------------------------------------------------------- 00000000005d0000 08000002 512 28 512 10 3 1 0 0 Error: Heap 0000000000000000 has an invalid signature eeffeeff Front-end heap type info is not available Front-end heap type info is not available Virtual block: 0000000000000000 - 0000000000000000 (size 0000000000000000) HEAP 0000000000000000 (Seg 0000000000000000) At 0000000000000000 Error: Unable to read virtual block 0000000000000000 00000000 0 0 0 0 0 0 1 0 ----------------------------------------------------------------------------- I can't find any reference as to what the unusual error/not available lines mean. Can someone please give me a summary as to why I'm not getting an expected list of heaps? The only thing I execute prior to !heap -s is !wow64exts.sw because the process dumps are from a 32 bit process but created by a 64 bit Task Manager.
After testing with the 32 and 64 bit Task Managers it appears that process dumps of 32 bit processes created by the 64 bit Task Manager can only be debugged successfully in some areas using !wow64exts.sw in Windbg to use 32 bit debugging. That extension allows call stacks to be reviewed correctly, but !heap -s does not appear to work correctly under it. Instead you end up with the errors in the question. For example, the output from a process dump of the 32 bit process using the 32 bit Task Manager: 0:000> !heap -s NtGlobalFlag enables following debugging aids for new heaps: stack back traces LFH Key : 0x06b058a2 Termination on corruption : DISABLED Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast (k) (k) (k) (k) length blocks cont. heap ----------------------------------------------------------------------------- 031b0000 08000002 1024 236 1024 2 13 1 0 0 LFH 001d0000 08001002 1088 188 1088 18 9 2 0 0 LFH 01e30000 08001002 1088 160 1088 4 3 2 0 0 LFH 03930000 08001002 256 4 256 2 1 1 0 0 038a0000 08001002 64 16 64 13 1 1 0 0 ----------------------------------------------------------------------------- The output from a process dump of the 32 bit process using the 64 bit Task Manager without !wow64exts.sw: 0:000> !heap -s NtGlobalFlag enables following debugging aids for new heaps: stack back traces LFH Key : 0x000000b406b058a2 Termination on corruption : ENABLED Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast (k) (k) (k) (k) length blocks cont. heap ------------------------------------------------------------------------------------- 0000000001f70000 08000002 512 28 512 10 3 1 0 0 0000000000020000 08008000 64 4 64 1 1 1 0 0 ------------------------------------------------------------------------------------- The output from a process dump of the 32 bit process using the 64 bit Task Manager with !wow64exts.sw: 0:000> !wow64exts.sw Switched to 32bit mode 0:000:x86> !heap -s NtGlobalFlag enables following debugging aids for new heaps: stack back traces LFH Key : 0x000000b406b058a2 Termination on corruption : ENABLED Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast (k) (k) (k) (k) length blocks cont. heap ----------------------------------------------------------------------------- 0000000001f70000 08000002 512 28 512 10 3 1 0 0 Error: Heap 0000000000000000 has an invalid signature eeffeeff Front-end heap type info is not available Front-end heap type info is not available Virtual block: 0000000000000000 - 0000000000000000 (size 0000000000000000) HEAP 0000000000000000 (Seg 0000000000000000) At 0000000000000000 Error: Unable to read virtual block 0000000000000000 00000000 0 0 0 0 0 0 1 0 ----------------------------------------------------------------------------- Those were all taken from the same process.
choose the column from a cmd command
is there a way to choose the columns from windows cmd command? for example: when i use the following command: tasklist i get this result: Image Name PID Session Name Session# Mem Usage System Idle Process 0 Services 0 12 K System 4 Services 0 920 K smss.exe 260 Services 0 764 K csrss.exe 360 Services 0 3,360 K wininit.exe 412 Services 0 4,428 K csrss.exe 424 Console 1 10,316 K services.exe 476 Services 0 9,116 K winlogon.exe 500 Console 1 5,456 K lsass.exe 512 Services 0 10,300 K lsm.exe 540 Services 0 2,960 K svchost.exe 648 Services 0 8,212 K svchost.exe 724 Services 0 8,048 K svchost.exe 796 Services 0 14,740 K svchost.exe 848 Services 0 60,788 K svchost.exe 884 Services 0 27,812 K svchost.exe 1036 Services 0 9,796 K and i need only for the first and the last column. is there a way to desplay only the columns what i need? tanks
This isn't perfect as the fields in tasklist vary with the length of the task names, but it may be good enough for you. It uses a helper batch file called repl.bat from - http://www.dostips.com/forum/viewtopic.php?f=3&t=3855 tasklist|repl "^(.......................).*(.............)$" "$1 $2" m Adjust the length of the first set of (....) to suit you.
A big helper is, that the columns have a fixed width, so you can use the following ugly one liner: for /f "delims=" %I in ('tasklist') do #set "_=%I"&#call echo.^%_:~0,25^% ^%_:~64^% or better this batch file: #echo off setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION for /f "skip=1 delims=" %%I in ('tasklist') do ( set "_=%%I" call echo %%_:~0,25%% %%_:~64%% ) endlocal the call and %% syntax is my preferred style instead of DELAYEDEXPANSION which I always try to avoid, because it had some annoying side effects in my experience. Therefore I declared it bad style in our department and I'm a bit preachy about it :).
Error when redirecting stdout and stderr of powershell script
The script runs fine when stdout/stderr are not redirected. When I add both stderr and stdout redirection, I getg the following error: How can I avoid it? % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 19.4M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 81 19.4M 0 0 81 15.9M 0 54.5M --:--:-- --:--:-- --:--:-- 55.8M 100 19.4M 0 0 100 19.4M 0 14.2M 0:00:01 0:00:01 --:--:-- 14.3M 100 19.4M 0 0 100 19.4M 0 8428k 0:00:02 0:00:02 --:--:-- 8454k 100 19.4M 0 0 100 19.4M 0 5924k 0:00:03 0:00:03 --:--:-- 5937k 100 19.4M 0 0 100 19.4M 0 4567k 0:00:04 0:00:04 --:--:-- 4575k 100 19.4M 0 50 100 19.4M 10 4291k 0:00:04 0:00:04 --:--:-- 835k out-lineoutput : The OS handle's position is not what FileStream expected. Do not use a handle simu ltaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss. + CategoryInfo : NotSpecified: (:) [out-lineoutput], IOException + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.OutLineOutputCom mand
Lee Holmes (one of the senior developers on the powershell team) covers this here in a blog post: http://www.leeholmes.com/blog/WorkaroundTheOSHandlesPositionIsNotWhatFileStreamExpected.aspx This is bug in PowerShell v1.0, and happens when: a PowerShell command generates both regular and error output you have used cmd.exe to redirect the output to a file you have used cmd.exe to merge the output and error streams There is a workaround. -Oisin
I once had several hard-linked junctions at directory that needed to have "GetItemChild" applied, and received the same error as this question. Removing the junctions solved the problem.