-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wechat: init at 4.0.0.30 (linux) / 4.0.0.5 (darwin) #354332
base: master
Are you sure you want to change the base?
Conversation
Details about the segfault: $ lldb ./result/bin/wechat
(lldb) target create "./result/bin/wechat"
Current executable set to '/home/leah/coding/nixpkgs/result/bin/wechat' (x86_64).
(lldb) run
Process 103844 launched: '/home/leah/coding/nixpkgs/result/bin/wechat' (x86_64)
Process 103844 stopped
* thread #43, name = 'mmui::utility::', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x10)
frame #0: 0x000055555e510008 wechat`___lldb_unnamed_symbol227806 + 232
wechat`___lldb_unnamed_symbol227806:
-> 0x55555e510008 <+232>: movq 0x10(%rax), %rdx
0x55555e51000c <+236>: addq %rax, %rdx
0x55555e51000f <+239>: movl 0x4(%rax), %eax
0x55555e510012 <+242>: orq %rax, %rbx |
By the way, we may also support loongarch64-linux since you are using the deb as the source. |
Does Nixpkgs even have loongarch support, like, at all...? |
86f7017
to
7755a61
Compare
Someone wrote this.
{ makeWrapper, xorg, gcc, fontconfig, libxml2, stdenv, lib, dpkg
, autoPatchelfHook, qt5, libGL, libsForQt5, zlib, nss, nspr, bzip2, libxkbcommon
, glib, dbus, atk, mesa, libdrm, expat, pango, cairo, alsa-lib }:
let
libPath = lib.makeLibraryPath ([
pango.out
xorg.libxcb
xorg.libXcomposite
xorg.libXrender
xorg.libXrandr
xorg.xcbutilwm.out
xorg.xcbutilimage.out
xorg.xcbutilrenderutil.out
xorg.xcbutilkeysyms.out
xorg.libX11.out
xorg.libXdamage.out
xorg.libXext.out
xorg.libXfixes.out
mesa.out
libGL.out
alsa-lib.out
libdrm.out
cairo.out
expat.out
fontconfig.lib
dbus.lib
nss.out
nspr.out
bzip2.out
zlib.out
libxkbcommon.out
glib
atk.out
(lib.getLib gcc.cc)
]);
in stdenv.mkDerivation {
name = "wechat";
pname = "wechat";
version = "4.0";
outputs = [ "out" ];
src = /etc/nixos/pkgs/wechat/WeChatLinux_x86_64.deb;
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
buildInputs = [
dpkg
xorg.libX11.out
xorg.libXScrnSaver
xorg.libXft.out
(lib.getLib gcc.cc)
fontconfig.lib
libxml2.out
];
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
unpackPhage = ''
dpkg -x $src ./wechat
'';
installPhase = ''
runHook preInstall
mkdir -p $out $out/bin
cp -r ./* $out/
runHook postInstall
'';
fixupPhase = ''
#patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $out/opt/wechat:${libPath} $out/opt/wechat/wechat
makeWrapper $out/opt/wechat/wechat $out/bin/wechat --prefix LD_LIBRARY_PATH : $out/opt/wechat:${libPath}
'';
} |
Still segfaults but fortunately at a different location now. Progress? (lldb) target create "./result/bin/wechat"
Current executable set to '/home/leah/coding/nixpkgs/result/bin/wechat' (x86_64).
(lldb) run
Process 1091167 launched: '/home/leah/coding/nixpkgs/result/bin/wechat' (x86_64)
Process 1091167 stopped
* thread #1, name = 'wechat', stop reason = exec
frame #0: 0x00007ffff7fe2840 ld-linux-x86-64.so.2`_start
ld-linux-x86-64.so.2`_start:
-> 0x7ffff7fe2840 <+0>: movq %rsp, %rdi
0x7ffff7fe2843 <+3>: callq 0x7ffff7fe3520 ; _dl_start
ld-linux-x86-64.so.2`_dl_start_user:
0x7ffff7fe2848 <+0>: movq %rax, %r12
0x7ffff7fe284b <+3>: movq %rsp, %r13 |
I think I am colossally stupid and the previous fix actually works now somehow |
7755a61
to
5cc7820
Compare
Now that both this PR and #354355 are working we have to pick one to go ahead — IMO working with .debs is more convenient than unpacking AppImages (and it also allows us to support Loongarch), and the overall deriv is much simpler this way |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/4819 |
nixpkgs-review somehow gets me:
.. seemingly over the concatenation stuff going on there |
Use |
5cc7820
to
969485c
Compare
😿 |
Can you run lldb? I've been using it for a few days now locally and it hasn't crashed on me yet 🤔 |
It doesn't crash, but has other problems.
|
hm, i may not be sufficiently familiar with lldb:
|
What I found is when a message is arrived, the wechat will SIGSEGV immediatly. After digging for a while, I find the pulseaudio may be the cause, the gdb shows the segfault stackframe contains error log about pulseaudio, (gdb) x/150bc $rsi-0x50
0x560aabe1d67e: 77 'M' 69 'E' 83 'S' 0 '\000' 91 '[' 37 '%' 115 's' 93 ']'
0x560aabe1d686: 91 '[' 37 '%' 115 's' 58 ':' 37 '%' 100 'd' 93 ']' 0 '\000'
0x560aabe1d68e: 80 'P' 117 'u' 108 'l' 115 's' 101 'e' 65 'A' 117 'u' 100 'd'
0x560aabe1d696: 105 'i' 111 'o' 83 'S' 121 'y' 115 's' 116 't' 101 'e' 109 'm'
0x560aabe1d69e: 58 ':' 58 ':' 111 'o' 112 'p' 101 'e' 110 'n' 95 '_' 114 'r'
0x560aabe1d6a6: 101 'e' 99 'c' 111 'o' 114 'r' 100 'd' 95 '_' 115 's' 116 't'
0x560aabe1d6ae: 114 'r' 101 'e' 97 'a' 109 'm' 32 ' ' 102 'f' 97 'a' 105 'i'
0x560aabe1d6b6: 108 'l' 101 'e' 100 'd' 44 ',' 32 ' ' 115 's' 116 't' 114 'r'
0x560aabe1d6be: 101 'e' 97 'a' 109 'm' 32 ' ' 105 'i' 115 's' 32 ' ' 110 'n'
0x560aabe1d6c6: 117 'u' 108 'l' 108 'l' 112 'p' 116 't' 114 'r' 46 '.' 0 '\000'
0x560aabe1d6ce: 119 'w' 119 'w' 107 'k' 32 ' ' 112 'p' 108 'l' 97 'a' 121 'y'
0x560aabe1d6d6: 32 ' ' 115 's' 116 't' 114 'r' 101 'e' 97 'a' 109 'm' 0 '\000'
0x560aabe1d6de: 112 'p' 97 'a' 95 '_' 99 'c' 111 'o' 110 'n' 116 't' 101 'e'
0x560aabe1d6e6: 120 'x' 116 't' 95 '_' 110 'n' 101 'e' 119 'w' 95 '_' 119 'w'
0x560aabe1d6ee: 105 'i' 116 't' 104 'h' 95 '_' 112 'p' 114 'r' 111 'o' 112 'p'
0x560aabe1d6f6: 108 'l' 105 'i' 115 's' 116 't' 0 '\000' 112 'p' 97 'a' 95 '_'
0x560aabe1d6fe: 112 'p' 114 'r' 111 'o' 112 'p' 108 'l' 105 'i' 115 's' 116 't'
0x560aabe1d706: 95 '_' 103 'g' 101 'e' 116 't' 115 's' 0 '\000' 112 'p' 97 'a'
0x560aabe1d70e: 95 '_' 115 's' 97 'a' 109 'm' 112 'p' 108 'l' For solution, I add the wrapProgram $out/wechat/wechat \
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
libGL
udev
libpulseaudio
]
} And the |
Fixes #354234
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.