Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocksdb_close throwing error #11801

Open
narayana1923 opened this issue Sep 7, 2023 · 2 comments
Open

rocksdb_close throwing error #11801

narayana1923 opened this issue Sep 7, 2023 · 2 comments
Labels

Comments

@narayana1923
Copy link

narayana1923 commented Sep 7, 2023

Hi, I am using rocksdb 5.8 in postgres and as part of the drop extension command I try to close rocksdb and remove its directories. When I get to the rocksdb_close function call its throwing an error message in postgres logs saying "malloc(): unaligned tcache chunk detected" and crashing the server.
Below is the GDB stack trace:

#5  0x00007fc987a896f6 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fc987bdbb8c "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007fc987aa0d7c in malloc_printerr (str=str@entry=0x7fc987bde5d8 "malloc_consolidate(): unaligned fastbin chunk detected") at ./malloc/malloc.c:5664
#7  0x00007fc987aa1a0c in malloc_consolidate (av=av@entry=0x7fc987c19c80 <main_arena>) at ./malloc/malloc.c:4750
#8  0x00007fc987aa2f20 in _int_free (av=0x7fc987c19c80 <main_arena>, p=0x5640b28e95b0, have_lock=<optimized out>) at ./malloc/malloc.c:4674
#9  0x00007fc987aa54d3 in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3391
#10 0x00007fc9844f767d in std::default_delete<char []>::operator() (this=<optimized out>, __ptr=<optimized out>) at /usr/include/c++/4.8.2/bits/unique_ptr.h:99
#11 std::unique_ptr<char [], std::default_delete<char []> >::~unique_ptr (this=0x5640b28cbcd0, __in_chrg=<optimized out>)    at /usr/include/c++/4.8.2/bits/unique_ptr.h:377
#12 rocksdb::AlignedBuffer::~AlignedBuffer (this=0x5640b28cbcc8, __in_chrg=<optimized out>) at ./util/aligned_buffer.h:29
#13 rocksdb::WritableFileWriter::~WritableFileWriter (this=0x5640b28cbcc0, __in_chrg=<optimized out>) at ./util/file_reader_writer.h:162
#14 std::default_delete<rocksdb::WritableFileWriter>::operator() (this=<optimized out>, __ptr=0x5640b28cbcc0) at /usr/include/c++/4.8.2/bits/unique_ptr.h:67
#15 std::unique_ptr<rocksdb::WritableFileWriter, std::default_delete<rocksdb::WritableFileWriter> >::~unique_ptr (this=0x5640b28c5200, __in_chrg=<optimized out>)    at /usr/include/c++/4.8.2/bits/unique_ptr.h:184
#16 rocksdb::log::Writer::~Writer (this=0x5640b28c5200, __in_chrg=<optimized out>) at db/log_writer.cc:34
#17 0x00007fc98449b411 in rocksdb::DBImpl::LogWriterNumber::ClearWriter (this=0x5640b28a3bd0) at ./db/db_impl.h:917
#18 rocksdb::DBImpl::~DBImpl (this=0x5640b28a2dc0, __in_chrg=<optimized out>) at db/db_impl.cc:324
#19 0x00007fc98449bb41 in rocksdb::DBImpl::~DBImpl (this=0x5640b28a2dc0, __in_chrg=<optimized out>) at db/db_impl.cc:357
#20 0x00007fc98443fafa in rocksdb_close (db=0x5640b28fb6c0) at db/c.cc:627

What am I missing here?
Thanks in advance for any response

@anand1976
Copy link
Contributor

@narayana1923 It may not necessarily be a problem with the functions shown on the stack. Some memory corruption could have occurred earlier. Can you reproduce this with an asan build?

@narayana1923
Copy link
Author

@anand1976 I tried compiling rocksdb with make shared_lib COMPILE_WITH_ASAN = 1 but couldn't find any memory corruption error in runtime

@ajkr ajkr added question up-for-grabs Up for grabs labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants