Skip to content
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

runtime error on EOF when selecting package provider #2289

Closed
LogExE opened this issue Sep 20, 2023 · 0 comments · Fixed by #2333
Closed

runtime error on EOF when selecting package provider #2289

LogExE opened this issue Sep 20, 2023 · 0 comments · Fixed by #2333
Labels
Status: Confirmed Bug has been verified Type: Bug

Comments

@LogExE
Copy link

LogExE commented Sep 20, 2023

Affected Version

yay v12.1.3 - libalpm v13.0.2

Describe the bug

Yay panics when package provider is required by update, but user sends EOF to program.

Reproduction Steps

  1. Do yay -Syu
  2. When asked to choose provider for package that has received an update, respond with EOF (press Ctrl-D)
  3. Yay falls with "invalid memory address or nil pointer" error

Expected behavior

I think that this EOF case should be handled by the program to give a cleaner message for user

Output

[devoops@MS-7C02 ~]$ yay -Pg
{
	"aururl": "https://aur.archlinux.org",
	"aurrpcurl": "https://aur.archlinux.org/rpc?",
	"buildDir": "/home/devoops/.cache/yay",
	"editor": "",
	"editorflags": "",
	"makepkgbin": "makepkg",
	"makepkgconf": "",
	"pacmanbin": "pacman",
	"pacmanconf": "/etc/pacman.conf",
	"redownload": "no",
	"answerclean": "",
	"answerdiff": "",
	"answeredit": "",
	"answerupgrade": "",
	"gitbin": "git",
	"gpgbin": "gpg",
	"gpgflags": "",
	"mflags": "",
	"sortby": "votes",
	"searchby": "name-desc",
	"gitflags": "",
	"removemake": "ask",
	"sudobin": "sudo",
	"sudoflags": "",
	"version": "12.1.3",
	"requestsplitn": 150,
	"completionrefreshtime": 7,
	"maxconcurrentdownloads": 0,
	"bottomup": true,
	"sudoloop": false,
	"timeupdate": false,
	"devel": false,
	"cleanAfter": false,
	"provides": true,
	"pgpfetch": true,
	"cleanmenu": true,
	"diffmenu": true,
	"editmenu": false,
	"combinedupgrade": true,
	"useask": false,
	"batchinstall": false,
	"singlelineresults": false,
	"separatesources": true,
	"debug": false,
	"rpc": true,
	"doubleconfirm": true,
	"rebuild": "no"
}
[devoops@MS-7C02 ~]$ 
[devoops@MS-7C02 ~]$ yay -Syu --debug
[DEBUG:runner] running /usr/bin/sudo pacman --debug -S -y --config /etc/pacman.conf --
[sudo] password for devoops: 
debug: pacman v6.0.2 - libalpm v13.0.2
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: Architecture: auto
debug: config: arch: x86_64
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 76: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 82: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 603) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': https://de.arch.mirror.kescher.at/core/os/x86_64
debug: adding new server URL to database 'core': https://at.arch.mirror.kescher.at/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.theo546.fr/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://archlinux.mailtunnel.eu/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.sunred.org/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://london.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.f4st.host/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://archlinux.thaller.ws/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.ubrco.de/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://geo.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://europe.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://md.mirrors.hacktegic.com/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.telepoint.bg/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.ufscar.br/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.theash.xyz/arch/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.funami.tech/arch/core/os/x86_64
debug: adding new server URL to database 'core': https://america.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://asia.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://seoul.mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://sydney.mirror.pkgbuild.com/core/os/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 603) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': https://de.arch.mirror.kescher.at/extra/os/x86_64
debug: adding new server URL to database 'extra': https://at.arch.mirror.kescher.at/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.theo546.fr/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://archlinux.mailtunnel.eu/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.sunred.org/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://london.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.f4st.host/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://archlinux.thaller.ws/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.ubrco.de/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://geo.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://europe.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://md.mirrors.hacktegic.com/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.telepoint.bg/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.ufscar.br/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.theash.xyz/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.funami.tech/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': https://america.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://asia.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://seoul.mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://sydney.mirror.pkgbuild.com/extra/os/x86_64
:: Synchronizing package databases...
 core downloading...
 extra downloading...
debug: core.db: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db
debug: core.db: maxsize 134217728
debug: core.db: using time condition 1695213227
debug: core.db: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: core.db: curl returned result 0 from transfer
debug: core.db: response code 304
debug: core.db.sig: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db.sig
debug: core.db.sig: maxsize 16384
debug: core.db.sig: opened tempfile for download: /var/lib/pacman/sync/core.db.sig.part (wb)
debug: core.db: file met time condition
debug: core.db.sig: curl returned result 0 from transfer
debug: core.db.sig: response code 404
debug: core.db.sig: no more servers to retry
debug: extra.db: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db
debug: extra.db: maxsize 134217728
debug: extra.db: using time condition 1695217785
debug: extra.db: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: extra.db: curl returned result 0 from transfer
debug: extra.db: response code 304
debug: extra.db.sig: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db.sig
debug: extra.db.sig: maxsize 16384
debug: extra.db.sig: opened tempfile for download: /var/lib/pacman/sync/extra.db.sig.part (wb)
debug: extra.db: file met time condition
debug: extra.db.sig: curl returned result 0 from transfer
debug: extra.db.sig: response code 404
debug: extra.db.sig: no more servers to retry
debug: curl_download_internal return code is 0
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 603) : missing PGP signature
debug: missing optional signature
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 603) : missing PGP signature
debug: missing optional signature
debug: unregistering database 'local'
debug: unregistering database 'core'
debug: unregistering database 'extra'
[DEBUG:db] populating db executor package caches. sync_len 853 remote_len 9
:: Searching AUR for updates...
[DEBUG:runtime] packages to query [docker-rootless-extras gnome-shell-extension-blur-my-shell gnome-shell-extension-dash-to-dock gnome-shell-extension-rounded-window-corners hd-idle-go neovim-drop-in ttf-iosevka-ss07 visual-studio-code-bin yay]
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg%5B%5D=docker-rootless-extras&arg%5B%5D=gnome-shell-extension-blur-my-shell&arg%5B%5D=gnome-shell-extension-dash-to-dock&arg%5B%5D=gnome-shell-extension-rounded-window-corners&arg%5B%5D=hd-idle-go&arg%5B%5D=neovim-drop-in&arg%5B%5D=ttf-iosevka-ss07&arg%5B%5D=visual-studio-code-bin&arg%5B%5D=yay&type=info&v=5
[DEBUG:grapher] deps to find [gnome-shell]
[DEBUG:runtime] packages to query [gnome-shell]
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg%5B%5D=gnome-shell&type=info&v=5
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg=gnome-shell&by=provides&type=search&v=5
[DEBUG:runtime] packages to query [gnome-shell-git gnome-shell-mobile-git gnome-shell-oldstable gnome-shell-performance gnome-shell-performance gnome-shell-performance gnome-shell-screencast-vaapi gnome-shell-xrdesktop-git]
[DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?arg%5B%5D=gnome-shell-git&arg%5B%5D=gnome-shell-mobile-git&arg%5B%5D=gnome-shell-oldstable&arg%5B%5D=gnome-shell-performance&arg%5B%5D=gnome-shell-performance&arg%5B%5D=gnome-shell-performance&arg%5B%5D=gnome-shell-screencast-vaapi&arg%5B%5D=gnome-shell-xrdesktop-git&type=info&v=5
:: There are 6 providers available for gnome-shell<=44.6:
:: Repository AUR
    1) gnome-shell-git 2) gnome-shell-oldstable 3) gnome-shell-performance 4) gnome-shell-performance 5) gnome-shell-performance 6) gnome-shell-xrdesktop-git 

Enter a number (default=1): 
==>  -> EOF
 -> runtime error: invalid memory address or nil pointer dereferencegoroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x5e
main.main.func2()
	github.com/Jguer/yay/v12/main.go:125 +0x45
panic({0x561913b2c940?, 0x561913dd9680?})
	runtime/panic.go:914 +0x21f
github.com/Jguer/yay/v12/pkg/dep.(*Grapher).findDepsFromAUR(0xc00007f740, {0x561913b9bfb0, 0x561913e52440}, {0x561913b9ffd8, 0xc00030c480})
	github.com/Jguer/yay/v12/pkg/dep/dep_graph.go:556 +0x8ef
github.com/Jguer/yay/v12/pkg/dep.(*Grapher).addNodes(0xc00007f740, {0x561913b9bfb0, 0x561913e52440}, 0xc00019fdd0, {0xc0005b0060, 0x23}, {0xc000310330?, 0x1, 0x561913b7d6a0?}, 0x1)
	github.com/Jguer/yay/v12/pkg/dep/dep_graph.go:678 +0xe25invalid memory address or nil pointer dereferencegoroutine 
github.com/Jguer/yay/v12/pkg/dep.(*Grapher).addDepNodes(0xc00007f740, {0x561913b9bfb0, 0x561913e52440}, 0xc0004721c0, 0x561913b21220?)
	github.com/Jguer/yay/v12/pkg/dep/dep_graph.go:308 +0xbc
github.com/Jguer/yay/v12/pkg/dep.(*Grapher).AddDepsForPkgs(...)
	github.com/Jguer/yay/v12/pkg/dep/dep_graph.go:298
github.com/Jguer/yay/v12/pkg/upgrade.(*UpgradeService).upGraph(0xc00047fab8, {0x561913b9bfb0, 0x561913e52440}, 0xc00019fdd0, 0xe8?, 0x561913b95810)
	github.com/Jguer/yay/v12/pkg/upgrade/service.go:157 +0x987
github.com/Jguer/yay/v12/pkg/upgrade.(*UpgradeService).GraphUpgrades(0x561913b28300?, {0x561913b9bfb0?, 0x561913e52440?}, 0x1?, 0x40?, 0x0?)
	github.com/Jguer/yay/v12/pkg/upgrade/service.go:244 +0x11e
main.syncInstall({0x561913b9bfb0?, 0x561913e52440}, 0xc000192930, 0xc00019f8c0, {0x561913ba0288, 0xc0000b41b0})
	github.com/Jguer/yay/v12/sync.go:62 +0xc98
main.handleSync({0x561913b9bfb0, 0x561913e52440}, 0xc000192930, 0xc00019f8c0, {0x561913ba0288, 0xc0000b41b0})
	github.com/Jguer/yay/v12/cmd.go:367 +0x8e5
main.handleCmd({0x561913b9bfb0, 0x561913e52440}, 0xc000192930, 0xc00019f8c0, {0x561913ba0288?, 0xc0000b41b0?})
	github.com/Jguer/yay/v12/cmd.go:176 +0x345
main.main()
	github.com/Jguer/yay/v12/main.go:131 +0x6c9

[devoops@MS-7C02 ~]$ 
@Jguer Jguer added Status: Confirmed Bug has been verified and removed Status: Triage labels Oct 9, 2023
Jguer pushed a commit that referenced this issue Dec 11, 2023
This commit fixes #2289 by making
`provideMenu` returns the first option when it receives an error input
from the user (e.g. user sends EOF).

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed Bug has been verified Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants