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

Segfault in posix-mock-test (testing::internal::UntypedFunctionMockerBase::SetOwnerAndName) #1607

Closed
vedranmiletic opened this issue Mar 26, 2020 · 5 comments

Comments

@vedranmiletic
Copy link

When building with Clang 9 using libc++ (-stdlib=libc++) on 64-bit Linux, I get:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00005555555fd7c8 in testing::internal::UntypedFunctionMockerBase::SetOwnerAndName (this=0x0, mock_obj=0x0, name=0x55555563101d "newlocale") at ../test/gmock-gtest-all.cc:10538
10538     mock_obj_ = mock_obj;
(gdb) backtrace 
#0  0x00005555555fd7c8 in testing::internal::UntypedFunctionMockerBase::SetOwnerAndName (this=0x0, mock_obj=0x0, name=0x55555563101d "newlocale") at ../test/gmock-gtest-all.cc:10538
#1  0x000055555556e2c7 in LocaleMock::newlocale (this=0x0, gmock_a1=8127, gmock_a2=0x7ffff7f5b336 "C", gmock_a3=0x0) at ../test/posix-mock-test.cc:456
#2  0x000055555556aa8a in newlocale (category_mask=8127, locale=0x7ffff7f5b336 "C", base=0x0) at ../test/posix-mock-test.cc:497
#3  0x00007ffff7f23fc7 in ?? () from /usr/lib/libc++.so.1
#4  0x00007ffff7f2932e in std::__1::locale::__global() () from /usr/lib/libc++.so.1
#5  0x00007ffff7f29389 in std::__1::locale::locale() () from /usr/lib/libc++.so.1
#6  0x00007ffff7efaa9c in std::__1::basic_streambuf<char, std::__1::char_traits<char> >::basic_streambuf() () from /usr/lib/libc++.so.1
#7  0x00007ffff7f06897 in std::__1::ios_base::Init::Init() () from /usr/lib/libc++.so.1
#8  0x00007ffff7eeb696 in ?? () from /usr/lib/libc++.so.1
#9  0x00007ffff7fe209a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff7fe21a1 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#11 0x00007ffff7fd313a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#12 0x0000000000000001 in ?? ()
#13 0x00007fffffffea7c in ?? ()
#14 0x0000000000000000 in ?? ()

This is not the same as #325, as far as I can see.

@vitaut
Copy link
Contributor

vitaut commented Mar 26, 2020

What Linux distro and version?

@vedranmiletic
Copy link
Author

What Linux distro and version?

Stable Manjaro.

@vedranmiletic
Copy link
Author

Also reproducible with Clang 10 on Ubuntu 20.04 pre-release updated today.

@vitaut
Copy link
Contributor

vitaut commented Apr 1, 2020

Fixed in e588b02. Thanks for reporting!

@vitaut vitaut closed this as completed Apr 1, 2020
@vedranmiletic
Copy link
Author

Verified working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants