[mlpack] EXC_BAD_ACCESS in boost

Li Dong dongli at lasg.iap.ac.cn
Thu Mar 20 03:27:51 EDT 2014


Dear Ryan,

I just narrowed down the cause of the error to the compile flags ‘-std=c++11’! You can try the minimum code:

#include "mlpack/methods/range_search/range_search.hpp"

int main(int argc, const char *argv[])
{
    return 0;
}

and compile it by:

g++ -std=c++11 main.cpp -o main -lmlpack -I/usr/include/libxml2

and the same error will occur.

I hope this can help to find out the bug!

Li

On Mar 20, 2014, at 3:05 PM, Li Dong <dongli at lasg.iap.ac.cn> wrote:

> Dear Ryan,
> 
> I have cleaned MLPACK dependency for debugging, and the program is OK. I can’t figure out what changes caused MLPACK to have such error.
> 
> My codes can be cloned by
> 
> git clone --recursive https://github.com/dongli/Lady.git 
> 
> and it needs Armadillo-4.100 (use 3D field class), and gcc (>= 4.8).
> 
> Run:
> 
> $ mkdir build
> $ cd build
> $ cmake ..
> $ make demo_testcase
> $ ./demo_testcase
> 
> will give you ‘Bus error: 10’ and gdb will give you
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x000000010008a500
> 0x00000001001e0e7b in boost::math::lanczos::lanczos17m64::lanczos_sum<long double> ()
> 
> I don’t know if there is any tool to debug such error.
> 
> Thank you for helping!
> 
> Li
> 
> On Mar 19, 2014, at 3:40 AM, Ryan Curtin <gth671b at mail.gatech.edu> wrote:
> 
>> On Mon, Mar 17, 2014 at 04:49:00PM +0800, Li Dong wrote:
>>> Hi all,
>>> 
>>> I am using RangeSearch of MLPACK in my program, and it has no problem
>>> several days ago. But I made some changes to my codes these days, and
>>> encountered the following error in Debug mode:
>>> 
>>> iMac:Debug dongli$ lldb ./demo_testcase
>>> Current executable set to './demo_testcase' (x86_64).
>>> (lldb) r
>>> Process 84476 launched: './demo_testcase' (x86_64)
>>> Process 84476 stopped
>>> * thread #1: tid = 0xbf77f, 0x0000000100216e7b libmlpack.1.0.dylib`long double boost::math::lanczos::lanczos17m64::lanczos_sum<long double>(long double const&) + 59, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x10008a500)
>>>    frame #0: 0x0000000100216e7b libmlpack.1.0.dylib`long double boost::math::lanczos::lanczos17m64::lanczos_sum<long double>(long double const&) + 59
>>> libmlpack.1.0.dylib`long double boost::math::lanczos::lanczos17m64::lanczos_sum<long double>(long double const&) + 59:
>>> -> 0x100216e7b:  fstpt  (%rax)
>>>   0x100216e7d:  fldt   0x58f4d(%rip)             ; typeinfo name for boost::exception_detail::error_info_injector<std::domain_error> + 128
>>>   0x100216e83:  fstpt  0x10(%rax)
>>>   0x100216e86:  fldt   0x58f54(%rip)             ; typeinfo name for boost::exception_detail::error_info_injector<std::domain_error> + 144
>>> 
>>> In Release mode, there is no such error! My platform is Mac OS X
>>> 10.9.2, compiler is clang 5.1.0 in Xcode 5.1, boost version is 1.55.0.
>>> 
>>> Any idea? Thanks in advance!
>> 
>> What were the changes that you made to your program?
>> 
>> Two ideas I have might be to try gcc instead of clang, or to try a
>> different Boost version.  I don't think either of those is very likely
>> to work, though.  If you can paste some code that causes the error, I
>> can try to reproduce it; then, we can work towards a solution.
>> 
>> Thanks,
>> 
>> Ryan
>> 
>> -- 
>> Ryan Curtin    | "I am."
>> ryan at ratml.org |   - Joe
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20140320/036143d8/attachment-0003.html>


More information about the mlpack mailing list