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

corrupted size vs. prev_size when execute FlatbufferBuilder::CreateVector (version1.11) #6150

Closed
staycalmstayfoolish opened this issue Sep 29, 2020 · 2 comments
Labels

Comments

@staycalmstayfoolish
Copy link

staycalmstayfoolish commented Sep 29, 2020

Thank you for submitting an issue!
Dear developers and friends:
I encountered an frustrated issue when I used flatbuffers for data serialization, eg. SIGABRT error, and the backstrace is as following:

(gdb) bt
#0 0x00007ffff6d1b438 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff6d1d03a in __GI_abort () at abort.c:89
#2 0x00007ffff6d5d7fa in __libc_message (do_abort=2, fmt=fmt@entry=0x7ffff6e76f98 "*** Error in `%s': %s: 0x%s \n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ffff6d649ec in malloc_printerr (ar_ptr=0x7fffe8000020, ptr=0x7fffe81f6cb0, str=0x7ffff6e73d35 "
_corrupted size vs. prev_size_***", action=) at malloc.c:5020
#4 malloc_consolidate (av=av@entry=0x7fffe8000020) at malloc.c:4190
#5 0x00007ffff6d67d0c in _int_malloc (av=av@entry=0x7fffe8000020, bytes=bytes@entry=1024) at malloc.c:3457
#6 0x00007ffff6d6a1d4 in __GI___libc_malloc (bytes=1024) at malloc.c:2920
#7 0x00007ffff7353e78 in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007ffff7353f19 in operator new[](unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x00007ffff7b7fd2e in flatbuffers::DefaultAllocator::allocate (this=0x7ffff1a8b760, size=1024) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:479
#10 0x00007ffff7b7fe22 in flatbuffers::Allocate (allocator=0x0, size=1024) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:497
#11 0x00007ffff7b80645 in flatbuffers::vector_downward::reallocate (this=0x7fffe8061c90, len=2) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:877
#12 0x00007ffff7b8020d in flatbuffers::vector_downward::ensure_space (this=0x7fffe8061c90, len=2) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:760
#13 0x00007ffff7b80271 in flatbuffers::vector_downward::make_space (this=0x7fffe8061c90, len=2) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:768
#14 0x00007ffff7b8043f in flatbuffers::vector_downward::fill (this=0x7fffe8061c90, zero_pad_bytes=2) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:822
#15 0x00007ffff7b80ed3 in flatbuffers::FlatBufferBuilder::PreAlign (this=0x7fffe8061c90, len=24710, alignment=4) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:1286
#16 0x00007ffff7b83828 in flatbuffers::FlatBufferBuilder::PreAlign (this=0x7fffe8061c90, len=24710) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:1290
#17 0x00007ffff7b81073 in flatbuffers::FlatBufferBuilder::StartVector (this=0x7fffe8061c90, len=24710, elemsize=1) at /home/xxx/include/3rd_party/flatbuffers/flatbuffers.h:1416
#18 0x00007ffff7b843dd in flatbuffers::FlatBufferBuilder::CreateVector (this=0x7fffe8061c90, v=0x7fffe81f6cc0 "", len=24710)

has anyone encountered this problem before. I need your help.

Thanks!

@vglavnyy
Copy link
Contributor

It might help you:
https://stackoverflow.com/questions/49628615/understanding-corrupted-size-vs-prev-size-glibc-error
https://code.woboq.org/userspace/glibc/malloc/malloc.c.html

Probably your program overwrites control blocks of malloc before the call to CreateVector.
Can you run your program with an Address Sanitizer?

@github-actions
Copy link

This issue is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days.

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

2 participants