Skip Menu |

This queue is for tickets about the Quota CPAN distribution.

Report information
The Basics
Id: 41591
Status: resolved
Priority: 0/
Queue: Quota

People
Owner: Nobody in particular
Requestors: jani.ollikainen [...] pronetko.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Segmentation fault on X86-64 using Quota 1.6.2
Date: Wed, 10 Dec 2008 15:09:04 +0200
To: bug-Quota [...] rt.cpan.org, tomzo [...] users.sourceforge.net
From: Jani Ollikainen <jani.ollikainen [...] pronetko.fi>
#!/usr/bin/perl use Quota; # Get uid from username $uid=getpwnam(shift); if ($uid) { # Get device from filesystem path $dev = Quota::getqcarg("/var/www"); print "DEB: $dev\n"; # Get quota for user ($bc, $bs, $bh,$bt,$ic, $is, $ih, $it)=Quota::query($dev, $uid); print "DEB: $uid - $dev - $bc - $bs - $bh - $bt\n"; } # ./test.pl layout1 DEB: /dev/sda1 Segmentation fault (core dumped) # strace ./test.pl layout1 2>&1|tail -4 stat64("/proc/sys/fs/quota", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0 quotactl(Q_GETQUOTA|USRQUOTA, "/dev/sda1"..., 1000, {bhardlimit=153600, bsoftlimit=102400, curspace=16805888, ihardlimit=0, isoftlimit=0, curinodes=2372, ...}) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV (core dumped) +++ # uname -a Linux localhost 2.6.18-xenU #1 SMP Fri Mar 14 16:25:33 EET 2008 x86_64 x86_64 x86_64 GNU/Linux # cat /etc/redhat-release CentOS release 5.2 (Final) # make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl Enter path to get quota for (NFS possible; default '.'): Using device/argument "/dev/sda1" Quotas are present on this filesystem (sync ok) Query this fs with default uid (which is real uid) 0 make: *** [test_dynamic] Segmentation fault (core dumped)
This issue only occurs when using a 32-bit perl executable on top of a 64-bit Linux kernel. In this case "struct dqblk" on side of the kernel is 4 bytes larger than in user-space (due to different padding by 64-bit C compilers) so that the stack gets corrupted when the result struct is copied into user-space. I've added a work-around in release Quota-1.6.3 to resolve this issue.