I have set up a minimal FHS environment in which I am trying to run an Electron app. However, every time I run electron, even without any parameters, it ends within one section with this:
+++ killed by SIGTRAP (core dumped) +++
Trace/breakpoint trap
Okay, the background. I just joined a new team that has a very large existing Rust and Electron application. I’m trying to get my machine set up, and while I can get everything to build, the app itself always fails because it is an electron app that throws this SIGTRAP. The core file contains a whole bunch of stack frames with no information because electron has no debugging symbols.
Only need two files to reproduce this, so here they are. First, the shell.nix:
let
pkgs = import <pkgs-20.03> { };
in (pkgs.buildFHSUserEnv {
name = "fhs";
targetPkgs = pkgs: [
pkgs.icu
pkgs.file
pkgs.git
pkgs.gdb
pkgs.bash
pkgs.at-spi2-atk
pkgs.at-spi2-core
pkgs.atk
pkgs.nodejs-12_x
pkgs.glib
pkgs.gtk3
pkgs.xorg.libX11
pkgs.xorg.libxcb
pkgs.xorg.libXcomposite
pkgs.xorg.libXcursor
pkgs.xorg.libXdamage
pkgs.xorg.libXext
pkgs.xorg.libXfixes
pkgs.xorg.libXi
pkgs.xorg.libXrandr
pkgs.xorg.libXrender
pkgs.xorg.libXScrnSaver
pkgs.xorg.libXtst
pkgs.nspr
pkgs.nss
pkgs.dbus
pkgs.pango
pkgs.expat
pkgs.cairo
pkgs.libdrm
pkgs.mesa
pkgs.gdk-pixbuf
pkgs.alsaLib
pkgs.cups
];
runScript = "bash --init-file /etc/profile";
profile = ''
export C_INCLUDE_PATH=/usr/include:$C_INCLUDE_PATH
export NODE_ENV=development
if [ -e ~/.nixpkgs/shellhook.sh ]; then . ~/.nixpkgs/shellhook.sh; fi;
'';
}).env
Next, package.json:
{
"name": "electron-env",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "9.0.2"
}
}
To reproduce:
nix-shell
npm install
npx electron
And you should immediately see a core dump (if you have disabled systemd-coredump). file
will identify it as having come from electron
.
If anyone is willing to help, I would like to get this working. First, I don’t really want to do long-term development inside of a VM or reinstall my system with Ubuntu. Second… I might have accidentally converted my new team lead to NixOS, just by sharing my basic system files while he was putting NixOS into a VM.