Why is running any gh cli command on my local machine causing a seg fault/goroutine error? - node.js

Running any gh cli command causes this error in my cli. I have uninstalled and reinstalled the gh cli, removed all node.js and npm from my machine, and neither of these things solve the issue.
(base) yamini#Yaminis-MacBook-Pro local % gh auth login
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1031c6580]
goroutine 1 [running]:
github.com/cli/go-gh/pkg/config.(*Config).Get(0x1038a3548?, {0x140007bfbd8?, 0x30?, 0x10488aea0?})
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/config/config.go:46 +0x30
github.com/cli/go-gh/pkg/browser.resolveLauncher()
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:75 +0x6c
github.com/cli/go-gh/pkg/browser.New(...)
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:32
github.com/cli/cli/v2/internal/browser.New({0x0, 0x0}, {0x1049098a0, 0x14000010018}, {0x1049098a0, 0x14000010020})
github.com/cli/cli/v2/internal/browser/browser.go:14 +0x58
github.com/cli/cli/v2/pkg/cmd/factory.newBrowser(0x140003bfdc0?)
github.com/cli/cli/v2/pkg/cmd/factory/default.go:111 +0x50
github.com/cli/cli/v2/pkg/cmd/factory.New({0x10477ac48, 0x6})
github.com/cli/cli/v2/pkg/cmd/factory/default.go:37 +0x238
main.mainRun()
github.com/cli/cli/v2/cmd/gh/main.go:64 +0xec
main.main()
github.com/cli/cli/v2/cmd/gh/main.go:48 +0x1c
(base) yamini#Yaminis-MacBook-Pro local % gh repo create
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1031fa580]
goroutine 1 [running]:
github.com/cli/go-gh/pkg/config.(*Config).Get(0x1038d7548?, {0x1400085fbd8?, 0x30?, 0x1048beea0?})
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/config/config.go:46 +0x30
github.com/cli/go-gh/pkg/browser.resolveLauncher()
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:75 +0x6c
github.com/cli/go-gh/pkg/browser.New(...)
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:32
github.com/cli/cli/v2/internal/browser.New({0x0, 0x0}, {0x10493d8a0, 0x140001aa008}, {0x10493d8a0, 0x140001aa010})
github.com/cli/cli/v2/internal/browser/browser.go:14 +0x58
github.com/cli/cli/v2/pkg/cmd/factory.newBrowser(0x140000fdce0?)
github.com/cli/cli/v2/pkg/cmd/factory/default.go:111 +0x50
github.com/cli/cli/v2/pkg/cmd/factory.New({0x1047aec48, 0x6})
github.com/cli/cli/v2/pkg/cmd/factory/default.go:37 +0x238
main.mainRun()
github.com/cli/cli/v2/cmd/gh/main.go:64 +0xec
main.main()
github.com/cli/cli/v2/cmd/gh/main.go:48 +0x1c
i get the same error with any cli command, not just auth. for example, gh repo create:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100622580]
goroutine 1 [running]:
github.com/cli/go-gh/pkg/config.(*Config).Get(0x100cff548?, {0x140007dfbd8?, 0x30?, 0x101ce6ea0?})
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/config/config.go:46 +0x30
github.com/cli/go-gh/pkg/browser.resolveLauncher()
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:75 +0x6c
github.com/cli/go-gh/pkg/browser.New(...)
github.com/cli/go-gh#v0.1.1-0.20220817122932-3630ab390fe7/pkg/browser/browser.go:32
github.com/cli/cli/v2/internal/browser.New({0x0, 0x0}, {0x101d658a0, 0x140001aa008}, {0x101d658a0, 0x140001aa010})
github.com/cli/cli/v2/internal/browser/browser.go:14 +0x58
github.com/cli/cli/v2/pkg/cmd/factory.newBrowser(0x140000f7ce0?)
github.com/cli/cli/v2/pkg/cmd/factory/default.go:111 +0x50
github.com/cli/cli/v2/pkg/cmd/factory.New({0x101bd6c48, 0x6})
github.com/cli/cli/v2/pkg/cmd/factory/default.go:37 +0x238
main.mainRun()
github.com/cli/cli/v2/cmd/gh/main.go:64 +0xec
main.main()
github.com/cli/cli/v2/cmd/gh/main.go:48 +0x1c

This is a segfault and almost all segfaults on working hardware are bugs (in some software). It looks like there's some issue in gh that prevents it from initializing its configuration object properly, and then it tries to dereference an invalid pointer.
You should open an issue at https://github.com/cli/cli, filling out the issue template and explaining anything you've done that might be relevant. For example, if your repository is missing its .git/config file, or you do (or don't) have any unusual configuration settings, you should mention those.

Related

virt-manager install aborting due to memory

Running Linux 5.16.10-arch1-1 #1 SMP PREEMPT Wed, 16 Feb 2022 19:35:18
Been trying my hand at setting up a Windows 10 virtual machine through virt-manager utilizing QEMU and KVM, and I've run into quite a fair bit of trouble in the process. This error message appears when clicking "Begin Installation":
internal error: qemu unexpectedly closed the monitor: 2022-02-21T14:05:58.222051Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T14:05:58.222249Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T14:05:58.222327Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55ce3e4e7d80, 0x0, 0x80000000, 0x7f46abe00000) = -12 (Cannot allocate memory)
I'm not particularly experienced with Linux or its derivatives (I'm starting with EndeavourOS, which I freshly installed yesterday) but I am somewhat tech savvy, so I have made several attempts to fix this. However, all of the similar issues and solutions I found online after running out of ideas provided me no reprieve.
This does also include frequently reading, re-reading and testing concepts provided by the Arch Linux wiki itself. I've ensured that IOMMU is properly enabled and configured. My GPU (gtx 1080) is completely isolated and has been bound to vfio-pci, libvirt has been configured, access permission for /dev/vfio/1 has been granted as needed, I've edited /etc/pam.d/sudo and changed permissions for /etc/libvirt/qemu.conf. Unless I am hilariously misinformed, none of that is the cause of this issue.
I've been largely unsuccessful in finding and fixing the cause of this error message. I have changed hard and soft ram limits and tried many different values for memory allocation (2048, 4096, 8192, 12288) and none have made any difference in the error message.
I don't know what logs or outputs would be beneficial to attach, so please feel free to request any that you would need and I will provide them to the best of my ability.
Edit 1
Realized it would probably be a good idea to post the entire error log. Here it is:
Unable to complete install: 'internal error: qemu unexpectedly closed the monitor: 2022-02-21T19:36:08.149009Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150079Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150300Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55d714ea5a30, 0x0, 0x80000000, 0x7fa233e00000) = -12 (Cannot allocate memory)'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
installer.start_install(guest, meter=meter)
File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
domain = self._create_guest(
File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python3.10/site-packages/libvirt.py", line 4400, in createXML
raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2022-02-21T19:36:08.149009Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150079Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: VFIO_MAP_DMA failed: Cannot allocate memory
2022-02-21T19:36:08.150300Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.4,addr=0x0: vfio 0000:01:00.0: failed to setup container for group 1: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55d714ea5a30, 0x0, 0x80000000, 0x7fa233e00000) = -12 (Cannot allocate memory)

node-rdkafka is throwing segmentation fault

I am trying to migrate the Kafka library being used in my application from kafka-node to node-rdkafka. My application is running on EC2 with Ubuntu 14 version and the node version is 12.14.0. I have tried two version's of node-rdkafka (2.10.0 & 2.10.1). Both the versions are throwing segmentation fault while deployment.
This is the error I am getting in gdb
Thread 16 "rdk:broker-1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffce7fc700 (LWP 32445)]
0x00007fffdd81ba9b in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
What could be the possible cause for this issue?

Need help resolving segfault in libc-2.23.so

Need help debugging shared library with gdb.
I am trying to debug a shared library and in my case it is:
libc-2.23.so
The reason is that I get theese lines in dmesg:
[10081.433266] compiz[11346]: segfault at 7f30a4100010 ip 00007f309c36f44b sp 00007ffdde303aa0 error 4 in libc-2.23.so[7f309c2f1000+1bf000]
[22005.764635] compiz[16149]: segfault at 7f30e3456db0 ip 00007f30db85044b sp 00007fffaab9c0a0 error 4 in libc-2.23.so[7f30db7d2000+1bf000]
[48777.031064] compiz[25203]: segfault at 7f0b8e23b050 ip 00007f0b87edf44b sp 00007ffd51d15740 error 4 in libc-2.23.so[7f0b87e61000+1bf000]
[78850.413793] compiz[4889]: segfault at 7f60ddbf2440 ip 00007f60d598944b sp 00007ffedc5e31b0 error 4 in libc-2.23.so[7f60d590b000+1bf000]
[84583.754783] compiz[8441]: segfault at 7f5f8c3930c0 ip 00007f5f871d544b sp 00007ffc436bb5a0 error 4 in libc-2.23.so[7f5f87157000+1bf000]
[100625.457854] compiz[15619]: segfault at 7ffffa967680 ip 00007ffff722844b sp 00007fffffffdad0 error 4 in libc-2.23.so[7ffff71aa000+1bf000]
[104234.596331] compiz[19076]: segfault at 7ffffa2dc540 ip 00007ffff722844b sp 00007fffffffd810 error 4 in libc-2.23.so[7ffff71aa000+1bf000]
[112314.238115] compiz[22152]: segfault at 7ffffe232760 ip 00007ffff722844b sp 00007fffffffd810 error 4 in libc-2.23.so[7ffff71aa000+1bf000]
[130828.195732] compiz[26013]: segfault at 7ffffa966180 ip 00007ffff722844b sp 00007fffffffdad0 error 4 in libc-2.23.so[7ffff71aa000+1bf000]
[225379.026592] compiz[19275]: segfault at 7ffff821b6d0 ip 00007ffff722844b sp 00007fffffffd7c0 error 4 in libc-2.23.so[7ffff71aa000+1bf000]
The address where libc-2.23.so is loaded does not change after time stamp 100625.457854 since I ran the command:
$ echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
In order to be able to load it under gdb.
What I have done so far is that I have established that the segfault always occur on the same offset from the shared librarys loaded address.
I calculated the offset by taking instruction pointer minus load address in python:
ld = ["7f309c2f1000", "7f30db7d2000", "7f0b87e61000", "7f60d590b000", "7f5f87157000", "7ffff71aa000"]
ip = ["7f309c36f44b", "7f30db85044b", "7f0b87edf44b", "7f60d598944b", "7f5f871d544b", "7ffff722844b"]
ld_val = [int(x,16) for x in ld]
ip_val=[int(x,16) for x in ip]
ip_off=[i-s for (i,s) in zip(ip_val,ld_val)]
ip_off
[517195, 517195, 517195, 517195, 517195, 517195]
So using this information I got the offending line from executing:
$ addr2line -e /lib/x86_64-linux-gnu/libc-2.23.so -fCi 0x7e44b
malloc_consolidate
/build/glibc-9tT8Do/glibc-2.23/malloc/malloc.c:4167
Since I run Ubuntu 16.04 I installed the sources by issuing:
$ apt-get source glibc-source
Inspecting the offending line showed that it was just a comment.
malloc.c:4167
/* Slightly streamlined version of consolidation code in free() */
inside function:
static void malloc_consolidate(mstate av)
So I am assuming I am doing something wrong here.
Any pointer on how to capture this "segfault"?
So I am assuming I am doing something wrong here.
You aren't.
The symptoms you are looking at are 99.999% result of heap corruption, and since this is happening in compiz, there is little you can do except file a bug report.
To make a useful bug report, it would help if you could run compiz under Valgrind. Running it under GDB will not help.
I had gdb loaded with the library and breakpoint on line 4167 but no break even if I got a new entry in dmesg.
That means you are debugging the wrong process. Perhaps compiz forks helper processes, and one of them dies?

Can't compile Wine under Windows

I need to compile wine dlls under windows for debug purposes.
I installed cygwin, downloaded wine and run "./configure", then following error appears. I am completely new to Linux environment, so I can even understand what it does mean.
./configure: fork: retry: Resource temporarily unavailable
261414951 [main] sh 1368 fhandler_dev_zero::fixup_mmap_after_fork: requested 0x7E6E0000 != 0x0 mem alloc base 0x0, state 0x10000, size 524288, Win32 error 487
261415207 [main] sh 1368 C:\cygwin\bin\sh.exe: *** fatal error in forked process - recreate_mmaps_after_fork_failed
261415593 [main] sh 1368 open_stackdumpfile: Dumping stack trace to sh.exe.stackdump
As per Cygwin wiki, errors related to fork() are usually solved by rebasing.
Stop all Cygwin services; open a command prompt & issue:
\cygwin\bin\dash -c '/usr/bin/rebaseall'

error for gdbserver

Anybody knows the error message?
gdbserver[949] segfault at 81c ip 0000081c sp bfeef918 error 4 in gdbserver [8048000+1c0000]
segmentation fault
Thanks,
The error message (presumably from /var/log/messages) means that gdbserver crashed (received SIGSEGV).
I think it happened at instruction 0x81c, which likely means that it called a function though bad function pointer.

Resources