bugPSPP - Bugs: bug #18982, Three check failures on x86-64

 
 

bug #18982: Three check failures on x86-64

Submitted by:  Ben Pfaff <blp>
Submitted on:  Wed 07 Feb 2007 05:29:51 AM UTC  
 
Category: Compilation/PortabilitySeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: Before 0.6.0
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 10 Aug 2007 04:50:32 AM UTC, comment #15:

>All tests now pass on x86_64.


Wonderful. Thanks so much for investigation and verification (and patience).

I checked this in.

Ben Pfaff <blp>
Project Administrator
Fri 10 Aug 2007 04:17:08 AM UTC, comment #14:

Yep.

That does the trick.

All tests now pass on x86_64.

John Darrington <jmd>
Project Administrator
Fri 10 Aug 2007 03:20:04 AM UTC, comment #13:

Thanks John.

I've prepared similar fixes for the other two affected tests. I'm attaching the patch here as a new file. If you can verify that this works on x86-64 (it's fine on x86-32 here), I'll check it in.

(file #13638)

Ben Pfaff <blp>
Project Administrator
Fri 10 Aug 2007 02:21:57 AM UTC, comment #12:

OK. I tested it. on a 32bit and a 64 bit machine.

./tests/formats/num-in.sh now passes.

Btw, It's a bit annoying that I have to do "export PERL=perl" in order to run individual tests from a shell.

John Darrington <jmd>
Project Administrator
Fri 10 Aug 2007 12:18:19 AM UTC, comment #11:

>I haven't tested the patch at all


I'd appreciate it if you could test the new version (file #13636) so that I can make sure it works on x86-64 before going further.

(Assuming that a new version of something works better than the old version without testing it is a bad idea.)

Ben Pfaff <blp>
Project Administrator
Fri 10 Aug 2007 12:12:31 AM UTC, comment #10:

>Err... Did you inadvertently attach the wrong file?


Yes. Here's the fixed version.

(file #13636)

Ben Pfaff <blp>
Project Administrator
Fri 10 Aug 2007 12:09:35 AM UTC, comment #9:

Err... Did you inadvertently attach the wrong file? There doesn't seem to be any difference between file #13633 and what I remember of #13623

> Are you OK with this otherwise? If so I'll cook up similar changes to the other affected tests.


I haven't tested the patch at all, but I can't see any other problems with it.

John Darrington <jmd>
Project Administrator
Thu 09 Aug 2007 03:46:43 PM UTC, comment #8:

>This function doesn't appear to use $modulo


I'm a moron.

I've replaced the patch and the expected results.

Are you OK with this otherwise? If so I'll cook up similar changes to the other affected tests.

(file #13632, file #13633)

Ben Pfaff <blp>
Project Administrator
Thu 09 Aug 2007 05:46:11 AM UTC, comment #7:

This function doesn't appear to use $modulo

+sub my_rand {
+ my ($modulo) = @_;
+ my ($a) = 16807;
+ my ($m) = 2147483647;
+ my ($tmp) = $a * $seed;
+ $seed = $tmp - $m * int ($tmp / $m);
+ return $seed / $m;
+}

John Darrington <jmd>
Project Administrator
Thu 09 Aug 2007 05:16:34 AM UTC, comment #6:

>the my_rand subroutine which generates the cases is not as
>platform invariant as it might be:


Brilliant observation. Thank you for figuring this out.

What would you say to a solution like the one I'm attaching. Note that I'm actually attaching two files: a patch against tests/formats/num-in.sh plus a replacement for tests/formats/num-in.expect.gz.

If you like this patch I'll cook up similar changes to the other affected tests.

(file #13623, file #13624)

Ben Pfaff <blp>
Project Administrator
Thu 09 Aug 2007 01:34:52 AM UTC, comment #5:

Forget most of what I said previously. Further investigation shows that the problem is simply the my_rand subroutine which generates the cases is not as platform invariant as it might be:

sub my_rand {
my ($modulo) = @_;
$next = ($next * 1103515245 + 12345) % (2**32);
return int ($next / 65536) % $modulo;
}

If $next starts at a large value, then the multiplication leads to precision errors on the 32 bit machines, and thus a different sequence of numbers.

John Darrington <jmd>
Project Administrator
Wed 08 Aug 2007 12:41:55 PM UTC, comment #4:

I've been doing a little digging into the first test failure. My initial suspicion is that the x86_64 machine is correct, and the test (and 32 bit machine) is wrong.

It seems that the '-' sign is causing problems again. When a date such as "30 6 1680 -4:50" is encountered, the '-' sign is being treated as a minus. Presumably it's supposed to be a seperator ??

So in this case, the resultant time is 29-JUN-1680 19:10:00 (4 hours and 50 minutes before midnight on 30 June).

John Darrington <jmd>
Project Administrator
Wed 08 Aug 2007 10:42:45 AM UTC, comment #3:

I can confirm that the same three tests fail on
2.6.20-1.2948.fc6 #1 SMP Fri Apr 27 19:18:54 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

John Darrington <jmd>
Project Administrator
Thu 02 Aug 2007 03:11:29 AM UTC, comment #2:

I may not have an opportunity to re-test this on GNU/Linux x86-64 before release. If anyone else has such a machine handy I'd appreciate it if you could pass along your results.

Ben Pfaff <blp>
Project Administrator
Wed 07 Feb 2007 02:04:45 PM UTC, comment #1:

Interesting: These tests all pass on OBSD x86-64.

Jason H Stover <jstover>
Project Member
Wed 07 Feb 2007 05:29:51 AM UTC, original submission:

tests/formats/date-in.sh. tests/formats/num-in.sh, and tests/formats/time-in.sh fail on GNU/Linux on x86-64. Output attached.

Ben Pfaff <blp>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #13638:  prng-tests-bug.patch added by blp (34KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jmd (Posted a comment)
  • -unavailable- added by jstover (Posted a comment)
  • -unavailable- added by blp (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 20 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 10 Aug 2007 04:50:32 AM UTCblpStatusReady for Test/Review=>Fixed
      Open/ClosedOpen=>Closed
    Fri 10 Aug 2007 03:20:20 AM UTCblpAttached File#11939=>Removed
    Fri 10 Aug 2007 03:20:17 AM UTCblpAttached File#13632=>Removed
    Fri 10 Aug 2007 03:20:14 AM UTCblpAttached File#13636=>Removed
    Fri 10 Aug 2007 03:20:04 AM UTCblpAttached File-=>Added prng-tests-bug.patch, #13638
      StatusIn Progress=>Ready for Test/Review
    Fri 10 Aug 2007 12:12:31 AM UTCblpAttached File-=>Added prng-tests-bug.patch, #13636
    Fri 10 Aug 2007 12:11:33 AM UTCblpAttached File#13633=>Removed
    Thu 09 Aug 2007 03:46:43 PM UTCblpAttached File-=>Added num-in.expected.gz, #13632
      Attached File-=>Added prng-tests-bug.patch, #13633
    Thu 09 Aug 2007 03:45:14 PM UTCblpAttached File#13623=>Removed
    Thu 09 Aug 2007 03:45:06 PM UTCblpAttached File#13624=>Removed
    Thu 09 Aug 2007 05:16:34 AM UTCblpAttached File-=>Added prng-tests-bug.patch, #13623
      Attached File-=>Added num-in.expected.gz, #13624
      StatusNeed Info=>In Progress
    Thu 02 Aug 2007 03:11:29 AM UTCblpStatusNone=>Need Info
    Wed 25 Jul 2007 03:20:45 PM UTCblpReleaseNone=>Before 0.6.0
    Fri 09 Feb 2007 04:46:58 AM UTCblpCategoryNumerical Errors=>Compilation/Portability
    Wed 07 Feb 2007 05:30:30 AM UTCblpAttached File-=>Added check.output.gz, #11939

    Back to the top


    Powered by Savane 3.1-cleanup1