niner [Tue, 8 Feb 2022 17:10:54 +0000 (18:10 +0100)]
Fix segfault on conflict resolution when using bindings
Solutionelement objects were created with a wrong solutionid (i.e. the
solution element id was used for the solutionid field). This led to invalid
array indexes when trying to read the extraflags which then escalated
into a segfault. Fix by setting solutionid correctly in the Solutionelement
constructor.
Try to keep packages from a cycle close togther in the transaction order
If there are multiple free-to-install packages and we pick a
package from a cycle, we should try to finish the cycle as
fast as possible to keep the time where we have an inconsistent
system as small as possible.
For some reason libxml2 insists on re-escaping '&' characters
by substituting them with "&". The rpm dependencies are
stored in attributes, so this is not an academic matter.
Undo the damage done by libxml2 by replacing all & occurences
by a single '&'.
Transcode ptfdep- dependency in ptf packages to complex requires
The rpm package in SLE-12 does not understand complex dependencies,
so we have to encode them as provides and transcode them when we
parse the package metadata.
Thomas Lam [Tue, 30 Mar 2021 12:33:52 +0000 (05:33 -0700)]
Fix segfault in resolve_jobrules
In selectandinstall sometimes rules are added and a realloc is required if there's
no more memory available in the allocated block. r-- would just decrement the old
pointer but the realloc could return a completely different block of memory
testcase_read: error out if repos are added or the system is changed too late
We must not add new solvables after the considered map was created, the solver
was created, or jobs were added. We may not changed the system after jobs have
been added.
(Jobs may point inside the whatproviedes array, so we must not invalidate this
area.)
Add experimental support for self-destruct packages
Self-destruct packages will not be part of the transaction. But
they still will obsolete packages, thus updating to a self-destruct
package will lead to the erasure of the old package.
This will be used in SUSE's ptf packages and also to retract
released updates. The idea is that it is not possible to pull in
a blacklisted package via a dependency, they can only be installed
by a job that directly addresses them (the SETEVR bit is set).
Pekka Vuorela [Mon, 21 Jan 2019 14:45:04 +0000 (16:45 +0200)]
Fix repo2solv to work with Busybox find tool
Busybox find got quite confused by "." as arg0. Added a new instance of
dot as first real parameter as I could assume that being the original
intention.
Jaroslav Rohel [Tue, 11 Dec 2018 09:27:15 +0000 (10:27 +0100)]
Fix: testsolv segfaults
ERROR: AddressSanitizer: SEGV on unknown address 0x0000000002f0 (pc 0x7f31501d3bd2 bp 0x7ffcfe4d4a50 sp 0x7ffcfe4d4a30 T0)
0 0x7f31501d3bd1 in pool_whatprovides /home/company/real_sanitize/libsolv-master/src/pool.h:331
1 0x7f31501d895e in testcase_str2solvid /home/company/real_sanitize/libsolv-master/ext/testcase.c:793
2 0x7f31501e8388 in testcase_read /home/company/real_sanitize/libsolv-master/ext/testcase.c:2807
3 0x402aa5 in main /home/company/real_sanitize/libsolv-master/tools/testsolv.c:148
4 0x7f314fa8da3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
5 0x401bb8 in _start (/home/company/real_sanitize/libsolv-master/build/install/bin/testsolv+0x401bb8)
ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5af9e7815f bp 0x7ffc4c843a40 sp 0x7ffc4c8436c0 T0)
0 0x7f5af9e7815e in testcase_read /home/company/real_sanitize/libsolv-master/ext/testcase.c:2799
1 0x402aa5 in main /home/company/real_sanitize/libsolv-master/tools/testsolv.c:148
2 0x7f5af971da3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
3 0x401bb8 in _start (/home/company/real_sanitize/libsolv-master/build/install/bin/testsolv+0x401bb8)
Jaroslav Rohel [Tue, 11 Dec 2018 09:22:09 +0000 (10:22 +0100)]
Fix: testsolv segfault
ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fab0e11bf2b bp 0x7ffdfc044b70 sp 0x7ffdfc044a90 T0)
0 0x7fab0e11bf2a in testcase_str2dep_complex /home/company/real_sanitize/libsolv-master/ext/testcase.c:577
1 0x7fab0e11c80f in testcase_str2dep /home/company/real_sanitize/libsolv-master/ext/testcase.c:656
2 0x7fab0e12e64a in testcase_read /home/company/real_sanitize/libsolv-master/ext/testcase.c:2952
3 0x402aa5 in main /home/company/real_sanitize/libsolv-master/tools/testsolv.c:148
4 0x7fab0d9d2a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
5 0x401bb8 in _start (/home/company/real_sanitize/libsolv-master/build/install/bin/testsolv+0x401bb8)
Denis Ollier [Thu, 9 Aug 2018 21:05:04 +0000 (23:05 +0200)]
Fix out of bounds compilation warning
When compiling with -D_FORTIFY_SOURCE=2, gcc raises the following
warning:
In file included from /usr/include/string.h:494,
from /build/libsolv/src/libsolv-0.6.35/src/policy.c:16:
In function ‘memcpy’,
inlined from ‘urpm_reorder.isra.18’ at /build/libsolv/src/libsolv-0.6.35/src/policy.c:1239:9:
/usr/include/bits/string_fortified.h:34:10: warning: ‘__builtin_memcpy’ forming offset 8 is out of the bounds [0, 7] [-Warray-bounds]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first memcpy copies 8 bytes whereas the string "kernel" as only 7
bytes. It does not have serious consequence since the second memcpy
overwrites the unwanted byte. Anyway, it is better to fix it.
lastarch is no longer the last element of id2arch, but now the
size of the array. This means that lastarch == 0 now reliable means
that no architecture was set.
To be compatible to old versions we over-allocate id2arch so that
id2arch[lastarch] is always zero.
There's also a new pool_arch2score function that abstracts accessing
the id2arch array.