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

include/c++/v1/list:507: _LIBCPP_ASSERT '__get_const_db()->__decrementable(this)' failed. #34912

Closed
pawelsopensource mannequin opened this issue Dec 7, 2017 · 9 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@pawelsopensource
Copy link
Mannequin

pawelsopensource mannequin commented Dec 7, 2017

Bugzilla Link 35564
Resolution FIXED
Resolved on Jun 13, 2018 09:57
Version 5.0
OS Linux
Blocks #35997
CC @mclow,@tstellar
Fixed by commit(s) r323390 r334621

Extended Description

#include
int main()
{
std::list< int > l = { 1 };
l.remove( 1 );
return 0;
}

$ clang++ bug.cpp -o bug -std=c++1y -stdlib=libc++ -D_LIBCPP_DEBUG=1 -ggdb

$ ./bug

(...)/include/c++/v1/list:507: _LIBCPP_ASSERT '__get_const_db()->__decrementable(this)' failed. Attempted to decrement non-decrementable list::const_iterator

(gdb) bt
#​0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#​1 0x00007ffff6fe03b1 in __GI_abort () at abort.c:79
#​2 0x00007ffff7b5f6b2 in std::__1::__libcpp_abort_debug_function (info=...) at /home/builder/toolchain/llvm/llvm/projects/libcxx/src/debug.cpp:40
#​3 0x0000000000404876 in std::__1::__list_const_iterator<int, void*>::operator-- (this=0x7fffffffd5d8) at /home/pawels/aldec/dvm/clang-support/toolchain/llvm/sysroot/bin/../include/c++/v1/list:506
#​4 std::__1::list<int, std::__1::allocator >::splice (this=0x7fffffffd648, __p=..., __c=..., __f=..., __l=...) at /home/pawels/aldec/dvm/clang-support/toolchain/llvm/sysroot/bin/../include/c++/v1/list:2068
#​5 0x0000000000402690 in std::__1::list<int, std::__1::allocator >::remove (this=0x7fffffffdcc0, __x=@0x7fffffffdcac: 1) at /home/pawels/aldec/dvm/clang-support/toolchain/llvm/sysroot/bin/../include/c++/v1
/list:2109
#​6 0x000000000040127b in main () at bug.cpp:5

@pawelsopensource
Copy link
Mannequin Author

pawelsopensource mannequin commented Dec 7, 2017

assigned to @mclow

@mclow
Copy link
Contributor

mclow commented Dec 8, 2017

I get lots of link errors when I try to build this. (Mac OS X)
Can you tell me more about what system, etc, you are using?
What version of clang; what version of libc++?

Undefined symbols for architecture x86_64:
"std::__1::__libcpp_db::__decrementable(void const*) const", referenced from:
std::__1::list<int, std::__1::allocator >::remove(int const&) in junk-95bd1a.o
std::__1::list<int, std::__1::allocator >::splice(std::__1::__list_const_iterator<int, void*>, std::__1::list<int, std::__1::allocator >&, std::__1::__list_const_iterator<int, void*>, std::__1::__list_const_iterator<int, void*>) in junk-95bd1a.o
"std::__1::__libcpp_db::__find_c_from_i(void*) const", referenced from:
std::__1::list<int, std::__1::allocator >::splice(std::__1::__list_const_iterator<int, void*>, std::__1::list<int, std::__1::allocator >&, std::__1::__list_const_iterator<int, void*>, std::__1::__list_const_iterator<int, void*>) in junk-95bd1a.o
(and so on)

@mclow
Copy link
Contributor

mclow commented Dec 8, 2017

Ok; building with a libc++ that I built myself, this links.

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 14, 2017

I can reproduce, but I don't immediately know how to fix it. My initial attempts just made the reproduce hang indefinitely.

I'll look at this more when I have time next week.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 25, 2018

This should be fixed in r323390.

@tstellar
Copy link
Collaborator

Hi Marshall,

Is this OK to merge?

https://reviews.llvm.org/rL323390

@mclow
Copy link
Contributor

mclow commented Jun 13, 2018

I'm assuming that you're talking about merging for 6.0.1.
Yes, it's fine to merge

@tstellar
Copy link
Collaborator

Merged: r334621

@zmodem
Copy link
Collaborator

zmodem commented Nov 27, 2021

mentioned in issue #35997

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

4 participants