在loong64架构平台 一运行就报错
Received signal 7 BUS_ADRERR 4600f800035f00
#0 0x00aab3d9b8d8 base::debug::CollectStackTrace()
#1 0x00aab3d8317c base::debug::StackTrace::StackTrace()
#2 0x00aab3d9b790 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x00ffff8488a0 ([vdso]+0x89f)
#4 0x00ff63ff9780
Can you provide more information about what you are trying to do? Which NodeJS / Electron version are you using. How does the code looks like, that can reproduce the exception?
Also, please note, the loong64 architecture is not covered with prebuilt binaries. That means you would have to setup a proper build tool chain for rebuilding better-sqlite3. While (cross-)compilation is working, there may still be adjustments required for running on loong64.
使用的是 electron+better-sqlite3
version: electron:26.4.3 better-sqlite3 :9.6.0
注意是loong64架构平台
代码:
import { app, shell, BrowserWindow } from 'electron'
import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset'
import Database from 'better-sqlite3'
import os from 'os'
function createWindow() {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 900,
height: 670,
show: false,
autoHideMenuBar: true,
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
sandbox: false
}
})
mainWindow.on('ready-to-show', () => {
mainWindow.show()
})
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
})
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
} else {
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
}
}
app.whenReady().then(() => {
// Set app user model id for windows
electronApp.setAppUserModelId('com.electron')
app.on('browser-window-created', (_, window) => {
optimizer.watchWindowShortcuts(window)
})
async function exec() {
try {
let dbPath =join(os.homedir(), "/cdi_Client/cloudlnk.config");
const db =new Database(dbPath, {
verbose: (msg) => dbLogger.info(`[DB]: ${msg}`)
})
const result =await db.prepare("SELECT * FROM t_local_setting").all()
console.log('res: ', result);
} catch (error) {
console.log('error: ', error);
}
}
exec();
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
The loong64 is not supported by this library currently: the biggest hurdle is that docker run --platform would need to support something like linux/loong64.
I could mark this as an enhancement, I think I'll just close this, and when docker support is added, and a way to validate the build using emulation is provided, we can accept a PR to add this to the test and prebuild matrices.