Re: [Boost-bugs] [Boost C++ Libraries] #8700: multiprecision : Trying to cast to unsigned from cpp_int > 19 bits causes crash

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8700: multiprecision : Trying to cast to unsigned from cpp_int > 19 bits causes crash
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-16 21:26:35


#8700: multiprecision : Trying to cast to unsigned from cpp_int > 19 bits causes
crash
------------------------------+--------------------------------------------
  Reporter: danq@… | Owner: johnmaddock
      Type: Bugs | Status: new
 Milestone: To Be | Component: multiprecision
  Determined | Severity: Showstopper
   Version: Boost 1.53.0 | Keywords: crash cast multiprecision dump
Resolution: |
------------------------------+--------------------------------------------

Comment (by danq@…):

 I created a stripped-down test case, but it does not fail. No matter how
 large a count, the conversion works. Sigh...

 I'm not sure how to go about integrating 1.54 into my toolset. I am using
 MinGW 10.2 distribution (a simple unzip and copy to destination folder
 type install).

 One thought that just occurred to me is that the run-time stack probably
 increases as the cpp_int size increases (confirm?). Perhaps what is
 happening in my application code is the stack is heavily used and
 overflows somehow when I increases the bit size to 20 bits.

 This might explain why the test case works. It has minimal stack
 requirements.

 A side note (may be related):

 This:

    Bit_Reg i_value = i_addr >> i_field->bits.lsb ;

    i_field->value = i_value.template convert_to <unsigned> () ;

 Compiles while this:

    i_field->value = static_cast <unsigned> (i_addr >> i_field->bits.lsb) ;

 does not.

 However, this:

    Bit_Reg i_value = i_addr >> i_field->bits.lsb ;

    i_field->value = static_cast <unsigned> (i_value) ;

 works.

 It seems that if I try to pass a temporary to the static_cast operator,
 the compiler complains.

 I noticed this while trying to create a test case. Note: either method
 still fails when I reach 20 bits.

 May or may not be related to the problem I am seeing.

 Suggestions on how to install 1.54 beta into my (simple) Mingw
 environment?

 Cheers!

 Dan

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8700#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC