v5.0.1, Mac, 32-bit: gmp_snprintf problem for (high) multi-limb integers

John McDermott jjm at mcs.st-and.ac.uk
Wed Mar 23 16:51:04 CET 2011


Dear Torbjorn, dear all,

On 14 Mar 2011, at 10:03, John McDermott wrote:

[...]
> 
>> I don't have access to any core2 mac, so I can ot attempt to reproduce
>> this.
> 
> We are trying to arrange access for ourselves to a larger pool of Macs, for testing with various architectures. If you would like to have access to a machine on which we can reproduce the problem we can probably arrange that in the near future.

I now have a couple of Apple Macs available and have done some further testing. Please let me know if you would like ssh access to these and we can arrange it off list.

These machines are a 64-bit Core 2 Duo and a 32-bit Core Duo (details appended below) with the same Apple version of gcc 4.2.1. I can reproduce the snprintf problem on each (in the former case this is not really new, but we didn't previously have the latter result).

Somewhat more surprisingly, I have built a version of gcc 4.5.2 from source on each machine and then used that to compile GMP 5.0.1 and again the compiled short test program (see message one in this thread) exhibits the print problem.

> 
>> I am surprised that the GMP testsuite does not catch this problem.
>> 
>> Please try the following:
>> 
>> cd tests/mpz
>> while true; do GMP_CHECK_RANDOMIZE=1 ./convert || break; done
>> 
>> Let it then run for a couple of minutes.
> 
> I ran this for over ten minutes on my machine, in a build setup which exhibits the issue, and saw nothing interesting. Many lines like
> 
> ...
> Seed GMP_CHECK_RANDOMIZE=975436106 (include this in bug reports)
> Seed GMP_CHECK_RANDOMIZE=2270808398 (include this in bug reports)
> ...
> 
> were produced. And nothing else. I doubt you would be interested to see them all :) We reproduced this on another very similar Mac.

And this test was the same with the gcc 4.5.2 compiler - nothing interesting shows.

I tried to get some data using the clang compiler but so far cannot build GMP with this compiler on these platforms, though I have not tried very hard. I may get a chance to try further later and submit a bug report for that if appropriate.

Best wishes,
John

============== Test machines ==============

GMP version 5.0.1 on each. Both running Mac OS X 10.6 (Snow Leopard). Each has the same (XCode) gcc:

i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)

(My first tests on my own Mac had Apple build 5664.) 

And each has a plain build from source of gcc 4.5.2. Differences are:

1)
Core 2 Duo (64)
config.guess: core2-apple-darwin10.6.0
configure option: ABI=32

2)
Core Duo
config.guess: pentiumm-apple-darwin10.6.0
no option to configure

Results of running the test program (exactly as in the first message in this thread) are the same problem on each but with a somewhat different wrong number printed than I sent as the result from my machine:

111738634087016687677581080419779823937672962105281999064930026947977838341505382863502660652163271927890657789545865354105698690880491419382732505129685548945886493976382779091529311779061982182942409366242406420035526825355893426176
124621678056280928134027256849486518165092655924543646134505516427513096901437974877003044581001505701271392533249162662036973704714586381084178282396188681310234375591574186118970477332872915242410250429348551860694043789494394439680
47f8f6d82a7cf5ae4cc763bb288c1277b721afcd304e75b6c6636bc575bc7d5d225a9a52a28a41141fafae04f4b5a1ca28f317a443995b0d87c5b2bdbe2a99794f472f86e3036a9fbc434ca40622d0ab25034c0000c29e365b8c551241fbde4800


--
John McDermott
Scientific Officer
Centre for Interdisciplinary Research in Computational Algebra
School of Computer Science
University of St Andrews
SCOTLAND

The University of St Andrews is committed to sustainable practices and the preservation of the environment.
Please do not print this email unless absolutely necessary.

The University of St Andrews is a charity registered in Scotland : No SC01353



More information about the gmp-bugs mailing list