Bug 11282 - FAIL: RUNTIME1 was cached
Summary: FAIL: RUNTIME1 was cached
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Wenji Huang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-14 21:05 UTC by Mark Wielaard
Modified: 2010-02-17 02:18 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2010-02-14 21:05:58 UTC
The following tests fails:

Running /home/mark/src/systemtap/testsuite/systemtap.base/cache.exp ...
[...]
Pass 1: parsed user script and 65 library script(s) using 84412virt/20504res/253
2shr kb, in 180usr/10sys/188real ms.
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) usin
g 84808virt/21224res/2844shr kb, in 10usr/0sys/7real ms.
/usr/local/build/systemtap-obj/testsuite/.cache_test-root/cache/1f/stap_1f0a2a26
f9b907ea079e260f1d342d60_77.ko
Pass 3: using cached /usr/local/build/systemtap-obj/testsuite/.cache_test-root/c
ache/1f/stap_1f0a2a26f9b907ea079e260f1d342d60_77.c
Pass 4: using cached /usr/local/build/systemtap-obj/testsuite/.cache_test-root/c
ache/1f/stap_1f0a2a26f9b907ea079e260f1d342d60_77.ko
FAIL: RUNTIME1 was cached

Since the following commit:

commit 0d1ad607311857dc0b4666ce8a84c1a59c615ab9
Author: Wenji Huang <wenji.huang@oracle.com>
Date:   Wed Feb 3 10:21:24 2010 +0800

    PR9931: generate log to help diagnosing occasional cache hash collisions
    
    Ideas from Frank Ch. Eigler:
    - extending the hash.add() function to pass names along with the
      hash-mix values, so that class hash can internally track the
      hash-report string
    - storing the reports themselves in the cache, beside the .ko / .c
      files, and changing the cache-size-limit logic to delete
      these .txt files upon garbage collection
    
    * hash.h : New member parm_stream.
    * hash.cxx (get_parms): New function to convert parms stream to string.
      (hash::add): Aggregrate parms stream.
      (create_hash_log): New function to log hash operation.
      (find_*_hash): Log hash at the end of function.
    * cache.cxx (clean_cache): Remove log when cache reaches limitation.
Comment 1 Josh Stone 2010-02-16 05:20:06 UTC
This is because the new hash copy constructor is restarting the md4 computation,
so everything from get_base_hash is lost.  We should be copying the md4 state
instead.

diff --git a/hash.h b/hash.h
index 173f8e5..0c1a745 100644
--- a/hash.h
+++ b/hash.h
@@ -19,7 +19,7 @@ private:
 
 public:
   hash() { start(); }
-  hash(const hash &base) { start(); parm_stream << base.parm_stream.str();}
+  hash(const hash &base) { md4 = base.md4; parm_stream << base.parm_stream.str(); }
 
   void start();
 
Comment 2 Wenji Huang 2010-02-17 01:30:06 UTC
(In reply to comment #1)
> This is because the new hash copy constructor is restarting the md4 computation,
> so everything from get_base_hash is lost.  We should be copying the md4 state
> instead.
Sorry, I missed that.

> 
> diff --git a/hash.h b/hash.h
> index 173f8e5..0c1a745 100644
> --- a/hash.h
> +++ b/hash.h
> @@ -19,7 +19,7 @@ private:
>  
>  public:
>    hash() { start(); }
> -  hash(const hash &base) { start(); parm_stream << base.parm_stream.str();}
> +  hash(const hash &base) { md4 = base.md4; parm_stream <<
base.parm_stream.str(); }

Thank Josh.
Please commit the patch. 
Comment 3 Josh Stone 2010-02-17 02:18:41 UTC
commit 4fa8e6497