* [PATCH 0/1] V2: Fix rpm2cpio segment fault @ 2013-04-15 3:17 Kang Kai 2013-04-15 3:17 ` [PATCH 1/1] rpm: fix rpm2cpio segmentation fault Kang Kai 2013-04-15 3:21 ` [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai 0 siblings, 2 replies; 3+ messages in thread From: Kang Kai @ 2013-04-15 3:17 UTC (permalink / raw) To: mark.hatle; +Cc: openembedded-core Hi Mark, As my last mail on Apr 12 mentioned, not only macro "_dbpath" need to be defined. Macros "_dbi_config*" are needed too, and they can't be simply assigned some value. I think parse config files first could be a workaround to fix rpm2cpio segment fault error for now. Thanks, Kai The following changes since commit 4c02dd5f6432c6e683a57d47b610f56433e9ca0d: kern-tools: fix conditional configuration items (2013-04-11 08:27:41 +0100) are available in the git repository at: git://git.pokylinux.org/poky-contrib kangkai/rpm2cpio-segfault http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/rpm2cpio-segfault Kang Kai (1): rpm: fix rpm2cpio segmentation fault .../rpm/rpm/rpm2cpio-fix-segmentation-fault.patch | 28 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm_5.4.9.bb | 1 + 2 files changed, 29 insertions(+), 0 deletions(-) create mode 100644 meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch -- 1.7.5.4 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] rpm: fix rpm2cpio segmentation fault 2013-04-15 3:17 [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai @ 2013-04-15 3:17 ` Kang Kai 2013-04-15 3:21 ` [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai 1 sibling, 0 replies; 3+ messages in thread From: Kang Kai @ 2013-04-15 3:17 UTC (permalink / raw) To: mark.hatle; +Cc: openembedded-core When run rpm2cpio, it fails with segmentation fault. The root cause is no macros "_db_path" and "_dbi_config*" defined, when query these macros get nothing then cause segment fault. Add patch to parse macro files first to fix this problem. [YOCTO #3656] Signed-off-by: Kang Kai <kai.kang@windriver.com> --- .../rpm/rpm/rpm2cpio-fix-segmentation-fault.patch | 28 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm_5.4.9.bb | 1 + 2 files changed, 29 insertions(+), 0 deletions(-) create mode 100644 meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch diff --git a/meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch b/meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch new file mode 100644 index 0000000..a99769a --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch @@ -0,0 +1,28 @@ +Upstream-Status: Pending + +rpm2cpio fails on target with "Segmentation fault". Because macros +"_dbpath" and "_dbi_config*" need to be defined, otherwise query these +macros will cause segment fault. + +Parse config files first to fix this bug. If parse fails, give a warning. + +[YOCTO #3656] + +Signed-off-by: Kang Kai <kai.kang@windriver.com> + +--- rpm-5.4.9/tools/rpm2cpio.c.orig 2013-04-15 10:35:14.269398890 +0800 ++++ rpm-5.4.9/tools/rpm2cpio.c 2013-04-15 10:44:12.777417885 +0800 +@@ -87,6 +87,13 @@ + #endif + (void) rpmtsSetVSFlags(ts, vsflags); + ++ /* If macros "_dbpath" and "_dbi_config*" are not defined, ++ * sigment fault occurs */ ++ rc = rpmReadConfigFiles(NULL, NULL); ++ if (rc) { ++ fprintf(stderr, _("Read RPM config files failed, that may cause sigment fault.\n")); ++ } ++ + /*@-mustmod@*/ /* LCL: segfault */ + rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h); + /*@=mustmod@*/ diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb index 7d2cba4..1defc78 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb @@ -86,6 +86,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;ex file://rpm-platform2.patch \ file://rpm-remove-sykcparse-decl.patch \ file://debugedit-segv.patch \ + file://rpm2cpio-fix-segmentation-fault.patch \ " # Uncomment the following line to enable platform score debugging -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] V2: Fix rpm2cpio segment fault 2013-04-15 3:17 [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai 2013-04-15 3:17 ` [PATCH 1/1] rpm: fix rpm2cpio segmentation fault Kang Kai @ 2013-04-15 3:21 ` Kang Kai 1 sibling, 0 replies; 3+ messages in thread From: Kang Kai @ 2013-04-15 3:21 UTC (permalink / raw) To: openembedded-core On 2013年04月15日 11:17, Kang Kai wrote: > Hi Mark, > > As my last mail on Apr 12 mentioned, not only macro "_dbpath" need to be defined. Macros "_dbi_config*" are needed too, and they can't be simply assigned some value. > > I think parse config files first could be a workaround to fix rpm2cpio segment fault error for now. Update: If parse config files fails, just give warning. > > Thanks, > Kai > > > The following changes since commit 4c02dd5f6432c6e683a57d47b610f56433e9ca0d: > > kern-tools: fix conditional configuration items (2013-04-11 08:27:41 +0100) > > are available in the git repository at: > git://git.pokylinux.org/poky-contrib kangkai/rpm2cpio-segfault > http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/rpm2cpio-segfault > > Kang Kai (1): > rpm: fix rpm2cpio segmentation fault > > .../rpm/rpm/rpm2cpio-fix-segmentation-fault.patch | 28 ++++++++++++++++++++ > meta/recipes-devtools/rpm/rpm_5.4.9.bb | 1 + > 2 files changed, 29 insertions(+), 0 deletions(-) > create mode 100644 meta/recipes-devtools/rpm/rpm/rpm2cpio-fix-segmentation-fault.patch > -- Regards, Neil | Kai Kang ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-15 3:36 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-04-15 3:17 [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai 2013-04-15 3:17 ` [PATCH 1/1] rpm: fix rpm2cpio segmentation fault Kang Kai 2013-04-15 3:21 ` [PATCH 0/1] V2: Fix rpm2cpio segment fault Kang Kai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox