[PPL-devel] Failure building ppl under Cygwin 64 with a mingw target.

Keith Clifford kclifford at tranaptic.ca
Thu Jul 31 22:50:58 CEST 2014


Hi Roberto,
I'm 99.99% certain that it's a tools issue and not an issue with your code.
The fix up in PPL::Init::Init to call
ppl_set_GMP_memory_allocation_functions() was short by 0x10. When I manually
fixed it to what I thought it should be and with the noisy and very noisy
environment variables on, memory2 did a lot of allocating and freeing and
then terminated normally.

I'm going to keep digging to find out what exactly is broken. Do you want me
to keep you updated? From here on I can talk to the people responsible for
whatever is broken.

Thanks,
Keith

-----Original Message-----
From: Roberto Bagnara [mailto:bagnara at cs.unipr.it] 
Sent: July 29, 2014 12:03 AM
To: kclifford at tranaptic.ca
Cc: The Parma Polyhedra Library developers' list
Subject: Re: [PPL-devel] Failure building ppl under Cygwin 64 with a mingw
target.

Hello Keith.

On 07/29/14 05:27, Keith Clifford wrote:
> I set the environment variables as you requested and didn't get any
output.
> I commented out ppl_set_GMP_memory_allocation_functions and got the 
> following output:
> 
> $ ./memory2
> test1()
> test2()
> **************** k = 4294967295 ****************
> *************** dry run ***************
> **************** k = 0 ****************
> test3()
> **************** k = 4294967295 ****************
> *************** dry run ***************
> **************** k = 0 ****************
> 
> With ppl_set_GMP_memory_allocation_functions back in and some 
> debugging added I didn't see any of the debugging before the segfault:
> 
> 	$ ./memory2
> 	Segmentation fault
> 
> Modified ppl_set_GMP_memory_allocation_functions:
> 
> 	extern "C" void
> 	ppl_set_GMP_memory_allocation_functions() {
> 	  before_main = true;
> 
> 	  nout << "ppl_set_GMP_memory_allocation_functions!" << endl;
> 	  // Allow the static coefficients of the library to be allocated
> 	  // without any limit.
> 	  reset_allocators(ULONG_MAX, ULONG_MAX);
> 	  mp_set_memory_functions(cxx_malloc, cxx_realloc, cxx_free);
> 	}
> 
> I rebuilt with --enable-debugging and ran under strace with the 
> following
> results:
> 
> $ strace memory2
> 
> This application has requested the Runtime to terminate it in an 
> unusual way.
> Please contact the application's support team for more information.
> terminate called after throwing an instance of 'std::bad_cast'
>   what():  std::bad_cast
> --- Process 7044, exception 4000001f at 000000007704103B
> 
> Does any of this help?

Yes.  Can you please have a session with gdb in order to understand where
the std::bad_cast exception is thrown?  You can do this by setting a
breakpoint at __cxa_throw.
Thanks,

   Roberto

> -----Original Message-----
> From: Roberto Bagnara [mailto:bagnara at cs.unipr.it]
> Sent: July 26, 2014 1:00 AM
> To: kclifford at tranaptic.ca
> Cc: The Parma Polyhedra Library developers' list
> Subject: Re: [PPL-devel] Failure building ppl under Cygwin 64 with a 
> mingw target.
> 
> Hello Keith, thanks for the report.
> 
> On 07/25/14 20:18, Keith Clifford wrote:
>> I'm building a set of cross compilers to run under mingw and I got 
>> the
> error below.
>>
>> The set of packages and their versions to do the build are:
>>
>> Build machine:
>>
>>      CYGWIN_NT-6.1 1.7.31(0.272/5/3) 2014-07-21 18:40 x86_64 Cygwin
>>
>> Components:
>>
>>      gmp-6.0.0a
>>      mpfr-3.1.2
>>      mpc-1.0.2
>>      isl-0.12.2
>>      cloog-0.18.1
>>      ppl-1.1
>>      binutils-2.24
>>      gcc-4.9.1
>>      newlib-2.1.0
>>      gdb-7.7
>>
>> I've attached the script, mkx, that I use for building the cross 
>> compilers, the test-suit log, and the make and check logs. The 
>> individual test logs are empty. I'm set up to run so if you'd like me 
>> to try anything, let me know and I can give it a go. When the build 
>> failed it said let you know and I'm going to continue investigating.
>> I'll let you know if I find anything.
> 
> 
> As far as I can tell, building the PPL succeeded and only one test 
> failed
> (memory2 in tests/Polyhedron).  Can you please rerun just that test 
> after defining the environment variables PPL_NOISY_TESTS and 
> PPL_VERY_NOISY_TESTS to whatever you like?
> Then please send the resulting output to ppl-devel at cs.unipr.it King 
> regards,
> 
>    Roberto
> 


-- 
     Prof. Roberto Bagnara

Applied Formal Methods Laboratory - University of Parma, Italy
mailto:bagnara at cs.unipr.it
                              BUGSENG srl - http://bugseng.com
                              mailto:roberto.bagnara at bugseng.com




More information about the PPL-devel mailing list