Created attachment 850012 [details, diff] prevents segafaults with uninitialized sets Patch in attachment prevents qmerge segfault with uninitialized _Q_ISET
can you explain how/where this caused a crash?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e2ebb44db31d4e0e9bfc0a9974d36eff63c8b2b1 commit e2ebb44db31d4e0e9bfc0a9974d36eff63c8b2b1 Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2023-02-07 08:08:13 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2023-02-07 08:08:13 +0000 set: ensure NULL is empty behaviour is retained throughout Not all set functions respected NULL is empty behaviour, changed add_set_value signature to return a set instead so it can conform. Bug: https://bugs.gentoo.org/893424 Signed-off-by: Fabian Groffen <grobian@gentoo.org> libq/set.c | 47 +++++++++++++++++++++++++++++++++++++++-------- libq/set.h | 4 ++-- libq/tree.c | 5 +++-- main.c | 6 ++++-- qkeyword.c | 6 +++--- qlop.c | 12 ++++++++---- 6 files changed, 59 insertions(+), 21 deletions(-)
Here's gdb output, minus some irrelevant info from the first `run` command. ``` (gdb) r ... (null)/usr/bin/qmerge(null): ignoring parent with unknown repo in profile profilename ... Program received signal SIGSEGV, Segmentation fault. contains_set (name=0x55555555ba12 "strict", q=0x0) at set.c:165 165 set.c: No such file or directory. (gdb) bt #0 contains_set (name=0x55555555ba12 "strict", q=0x0) at set.c:165 #1 0x0000555555577b2f in qmerge_main (argc=argc@entry=134, argv=argv@entry=0x7fffffffbda8) at qmerge.c:2027 #2 0x000055555556aa3a in q_main (argc=argc@entry=134, argv=argv@entry=0x7fffffffbda8) at q.c:116 #3 0x00005555555694d6 in main (argc=134, argv=0x7fffffffbda8) at main.c:1177 (gdb) list qmerge.c:2027 2022 2023 /* default to install if no action given */ 2024 if (!install && !uninstall) 2025 install = 1; 2026 2027 qmerge_strict = contains_set("strict", features) ? 1 : 0; 2028 2029 /* Short circut this. */ 2030 if (install && !pretend) { 2031 if (follow_rdepends && getenv("QMERGE") == NULL) { ``` So, at the following line: ``` 2027 qmerge_strict = contains_set("strict", features) ? 1 : 0; ``` `features` is NULL
ok, thanks, e2ebb44db31d4e0e9bfc0a9974d36eff63c8b2b1 addresses that
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fa248843038ffe79d7fce8b51e7f16c65667c7e commit 1fa248843038ffe79d7fce8b51e7f16c65667c7e Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2023-02-22 20:15:43 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2023-02-22 20:17:16 +0000 app-portage/portage-utils-0.95: version bump Closes: https://bugs.gentoo.org/893424 Closes: https://bugs.gentoo.org/892533 Closes: https://bugs.gentoo.org/885801 Signed-off-by: Fabian Groffen <grobian@gentoo.org> app-portage/portage-utils/Manifest | 2 +- .../portage-utils/portage-utils-0.94.1.ebuild | 67 ------------------- .../portage-utils/portage-utils-0.95.ebuild | 75 ++++++++++++++++++++++ 3 files changed, 76 insertions(+), 68 deletions(-)