[parsec-users] Cross Compiling Dedup for Alpha Arch using M5 Simulator

Christian Bienia cbienia at CS.Princeton.EDU
Fri Jul 31 15:03:17 EDT 2009

Hi Ef,


This is a bizarre error, it should never happen. It means that the Compress
stage was given the instruction to compress a data chunk that doesn't exist
in the hash table. There's either a bug in the program or a bug in your
build / run environment. How exactly did you create and run the binary?


The key that could not be found by the program was generated in the function
sub_ChunkProcess. Here's the relevant code:


  key = (u_char *)malloc(SHA1_LEN);

  if(key == NULL) {

    EXIT_TRACE("Memory allocation failed.\n");



After that the hash table is checked to see whether this data chunk has been
seen before, and if not a new entry is created:


  if ((entry = hashtable_search(cache, (void *)key)) == NULL) {

    // cache miss: put it in the hashtable and the queue for the compress

    struct pContent * value;


    value = (struct pContent *)malloc(sizeof(struct pContent));

    if(value == NULL) {

      EXIT_TRACE("Memory allocation failed.\n");


    value->len = 0;

    value->count = 1;

    value->content = NULL;

    value->tag = TAG_OCCUPY;

    if (hashtable_insert(cache, key, value) == 0) {

      EXIT_TRACE("hashtable_insert failed");




At the end of this processing stage the items is inserted into the
compression queue, from where the compress stage will dequeue it and find
the item just created in the hash table (or not, as in your case). There
should ALWAYS be an entry.


I cannot reproduce the error on my machines, and I've also never seen it
while working on the program. Are you certain that your environment is set
up correctly?


- Chris



From: parsec-users-bounces at lists.cs.princeton.edu
[mailto:parsec-users-bounces at lists.cs.princeton.edu] On Behalf Of ef
Sent: Thursday, July 30, 2009 8:25 PM
To: PARSEC Users
Subject: Re: [parsec-users] Cross Compiling Dedup for Alpha Arch using M5


Here is where the code fails, under encoder.c
 if ((entry = hashtable_search(cache, (void *)key)) == NULL) {
        //if cannot find the entry, error
        printf("Error: Compress hash error\n");

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/parsec-users/attachments/20090731/0c688d25/attachment.htm>

More information about the parsec-users mailing list