goodrich@CYBERPOWERPC:/opt/stan$ make CC=clang++ -j9 test/unit/memory/stack_alloc_speed
clang++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fsanitize=memory -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.7.0/include -I lib/gtest_1.7.0 lib/gtest_1.7.0/src/gtest-all.cc -o test/gtest.o
clang++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fsanitize=memory -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long -c -O3 -o bin/stan/agrad/rev/var_stack.o src/stan/agrad/rev/var_stack.cpp
ar -rs bin/libstan.a bin/stan/agrad/rev/var_stack.o
ar: creating bin/libstan.a
ar rv test/libgtest.a test/gtest.o
ar: creating test/libgtest.a
a - test/gtest.o
clang++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fsanitize=memory -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.7.0/include -I lib/gtest_1.7.0 src/test/unit/memory/stack_alloc_speed_test.cpp -o test/unit/memory/stack_alloc_speed.o
clang++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fsanitize=memory -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long -O3 lib/gtest_1.7.0/src/gtest_main.cc test/unit/memory/stack_alloc_speed.o -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.7.0/include -I lib/gtest_1.7.0 -o test/unit/memory/stack_alloc_speed test/libgtest.a -Lbin -lstan
test/unit/memory/stack_alloc_speed --gtest_output="xml:test/unit/memory/stack_alloc_speed.xml"
==1550==ERROR: MemorySanitizer failed to allocate 0x1fffffffffff (35184372088831) bytes at address 35184372088832 (12)
FATAL: MemorySanitizer can not mmap the shadow memory.
FATAL: Make sure to compile with -fPIE and to link with -pie.
FATAL: Disabling ASLR is known to cause this error.
FATAL: If running under GDB, try 'set disable-randomization off'.
==1550==Process memory map follows:
0x7f66934c6000-0x7f6693666000 /lib/x86_64-linux-gnu/libc-2.18.so
0x7f6693666000-0x7f6693865000 /lib/x86_64-linux-gnu/libc-2.18.so
0x7f6693865000-0x7f6693869000 /lib/x86_64-linux-gnu/libc-2.18.so
0x7f6693869000-0x7f669386b000 /lib/x86_64-linux-gnu/libc-2.18.so
0x7f669386b000-0x7f669386f000
0x7f669386f000-0x7f6693884000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6693884000-0x7f6693a84000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6693a84000-0x7f6693a85000 /lib/x86_64-linux-gnu/libgcc_s.so.1
0x7f6693a85000-0x7f6693b72000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
0x7f6693b72000-0x7f6693d72000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
0x7f6693d72000-0x7f6693d7a000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
0x7f6693d7a000-0x7f6693d7c000 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20
0x7f6693d7c000-0x7f6693d91000
0x7f6693d91000-0x7f6693e92000 /lib/x86_64-linux-gnu/libm-2.18.so
0x7f6693e92000-0x7f6694092000 /lib/x86_64-linux-gnu/libm-2.18.so
0x7f6694092000-0x7f6694093000 /lib/x86_64-linux-gnu/libm-2.18.so
0x7f6694093000-0x7f6694094000 /lib/x86_64-linux-gnu/libm-2.18.so
0x7f6694094000-0x7f6694097000 /lib/x86_64-linux-gnu/libdl-2.18.so
0x7f6694097000-0x7f6694296000 /lib/x86_64-linux-gnu/libdl-2.18.so
0x7f6694296000-0x7f6694297000 /lib/x86_64-linux-gnu/libdl-2.18.so
0x7f6694297000-0x7f6694298000 /lib/x86_64-linux-gnu/libdl-2.18.so
0x7f6694298000-0x7f669429f000 /lib/x86_64-linux-gnu/librt-2.18.so
0x7f669429f000-0x7f669449e000 /lib/x86_64-linux-gnu/librt-2.18.so
0x7f669449e000-0x7f669449f000 /lib/x86_64-linux-gnu/librt-2.18.so
0x7f669449f000-0x7f66944a0000 /lib/x86_64-linux-gnu/librt-2.18.so
0x7f66944a0000-0x7f66944b8000 /lib/x86_64-linux-gnu/libpthread-2.18.so
0x7f66944b8000-0x7f66946b7000 /lib/x86_64-linux-gnu/libpthread-2.18.so
0x7f66946b7000-0x7f66946b8000 /lib/x86_64-linux-gnu/libpthread-2.18.so
0x7f66946b8000-0x7f66946b9000 /lib/x86_64-linux-gnu/libpthread-2.18.so
0x7f66946b9000-0x7f66946bd000
0x7f66946bd000-0x7f66946dd000 /lib/x86_64-linux-gnu/ld-2.18.so
0x7f6694884000-0x7f66948a6000
0x7f66948d0000-0x7f66948dc000
0x7f66948dc000-0x7f66948dd000 /lib/x86_64-linux-gnu/ld-2.18.so
0x7f66948dd000-0x7f66948de000 /lib/x86_64-linux-gnu/ld-2.18.so
0x7f66948de000-0x7f66948df000
0x7f66948df000-0x7f6694a50000 /opt/stan/test/unit/memory/stack_alloc_speed
0x7f6694c50000-0x7f6694c52000 /opt/stan/test/unit/memory/stack_alloc_speed
0x7f6694c52000-0x7f669686d000
0x7fffa0224000-0x7fffa0245000 [stack]
0x7fffa03df000-0x7fffa03e1000 [vdso]
0xffffffffff600000-0xffffffffff601000 [vsyscall]
==1550==End of process memory map.
make: *** [test/unit/memory/stack_alloc_speed] Error 77
(gdb) run
Starting program: /opt/stan/test/unit/memory/./stack_alloc_speed
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Running main() from gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from stack_alloc
[ RUN ] stack_alloc.speed_of_allocator
Catchpoint 1 (exception thrown), 0x00007ffff7913f00 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff7913f00 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x000000000040480f in stack_alloc_speed_of_allocator_Test::TestBody() ()
#2 0x0000000000420661 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#3 0x000000000042276f in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#4 0x000000000041500e in testing::Test::Run() ()
#5 0x00000000004150eb in testing::TestInfo::Run() ()
#6 0x00000000004151db in testing::TestCase::Run() ()
#7 0x000000000041544d in testing::internal::UnitTestImpl::RunAllTests() ()
#8 0x0000000000420d62 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#9 0x0000000000422b99 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#10 0x0000000000415686 in testing::UnitTest::Run() ()
#11 0x0000000000404321 in main ()
goodrich@CYBERPOWERPC:/opt/stan$ cat src/test/unit/memory/stack_alloc_speed_test.cpp
#include <stan/memory/stack_alloc.hpp>
#include <gtest/gtest.h>
TEST(stack_alloc, speed_of_allocator) {
stan::memory::stack_alloc allocator;
for (size_t m = 0; m < 10000; m++) {
for (size_t n = 1; n <= 100000; ++n) {
allocator.alloc(n);
}
allocator.recover_all();
}
}
These ever-shifting C++ compilers are really frustrating. I take it you
did this in earlier compilers without a problem?
--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
goodrich@CYBERPOWERPC:/opt/stan$ git bisect log
git bisect start
# bad: [0a7bc82daa80efe891a2aa2176acc60466539d29] Merge branch 'develop' of https://github.com/stan-dev/stan into develop
git bisect bad 0a7bc82daa80efe891a2aa2176acc60466539d29
# good: [7d8c9b228f8ca96897db81fd930b430ce624efb7] Merge pull request #494 from stan-dev/hotfix/v2.1.1
git bisect good 7d8c9b228f8ca96897db81fd930b430ce624efb7
# bad: [2a0d7f4d961891b6300360ea0b9ee2f97ab77be4] Merge pull request #526 from stan-dev/feature/issue-427
git bisect bad 2a0d7f4d961891b6300360ea0b9ee2f97ab77be4
# bad: [479e612f9733086798b37a2949c45e30751a54b3] Merge pull request #539 from stan-dev/feature/issue-335-vect-log-prob
git bisect bad 479e612f9733086798b37a2949c45e30751a54b3
# bad: [51508f2f7e371a61d87a901177b17b4c557bb04a] Merge branch 'develop' into feature/persistent_sampler
git bisect bad 51508f2f7e371a61d87a901177b17b4c557bb04a
# bad: [f6f709303be2591241bbaa13189fcc99ab633eb1] Merge branch 'feature/issue_296' into develop
git bisect bad f6f709303be2591241bbaa13189fcc99ab633eb1
# good: [bb04ae5b1596ad0f5797166918d655f0205d0e53] Merge pull request #510 from stan-dev/feature/disable-failing-model-tests
git bisect good bb04ae5b1596ad0f5797166918d655f0205d0e53
# bad: [ef572c42e35a81941ef04496e1145e47867258a3] Merge pull request #505 from stan-dev/feature/issue-493-remove-test-dependency-on-compiling-grammars
git bisect bad ef572c42e35a81941ef04496e1145e47867258a3
# skip: [4253b49c6c79953d89d1bb3abc090fe6e1034de4] moved location of static pattern rule to after GRAMMAR_TESTS were defined
git bisect skip 4253b49c6c79953d89d1bb3abc090fe6e1034de4
# skip: [13a7440f5f60a979d18c78d29b599d433b1c796f] remove test dependency on compiling grammars
git bisect skip 13a7440f5f60a979d18c78d29b599d433b1c796f
# only skipped commits left to test
# possible first bad commit: [ef572c42e35a81941ef04496e1145e47867258a3] Merge pull request #505 from stan-dev/feature/issue-493-remove-test-dependency-on-compiling-grammars
# possible first bad commit: [4253b49c6c79953d89d1bb3abc090fe6e1034de4] moved location of static pattern rule to after GRAMMAR_TESTS were defined
# possible first bad commit: [13a7440f5f60a979d18c78d29b599d433b1c796f] remove test dependency on compiling grammars
Catchpoint 1 (exception thrown), 0x00007ffff7913f00 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff7913f00 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x0000000000404a6e in stan::memory::stack_alloc::move_to_next_block (this=0x7fffffffdd50, len=65534) at src/stan/memory/stack_alloc.hpp:109
#2 0x0000000000404d90 in stan::memory::stack_alloc::alloc (this=0x7fffffffdd50, len=65534) at src/stan/memory/stack_alloc.hpp:171
#3 0x00000000004047c7 in stack_alloc_speed_of_allocator_Test::TestBody (this=0x64f640) at src/test/unit/memory/stack_alloc_speed_test.cpp:8
#4 0x0000000000429adc in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x64f640, method=&virtual testing::Test::TestBody(), location=0x433903 "the test body")
at lib/gtest_1.7.0/src/gtest.cc:2078
#5 0x000000000042511a in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x64f640, method=&virtual testing::Test::TestBody(), location=0x433903 "the test body") at lib/gtest_1.7.0/src/gtest.cc:2114
#6 0x000000000040c5d9 in testing::Test::Run (this=0x64f640) at lib/gtest_1.7.0/src/gtest.cc:2151
#7 0x000000000040cdb8 in testing::TestInfo::Run (this=0x64f0a0) at lib/gtest_1.7.0/src/gtest.cc:2326
#8 0x000000000040d4aa in testing::TestCase::Run (this=0x64f400) at lib/gtest_1.7.0/src/gtest.cc:2444
#9 0x0000000000413c8a in testing::internal::UnitTestImpl::RunAllTests (this=0x64f130) at lib/gtest_1.7.0/src/gtest.cc:4315
#10 0x000000000042af36 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x64f130,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x413a0e <testing::internal::UnitTestImpl::RunAllTests()>, location=0x4341e0 "auxiliary test code (environments or event listeners)")
at lib/gtest_1.7.0/src/gtest.cc:2078
#11 0x0000000000425fb8 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x64f130,
method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x413a0e <testing::internal::UnitTestImpl::RunAllTests()>, location=0x4341e0 "auxiliary test code (environments or event listeners)")
at lib/gtest_1.7.0/src/gtest.cc:2114
#12 0x00000000004129a2 in testing::UnitTest::Run (this=0x64ecf0 <testing::UnitTest::GetInstance()::instance>) at lib/gtest_1.7.0/src/gtest.cc:3929
#13 0x0000000000404633 in RUN_ALL_TESTS () at lib/gtest_1.7.0/include/gtest/gtest.h:2288
#14 0x00000000004045ce in main (argc=1, argv=0x7fffffffe228) at lib/gtest_1.7.0/src/gtest_main.cc:37
// Occasionally, we have to switch blocks.
if (unlikely(next_loc_ >= cur_block_end_))
result = move_to_next_block(len);
return (void*)result;
}
(gdb) print result
$1 = 0x7fffb70e6092 ""
(gdb) print *result
$2 = 0 '\000'
(gdb) frame 1
#1 0x0000000000404a6e in stan::memory::stack_alloc::move_to_next_block (this=0x7fffffffdd50, len=65534) at src/stan/memory/stack_alloc.hpp:109
109 throw std::bad_alloc();
(gdb) print blocks_.back()
$3 = (char *&) @0x64f608: 0x0
(gdb) print newsize
$6 = 2147483648
(gdb) print len
$7 = 65534
(gdb) print blocks_.size()
$8 = 16
(gdb) print cur_block_
$9 = 15
(gdb) print sizes_[cur_block_]
$11 = (unsigned long &) @0x64f7e8: 0
// FIXME: enforce alignment
// big fun to inline, but only called twice
inline char* eight_byte_aligned_malloc(size_t size) {
This is helpful.
The test's failing when it tries to allocate a 2GB block.
Is that somehow prohibited by this program? Can you test
something that just mallocs something this size and see
if it works?