Re: BUG #14764: #if HASH_DEBUG source in dynahash.c is fault.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: twodragon72(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14764: #if HASH_DEBUG source in dynahash.c is fault.
Date: 2017-08-02 16:04:35
Message-ID: 9352.1501689875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

twodragon72(at)gmail(dot)com writes:
> dynahash.c

> #if HASH_DEBUG
> fprintf(stderr,
> "init_htab:\n%s%p\n%s%ld\n%s%ld\n%s%d\n%s%ld\n%s%u\n%s%x\n%s%x\n%s%ld\n%s%ld\n",
> "TABLE POINTER ", hashp,
> "DIRECTORY SIZE ", hctl->dsize,
> "SEGMENT SIZE ", hctl->ssize,
> "SEGMENT SHIFT ", hctl->sshift,
> "FILL FACTOR ", hctl->ffactor,
> "MAX BUCKET ", hctl->max_bucket,
> "HIGH MASK ", hctl->high_mask,
> "LOW MASK ", hctl->low_mask,
> "NSEGS ", hctl->nsegs,
> "NENTRIES ", hash_get_num_entries(hctl));
> #endif

> ", hash_get_num_entries(hctl));
> ->
> ", hash_get_num_entries(hashp));

Hm, yeah, that's broken, but I'm inclined to remove that field from the
printout rather than fix the computation. Since we just initialized the
hashtable, it can't possibly have any entries here. Also
hash_get_num_entries makes assumptions that we could do without in
debug code.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2017-08-02 16:41:50 Re: Re: [BUGS] BUG #14758: Segfault with logical replication on a function index
Previous Message Peter Eisentraut 2017-08-02 15:36:54 Re: BUG #14758: Segfault with logical replication on a function index