oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.45k stars 2.78k forks source link

node-opcua causes bun to crash #14297

Open catinrage opened 1 month ago

catinrage commented 1 month ago

How can we reproduce the crash?

my code :

import { OPCUAClient } from 'node-opcua';

async function connectToMachine() {
  const client = OPCUAClient.create({
    endpointMustExist: false,
    defaultSecureTokenLifetime: 60000, // Adjust secure token lifetime
    connectionStrategy: {
      maxRetry: 10,
      initialDelay: 1000,
      maxDelay: 5000,
    },
    requestedSessionTimeout: 60000, // Adjust session timeout
  });
  const endpointUrl = 'opc.tcp://192.168.1.201:22';

  client.on('connected', () => {
    console.log(chalk.bold.green('Connected to the CNC machine!'));
  });

  try {
    console.log('Attempting to connect...');
    await client.connect(endpointUrl);
    console.log('Connected to the CNC machine successfully!');
  } catch (err) {
    console.error('Failed to connect:', err);
  } finally {
    await client.disconnect();
  }
}

connectToMachine();

Relevant log output

No response

Stack Trace (bun.report)

Bun v1.1.13 (ee30e86) on linux x86_64 [AutoCommand]

Segmentation fault at address 0x0000001A

Features: jsc, Bun.stdin, transpiler_cache, tsconfig

github-actions[bot] commented 1 month ago

@catinrage, the latest version of Bun is v1.1.29, but this crash was reported on Bun v1.1.13.

Are you able to reproduce this crash on the latest version of Bun?

bun upgrade