Hi Amit, Thanks for working on this.
When building with --enable-cassert, I get compiler warning: hash.c: In function 'hashbucketcleanup': hash.c:722: warning: 'new_bucket' may be used uninitialized in this function After an intentionally created crash, I get an Assert triggering: TRAP: FailedAssertion("!(((freep)[(bitmapbit)/32] & (1<<((bitmapbit)%32))))", File: "hashovfl.c", Line: 553) freep[0] is zero and bitmapbit is 16. With this backtrace: (gdb) bt #0 0x0000003838c325e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x0000003838c33dc5 in abort () at abort.c:92 #2 0x000000000081a8fd in ExceptionalCondition (conditionName=<value optimized out>, errorType=<value optimized out>, fileName=<value optimized out>, lineNumber=<value optimized out>) at assert.c:54 #3 0x00000000004a4199 in _hash_freeovflpage (rel=0x7f3f745d86b8, bucketbuf=198, ovflbuf=199, wbuf=198, itups=0x7ffc258fa090, itup_offsets=0x126e8a8, tups_size=0x7ffc258f93d0, nitups=70, bstrategy=0x12ba320) at hashovfl.c:553 #4 0x00000000004a4c32 in _hash_squeezebucket (rel=<value optimized out>, bucket=38, bucket_blkno=56, bucket_buf=198, bstrategy=0x12ba320) at hashovfl.c:1010 #5 0x00000000004a042a in hashbucketcleanup (rel=0x7f3f745d86b8, bucket_buf=198, bucket_blkno=56, bstrategy=0x12ba320, maxbucket=96, highmask=127, lowmask=63, tuples_removed=0x7ffc258fc1c8, num_index_tuples=0x7ffc258fc1c0, bucket_has_garbage=0 '\000', delay=1 '\001', callback=0x5e9bd0 <lazy_tid_reaped>, callback_state=0x126e248) at hash.c:937 #6 0x00000000004a07e7 in hashbulkdelete (info=0x7ffc258fc2b0, stats=0x0, callback=0x5e9bd0 <lazy_tid_reaped>, callback_state=0x126e248) at hash.c:580 #7 0x00000000005e98c5 in lazy_vacuum_index (indrel=0x7f3f745d86b8, stats=0x126ecc0, vacrelstats=0x126e248) at vacuumlazy.c:1599 #8 0x00000000005ea7f9 in lazy_scan_heap (onerel=<value optimized out>, options=<value optimized out>, params=0x12ba290, bstrategy=<value optimized out>) at vacuumlazy.c:1291 #9 lazy_vacuum_rel (onerel=<value optimized out>, options=<value optimized out>, params=0x12ba290, bstrategy=<value optimized out>) at vacuumlazy.c:255 #10 0x00000000005e8939 in vacuum_rel (relid=17329, relation=0x7ffc258fcbd0, options=99, params=0x12ba290) at vacuum.c:1399 #11 0x00000000005e8d01 in vacuum (options=99, relation=0x7ffc258fcbd0, relid=<value optimized out>, params=0x12ba290, va_cols=0x0, bstrategy=<value optimized out>, isTopLevel=1 '\001') at vacuum.c:307 #12 0x00000000006a07f1 in autovacuum_do_vac_analyze () at autovacuum.c:2823 #13 do_autovacuum () at autovacuum.c:2341 #14 0x00000000006a0f9c in AutoVacWorkerMain (argc=<value optimized out>, argv=<value optimized out>) at autovacuum.c:1656 #15 0x00000000006a1116 in StartAutoVacWorker () at autovacuum.c:1461 #16 0x00000000006afb00 in StartAutovacuumWorker (postgres_signal_arg=<value optimized out>) at postmaster.c:5323 #17 sigusr1_handler (postgres_signal_arg=<value optimized out>) at postmaster.c:5009 #18 <signal handler called> #19 0x0000003838ce1503 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:82 #20 0x00000000006b0ec0 in ServerLoop (argc=<value optimized out>, argv=<value optimized out>) at postmaster.c:1657 #21 PostmasterMain (argc=<value optimized out>, argv=<value optimized out>) at postmaster.c:1301 #22 0x0000000000632e88 in main (argc=4, argv=0x11f4d50) at main.c:228 Cheers, Jeff