]> git.proxmox.com Git - mirror_zfs.git/commit
Stack overflow on 64-bit modulus operations on 32-bit architectures.
authorAlex Zhuravlev <Alex.Zhuravlev@Sun.COM>
Thu, 3 Jun 2010 05:01:14 +0000 (22:01 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 3 Jun 2010 16:06:55 +0000 (09:06 -0700)
commit1b4ad25e2f29172c86d3293b61f0c5232d4a2da8
treecff3cadd022593ccb32692843bb9b5382af41b7e
parent8a1c9a02fb66ac5885990ec4d82faf03f820085b
Stack overflow on 64-bit modulus operations on 32-bit architectures.

Running 'zpool create' on a 32-bit machine with an SPL compiled with
gcc 4.4.4 led to a stack overlow.  This turned out to be due to some
sort of 'optimization' by gcc:

uint64_t __umoddi3(uint64_t dividend, uint64_t divisor)
{
   return dividend - divisor * (dividend / divisor);
}

This code was supposed to be using __udivdi3 to implement /, but gcc
instead implemented it via __umoddi3 itself.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/spl/spl-generic.c