RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/rpmdb/ header.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 09 Dec 2007 - 17:32:15 CET
Message-Id: <F4366C33-1E59-4AEE-A1B9-05FD9F016134@mac.com>
This patch certainly needs some explanation.

The "devtool standalone testdrive" segfault is gonna take
a few iterations to resolve, mostly because I don't yet
have a reliable reproducer (yes I do have access to _A_ reproducer
thanks to Ralf, but ...)

When I looked at the segfault on Friday, the first thing I did was to  
add
a fprintf ==> segfault went away. I hate those sorts of bugs ...

Eventually, through trial and error, I found that calling (void)  
tagName(tag)
(or not), avoided (or showed) the segfault.

Note the careful wording, I have not said "solved". Nor do I have any
plausible explanation for why calling tagName(tag) should affect
segfault behavior.

The problem has disappeared and reappeared several times already.

The current explanation (from Ralf) is here in the TODO list:
   o to be resolved before RPM 5.0b2:
     - jbj: HEAD segfaults under "devtool standalone"'s test-drive as it
            builds RPM with prefix="/tmp/rpm" (see line 309 in
            devtool.conf). When one uses a longer prefix, e.g.
            prefix="/tmp/rpm-xxx", the segfault disappears!!!

While I'm willing to believe that explanantion as well as any other,
I cannot yet see a compelling explanation with explicit mechanism
that guarantees the problem has really really really been fixed no
matter what other issues correlate with the segfault.

Anyways, if you are using "devtool standalone testdrive", and see the
segfault, and try the simpler reproducer
     rpmbuild -vv --macros=macros -ba devtool-test.spec
I'd like you to try adding "--hdrdebug" to see if the segfault goes  
away.

That's what this otherwise insanely nonsensical patch adds to rpm.

73 de Jeff


On Dec 9, 2007, at 11:18 AM, Jeff Johnson wrote:

>   RPM Package Manager, CVS Repository
>   http://rpm5.org/cvs/
>    
> ______________________________________________________________________ 
> ______
>
>   Server: rpm5.org                         Name:   Jeff Johnson
>   Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
>   Module: rpm                              Date:   09-Dec-2007  
> 17:18:20
>   Branch: HEAD                             Handle: 2007120916182000
>
>   Modified files:
>     rpm                     CHANGES
>     rpm/rpmdb               header.c
>
>   Log:
>     - jbj: add debugging hack to test a hypothesis re rpm-5.0beta1
>     segfault.
>
>   Summary:
>     Revision    Changes     Path
>     1.1968      +1  -0      rpm/CHANGES
>     1.142       +4  -1      rpm/rpmdb/header.c
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/CHANGES
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.1967 -r1.1968 CHANGES
>   --- rpm/CHANGES	9 Dec 2007 14:46:36 -0000	1.1967
>   +++ rpm/CHANGES	9 Dec 2007 16:18:20 -0000	1.1968
>   @@ -1,4 +1,5 @@
>    5.0a4 -> 5.0b1:
>   +    - jbj: add debugging hack to test a hypothesis re  
> rpm-5.0beta1 segfault.
>        - jbj: Leopard claims to have functional stat64. Let's find  
> out ...
>        - rpm.org: Yet More RPMRC_OK returns from functions.
>        - rpm.org: use RPMRC_OK, not 0, returns in many functions.
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/rpmdb/header.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.141 -r1.142 header.c
>   --- rpm/rpmdb/header.c	8 Dec 2007 18:09:32 -0000	1.141
>   +++ rpm/rpmdb/header.c	9 Dec 2007 16:18:20 -0000	1.142
>   @@ -1746,8 +1746,11 @@
>    	he->p.ptr = p.ptr;
>    	he->c = langNum + 1;
>    /*@-compmempass@*/
>   -	return headerAddEntry(h, he);
>   +	xx = headerAddEntry(h, he);
>    /*@=compmempass@*/
>   +/* XXX Add debugging hackery to test a hypothesis re  
> rpm-5.0beta1 segfault. */
>   +if (_hdr_debug) (void) tagName(tag);
>   +	return xx;
>        } else if (langNum >= entry->info.count) {
>    	ghosts = langNum - entry->info.count;
>    	
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Sun Dec 9 17:32:52 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.