Windows: interface recorded as 'Get-Partition : Invalid property' (PowerShell stderr captured as value)

Aperta
#271 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, powershell
Ambito
backend

Direzione di ricerca

Start with jdm-core/src/main/java/jdiskmark/UtilOs.java, especially getDriveInterfaceWindows and runPowerShellOneLiner, then inspect the caller in jdm-core/src/main/java/jdiskmark/Util.java around line 440. Trace how PowerShell output and failures are handled, and check the Windows tests if present. Done means failed commands no longer store error text as drive data, with the proposed fallback and attribute validation covered.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Anomaly

Benchmark: https://test.jdiskmark.net/all_benchmarks/benchmark/6b08327a59d708ebcc3a71ce

The Interface field was uploaded as Get-Partition : Invalid property. It should be a bus type such as NVMe.

Field Value
Drive Model Lexar SSD NM790 1TB
OS Windows 11 Dev (build 27982), Insider
Processor Intel Core i5-6500
JDK 25.0.1
Client v0.9.1

Root cause (client)

UtilOs.getDriveInterfaceWindows() runs:

Get-Partition -DriveLetter X | Get-Disk | Select-Object -ExpandProperty BusType

with pb.redirectErrorStream(true). It returns the first non-empty line of the combined output. When PowerShell fails, the first line is the error header (Get-Partition : Invalid property), and that text is stored as the interface.

runPowerShellOneLiner() has the same pattern. That means getBusTypeWindows, getFilesystemWindows and getSectorSizeWindows can also return PowerShell error text instead of null. (getPhysicalDriveNumberWindows is not affected because it checks the value against \d+.)

Environmental trigger

Invalid property is a CIM error from the Storage Management WMI provider (root\Microsoft\Windows\Storage, class MSFT_Partition). The likely causes:

  • A broken or changed Storage WMI provider on the Insider Dev build 27982
  • A corrupt or unregistered Storage WMI repository on that machine
  • A third-party or unusual NVMe driver for the NM790 that the Storage provider cannot enumerate

None of these are JDiskMark bugs. But the client should not record the error text as data.

Proposed fix

  1. Do not merge stderr into stdout in the Windows PowerShell helpers (drain stderr separately, or discard it). Also check the exit code: on failure, return null.
  2. Optionally add -ErrorAction Stop and validate the output. For example, accept BusType only if it matches a known value or ^[A-Za-z0-9 ]+$ and does not contain :.
  3. Add a fallback when Get-Partition fails: use Get-CimInstance Win32_DiskDrive / MSFT_PhysicalDisk BusType, the same way getPhysicalDriveNumberWindows already falls back to WMI.
  4. Portal: consider cleaning up or flagging existing records whose interface contains Get-Partition or :.

TODO

Client (jdm-java)
  • Stop merging stderr into stdout in getDriveInterfaceWindows and runPowerShellOneLiner; check the exit code and return null on failure
  • Validate attribute values (interface, filesystem, sector size) before storing them; reject values containing : or known PowerShell error patterns
  • Fall back to MSFT_PhysicalDisk / Win32_DiskDrive BusType when Get-Partition fails
  • Detect preview / Insider OS builds (Windows DisplayVersion = Dev, Canary / Dev build numbers) and include a flag in the upload payload
  • Capture these failures for the diagnostic log upload (#272)
Portal (jdm-web) — tracked in JDiskMark/jdm-web#89
  • Filter benchmarks with invalid interface / attribute values out of leaderboards and aggregate stats
  • Filter / tag benchmarks from preview / Insider OS builds, excluded by default with a toggle to include them
  • Show a warning badge on flagged benchmark detail pages
  • Clean up or flag existing bad records, including 6b08327a59d708ebcc3a71ce

Related

  • #272 Upload diagnostic error logs to community portal
  • JDiskMark/jdm-web#89 Diagnostic log ingestion and anomalous benchmark filtering

References

  • jdm-core/src/main/java/jdiskmark/UtilOs.java: getDriveInterfaceWindows, runPowerShellOneLiner
  • jdm-core/src/main/java/jdiskmark/Util.java: caller around line 440
Lingua principale
Java
Stelle
6
Fork
6
Merge medio
10h 11m
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JDiskMark/jdm-java

Tutte le issue di JDiskMark/jdm-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.