From: Martin Jansa Date: Wed, 19 Sep 2012 17:40:52 +0000 (+0200) Subject: opkg: add patch to fix SIGSEGV when printing status file X-Git-Tag: rev_ivi_2015_02_04~15454 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df839aa6013400dbafe7c7f032501a9282af3c32;p=scm%2Fbb%2Ftizen-distro.git opkg: add patch to fix SIGSEGV when printing status file * it was triggered by c02364f36e228835ea5d7fd4e1d347fd451f8544 when new package had 2 entries in Provides and old version just 1 (From OE-Core rev: d98d6ec9425bd8764405c9812cddfcfd2a2b025b) Signed-off-by: Martin Jansa Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch b/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch new file mode 100644 index 0000000..f1be7b8 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch @@ -0,0 +1,49 @@ +From 3340b120909ea353440cfffe01fed43c55387a00 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Wed, 19 Sep 2012 17:31:45 +0200 +Subject: [PATCH 7/7] merge newpkg->provides even when oldpkg->provides + existed + +* introduced in http://code.google.com/p/opkg/source/diff?spec=svn277&r=277&format=side&path=/trunk/libopkg/pkg.c +* the problem happens when oldpkg provide 1 and newpkg provide 2 + provides_count is merged to 2, but oldpkg->provides has only 1 entry + causing SIGSEGV: + pkg_formatted_field (fp=fp@entry=0x1444ce0, pkg=pkg@entry=0x120c620, field=, field@entry=0x7ffff7bd2abe "Provides") at pkg.c:739 + 739 fprintf(fp, "%s %s", i == 1 ? "" : ",", + (gdb) bt + #0 pkg_formatted_field (fp=fp@entry=0x1444ce0, pkg=pkg@entry=0x120c620, field=, field@entry=0x7ffff7bd2abe "Provides") at pkg.c:739 + #1 0x00007ffff7bc32fc in pkg_print_status (pkg=0x120c620, file=0x1444ce0) at pkg.c:887 + #2 0x00007ffff7bbff59 in opkg_conf_write_status_files () at opkg_conf.c:400 + #3 0x00007ffff7bbad8a in write_status_files_if_changed () at opkg_cmd.c:65 + #4 0x00007ffff7bbb73e in opkg_upgrade_cmd (argc=, argv=) at opkg_cmd.c:577 + #5 0x00007ffff7bbbcc2 in opkg_cmd_exec (cmd=cmd@entry=0x7ffff7dda080, argc=argc@entry=1, argv=argv@entry=0x7fffffffe768) at opkg_cmd.c:1319 + #6 0x000000000040165f in main (argc=3, argv=0x7fffffffe758) at opkg-cl.c:377 + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=93 + +Signed-off-by: Martin Jansa +--- + libopkg/pkg.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index be486ee..255c673 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -377,10 +377,8 @@ pkg_merge(pkg_t *oldpkg, pkg_t *newpkg) + oldpkg->provides_count = newpkg->provides_count; + newpkg->provides_count = 0; + +- if (!oldpkg->provides) { +- oldpkg->provides = newpkg->provides; +- newpkg->provides = NULL; +- } ++ oldpkg->provides = newpkg->provides; ++ newpkg->provides = NULL; + } + + if (!oldpkg->conflicts_count) { +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb index 03ed103..9a03f2e 100644 --- a/meta/recipes-devtools/opkg/opkg_svn.bb +++ b/meta/recipes-devtools/opkg/opkg_svn.bb @@ -7,6 +7,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ file://0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch \ file://0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch \ file://0006-detect-circular-dependencies.patch \ + file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ " S = "${WORKDIR}/trunk" @@ -14,4 +15,4 @@ S = "${WORKDIR}/trunk" SRCREV = "633" PV = "0.1.8+svnr${SRCPV}" -PR = "${INC_PR}.2" +PR = "${INC_PR}.3"