1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="text-align:left; direction:ltr;">
<div>Ah, good. That might explain some of the weirdness I have seen :)</div>
<div><br>
</div>
<div>On Sat, 2019-11-09 at 11:29 +0100, grobian wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
Setting SLOT to "" isn't correct, I think. The code checks where it<br>
uses it that SLOT != NULL, so the correct fix is to not try to<br>
strdup(NULL). I've pushed this as ff773ed.<br>
<br>
You're right that qmerge should probably only look at the vdb at the<br>
point you're seeing this crash.<br>
<br>
Thanks,<br>
Fabian<br>
<br>
On 05-11-2019 08:46:32 +0000, J T wrote:<br>
<font color="#737373">> #2 0x10023024 in tree_get_atom (pkg_ctx=pkg_ctx@entry=0x10226660, complete=complete@entry=true) at tree.c:1017</font><br>
<font color="#737373">> 1017 pkg_ctx->slot = xstrdup(meta->SLOT);</font><br>
<font color="#737373">> (gdb) list</font><br>
<font color="#737373">> 1012 } else { /* metadata or ebuild */</font><br>
<font color="#737373">> 1013 if (pkg_ctx->atom->SLOT == NULL) {</font><br>
<font color="#737373">> 1014 if (pkg_ctx->slot == NULL) {</font><br>
<font color="#737373">> 1015 tree_pkg_meta *meta = tree_pkg_read(pkg_ctx);</font><br>
<font color="#737373">> 1016 if (meta != NULL) {</font><br>
<font color="#737373">> 1017 pkg_ctx->slot = xstrdup(meta->SLOT); XXXX meta->SLOT NULL here XXXX</font><br>
<font color="#737373">> 1018 pkg_ctx->slot_len = strlen(pkg_ctx->slot);</font><br>
<font color="#737373">> 1019 tree_close_meta(meta);</font><br>
<font color="#737373">> 1020 }</font><br>
<font color="#737373">> 1021 }</font><br>
<font color="#737373">> </font><br>
<font color="#737373">> meta->SLOT is null here when trying to qmerge -Oq sys-devel/binutils-2.32-r1:2.32</font><br>
<font color="#737373">> There reason is:</font><br>
<font color="#737373">> (gdb) print pkg_ctx->cat_ctx->ctx->cachetype</font><br>
<font color="#737373">> $24 = CACHE_EBUILD</font><br>
<font color="#737373">> and the ebuild for one of the searched pkg's(gcc) does not have SLOT define in its ebuild(appears to inherited)</font><br>
<font color="#737373">> so SLOT becomes NULL.</font><br>
<font color="#737373">> </font><br>
<font color="#737373">> One should protect from this, possibly by:</font><br>
<font color="#737373">> if (!meta->SLOT)</font><br>
<font color="#737373">> pkg_ctx->slot = xstrdup("");</font><br>
<font color="#737373">> </font><br>
<font color="#737373">> else</font><br>
<font color="#737373">> pkg_ctx->slot = xstrdup(meta->SLOT)</font><br>
<font color="#737373">> ...</font><br>
<font color="#737373">> which will avoid SEGV but lie about the true SLOT</font><br>
<font color="#737373">> </font><br>
<font color="#737373">> The bigger question is why CACHE_EBUILD here in qmerge?</font><br>
<font color="#737373">> Is not CACHE_VDB a better choice here?</font><br>
<font color="#737373">> </font><br>
<font color="#737373">> J </font><br>
<br>
</blockquote>
<div><br>
</div>
</body>
</html>
|