sebhildebrandt/systeminformation

Assertion failed: result_size == sppi_size

Opened this issue · 3 comments

Describe the bug
I compiled the code to exe with the command pkg index.js --targets node18-win-x64 --output AntiVm.exe after that when ran on my other device to test it gives this error on the other device but not the one i made it on

Packages
pkg version: yao-pkg/pkg | 5.15.0
Node.js version: v20.17.0
systeminformation version: 5.23.5
Build Meant For: node18, x86_64 and windows

Code:

const readline = require('readline');
const systeminformation = require('systeminformation');

(async() => {
    const Cpu = await systeminformation.cpu();
    const OS = await systeminformation.osInfo();
    const Bios = await systeminformation.bios();
    const Motherboard = await systeminformation.baseboard();
    const Graphics = await systeminformation.graphics();
    const Network = await systeminformation.networkInterfaces();
    const System = await systeminformation.system();
    
    console.log('CPU Information:', Cpu);
    console.log('OS Information:', OS);
    console.log('BIOS Information:', Bios);
    console.log('Motherboard Information:', Motherboard);
    console.log('Graphics Information:', Graphics);
    console.log('Network Interfaces:', Network);
    console.log('System Information:', System);
    
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    
    rl.question('Press Enter to exit...', () => {
        rl.close();
        process.exit(0);
    });
})()

Current Behavior:
Assertion failed: result_size == sppi_size, file C:\Users\dev\AppData\Local\Temp\pkg.24e0b2b2d51e47b9dba34c30\node\deps\uv\src\win\util.c, line 676

Expected Behavior:

CPU Information: {
  manufacturer: 'AMD',
  brand: 'Ryzen 7 5800X 8-Core Processor',
  vendor: 'AuthenticAMD',
  family: '25',
  model: '33',
  stepping: '2',
  revision: '8450',
  voltage: '',
  speed: 3.8,
  speedMin: 3.8,
  speedMax: 3.8,
  governor: '',
  cores: 16,
  physicalCores: 8,
  performanceCores: 16,
  efficiencyCores: 0,
  processors: 1,
  socket: 'AM4',
  flags: 'de pse msr sep mtrr mca cmov psn clfsh ds mmx fxsr sse sse2 ss htt tm ia64 pbe',
  virtualization: false,
  cache: { l1d: 256, l1i: 256, l2: 4194304, l3: 33554432 }
}

Enviroment Info:

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│  SYSTEMINFORMATION                                                      Version: 5.23.5 │
└─────────────────────────────────────────────────────────────────────────────────────────┘

Operating System:
──────────────────────────────────────────────────────────────────────────────────────────
Platform: Windows
Distro: 
Release: 10.0.22631
Codename: 
Kernel: 10.0.22631
Arch: x64
Hostname: DESKTOP-U0KE7IK
Codepage: 437
Build:
Hypervisor:
RemoteSession:

System:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer:
Model:
Version:
Virtual:

CPU:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer:
Brand:
Family:
Model:
Stepping:
Speed:
Cores: 16
PhysicalCores: 16
PerformanceCores: 16
EfficiencyCores:
Processors: 1
Socket:

Hi @CookieHosting ... as result_size == sppi_size is not in the source of systeminformation, I am not sure, if this is related to my package ... would it be possible, to try to strip out line by line in your code to see then the error disappears? This might give us a hint where the problem is. I see that you also created an issue on yao-pkg side.

Yeah i created a issue on yao-pkg just in case so they could try and fix it since i though it couldve been something with the package as, as soon as i added your package is seemed to happen, i tried it also with the following code and it didnt work either

const systeminformation = require('systeminformation');

(async() => {
    const Cpu = await systeminformation.cpu();
    const OS = await systeminformation.osInfo();
    const Bios = await systeminformation.bios();
    const Motherboard = await systeminformation.baseboard();
    const Graphics = await systeminformation.graphics();
    const Network = await systeminformation.networkInterfaces();
    const System = await systeminformation.system();
    
    console.log('CPU Information:', Cpu);
    console.log('OS Information:', OS);
    console.log('BIOS Information:', Bios);
    console.log('Motherboard Information:', Motherboard);
    console.log('Graphics Information:', Graphics);
    console.log('Network Interfaces:', Network);
    console.log('System Information:', System);
})()

Error it gave:

Assertion failed: result_size == sppi_size, file C:\Users\dev\AppData\Local\Temp\pkg.002fa024da5fb7a2bd4a772b\node\deps\uv\src\win\util.c, line 598

@CookieHosting two questions:

  1. Does this above code work when you call it directly in the command line with node.js?
  2. have you tried to strip down the code above to see if one of the functions causes the issue (so basically can you just add one systeminformation call (one by one) and see if you can compile? This might also help Yao to see where the problem is.

I just worked on a project using this library with Deno and compiling it to Windows, Linux and Mac ... without any issue.