#4206 Bug in display mailbox size

1.620
closed-fixed
Jamie Cameron
5
2013-03-08
2013-03-04
Evolvia
No

Hi,

We have a bug on the webopage which display the user's list account to a domain.

When we activate the option "Show mailbox size in users list?" in the virtualmin configuration panel, the quota display in the user list is twice the real quota used.

You can find an example with the screenshoot.

In user list the display mailbox size is 43.84 MB but in the user detail page the quota mailbox size is only 21.92MB and on the server the real quota is 21.92MB.

We have the last verison of webmin 1.620 and the last version of virtualmin 3.99gpl

The system is FreeBSD 9.0 but the bug is also on FreeBSD 7.x and 8.x

Discussion

  • Evolvia
    Evolvia
    2013-03-04

    The bug is for all user on all domain not only on the user example.

    Quota (groupquota and userquota) are activated on /usr and /var and mailbox are stored in /var

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-05

    Thanks for the bug report!

    On your system, are users' mail files under /var/mail, or their home directories? And are they single mbox format files, or maildir-format directories?

     
  • Evolvia
    Evolvia
    2013-03-05

    user's mail are stored in /var/mail and the mail format is mbox

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-05

    Do you happen to know the block size on your filesystem? Virtualmin assumes that it is 1k on FreeBSD, but that may not be accurate.

     
  • Evolvia
    Evolvia
    2013-03-06

    Bug quota

     
    Attachments
  • Evolvia
    Evolvia
    2013-03-06

    Hi,

    The default block size on ufs file system on freebsd is 1K and the block size on my filesystem is 1K.

    I don't think that's a block size problem because in all other module, webmin and virtualmin quota display are right.

    The bug is only on the user_list.cgi webpage when we activate the option "Show mailbox size in users list"

    I post a new screenshoot to show the bug.

    This webpage has the url: http://localhost:10000/virtual-server/list_users.cgi?dom=xxxxxxxxxx

     
  • Evolvia
    Evolvia
    2013-03-06

    Hi,

    I don't know if it can help you but i have found this bug report on virtualmin project which is apparently the same.

    https://www.virtualmin.com/node/13447

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-06

    I think that other bug is for the opposite issue of the quota being shown too large.

    Could you run the commands :

    du /var/mail/someuser
    du -k /var/mail/someuser

    and post the output here? Those are what Virtualmin uses internally..

     
  • Evolvia
    Evolvia
    2013-03-07

    Hi,

    Ok you can find the result below.
    When i execute the command line on the webmin interface the display are:
    42.69Mo on the list_user.cgi page
    21.34Mo on the edit_user.cgi page

    And the command line oupt are:
    input: du /var/mail/xxxxx
    output: 21856

    input: du -k /var/mail/xxxx
    output: 21856

    I try too:
    input: du -m /var/mail/xxxx
    ouput: 22

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-07

    That all looks OK .. but some some reason, Perl seems to think that the file size in blocks is different to what du shows.

    Could you run the following command and post the output here :

    perl -e 'print join(" ", stat($ARGV[0])),"\n"' /var/mail/xxxx

     
  • Evolvia
    Evolvia
    2013-03-08

    Ok,

    when i run perl command, in the webpage quota display was: 43.44 MB, in edit_user.cgi quota display was: 21.72 MB

    And the perl command:
    input: perl -e 'print join(" ", stat($ARGV[0])),"\n"' /var/mail/xxxx

    output:
    77 188424 33188 1 1012 1005 762272 22746446 1362704000 1362724761 1362724761 4096 44480

     
  • Evolvia
    Evolvia
    2013-03-08

    I post the full config of perl.
    input: perl -V

    output:
    Summary of my perl5 (revision 5 version 12 subversion 4) configuration:

    Platform:
    osname=freebsd, osvers=9.0-release-p5, archname=i386-freebsd-64int
    uname='freebsd localhost 9.0-release-p5 freebsd 9.0-release-p5 #0: fri nov 23 07:39:48 cet 2012 root@localhost:usrobjusrsrcsysgeneric i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.12.4/mach -Dprivlib=/usr/local/lib/perl5/5.12.4 -Dman3dir=/usr/local/lib/perl5/5.12.4/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.12.4/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.12.4 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.12.4/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dinc_version_list=none -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.12.4/BSDPAN" -Doptimize=-O2 -pipe -march=prescott -fno-strict-aliasing -Ui_gdbm -Dusethreads=n -Dusemymalloc=n -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.12.4/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-O2 -pipe -march=prescott -fno-strict-aliasing',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.12.4/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 20070831 patched [FreeBSD]', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
    Linker and Libraries:
    ld='cc', ldflags ='-pthread -Wl,-E -fstack-protector -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil
    perllibs=-lm -lcrypt -lutil
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.12.4/mach/CORE'
    cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

    Characteristics of this binary (from libperl):
    Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_INT
    USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
    Built under freebsd
    Compiled at Nov 23 2012 08:29:17
    @INC:
    /usr/local/lib/perl5/5.12.4/BSDPAN
    /usr/local/lib/perl5/site_perl/5.12.4/mach
    /usr/local/lib/perl5/site_perl/5.12.4
    /usr/local/lib/perl5/5.12.4/mach
    /usr/local/lib/perl5/5.12.4

    Hi try with an old perl version 5.8 and that's the same bug, i post config too:
    input: perl -V
    output:
    Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
    Platform:
    osname=freebsd, osvers=8.0-release-p2, archname=i386-freebsd-64int
    uname='freebsd localhost 8.0-release-p2 freebsd 8.0-release-p2 #0: fri mar 26 11:09:27 cet 2010 root@localhost:usrobjusrsrcsysgeneric i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.9/mach -Dprivlib=/usr/local/lib/perl5/5.8.9 -Dman3dir=/usr/local/lib/perl5/5.8.9/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.9/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.9 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.9/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dinc_version_list=none -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN" -Doptimize=-O2 -pipe -fno-strict-aliasing -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
    Compiler:
    cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-O2 -pipe -fno-strict-aliasing',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='4.2.1 20070719 [FreeBSD]', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
    Linker and Libraries:
    ld='cc', ldflags =' -Wl,-E -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil
    perllibs=-lm -lcrypt -lutil
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.8.9/mach/CORE'
    cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'

    Characteristics of this binary (from libperl):
    Compile-time options: MYMALLOC PERL_MALLOC_WRAP USE_64_BIT_INT
    USE_FAST_STDIO USE_LARGE_FILES USE_PERLIO
    Locally applied patches:
    defined-or
    Built under freebsd
    Compiled at Mar 26 2010 11:30:43
    @INC:
    /usr/local/lib/perl5/5.8.9/BSDPAN
    /usr/local/lib/perl5/site_perl/5.8.9/mach
    /usr/local/lib/perl5/site_perl/5.8.9
    /usr/local/lib/perl5/5.8.9/mach
    /usr/local/lib/perl5/5.8.9

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-08

    Ok, I see the issue now - Virtualmin and Webmin assume that the block size on FreeBSD is 1k, but it is really 512 bytes (at least according to the stat command).

    I will fix this in the next release of Webmin.

     
  • Jamie Cameron
    Jamie Cameron
    2013-03-08

    • status: open --> closed-fixed
     
  • Evolvia
    Evolvia
    2013-03-10

    Hi,

    The patch didn't solve the bug :(

    With the freebsd-lib.pl, all display quota were divide by 2 but this patch didn't solve the display bug between the edit_user.cgi webpage and the list_users.cgi webpage.

    The list_user.cgi webpage display again a false quota used.
    And now all quota on webmin are divided by 2 and didn't display the real quota used.

    i try to create a new account upload a 1Mo file and the display quota is 512ko and not 1Mo.

    I think the bug isn't a question of blocksize.

    I try to create a new slice with -bs 1024 and the bug is always here.