Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

make test FAILs at error: "Assertion `num_prompts_shown == expected_prompts_shown' failed.; Invalid verification code" #470

Closed
ghost opened this issue Dec 28, 2014 · 17 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Dec 28, 2014

checking out latest source

git clone https://code.google.com/p/google-authenticator
git log | head
    commit 1d0bf2e6cff7a5e503580d29ca33634ce09386ca
    Author: Thomas Habets <habets@google.com>
    Date:   Fri Feb 14 17:17:42 2014 +0000

        Add space in config file between quote and RATE_LIMIT, like spec says.

    commit 86af4c32a2940b13397cac52eee435e6acedb8a5
    Author: Thomas Habets <habets@google.com>
    Date:   Thu Jan 30 15:17:38 2014 +0000

building on

lsb_release -rd
    Description:    openSUSE 13.2 (Harlequin) (x86_64)
    Release:        13.2

with

gcc -V
    gcc: error: unrecognized command line option ‘-V’
    gcc: fatal error: no input files
    compilation terminated.
    [1083][root@onyxEdgar: ../src/google-authenticator]$ gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/5/lto-wrapper
    Target: x86_64-suse-linux
    Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada,go --with-gxx-include-dir=/usr/include/c++/5 --enable-ssp --disable-libssp --disable-libvtv --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-5 --without-system-libunwind --enable-multilib --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
    Thread model: posix
    gcc version 5.0.0 20141215 (experimental) [trunk revision 218749] (SUSE Linux) 

completes ok

cd google-authenticator/libpam
make
    (no errors)

but test FAILs

make test
    ./pam_google_authenticator_unittest
    Testing base32 encoding
    Testing base32 decoding
    Testing HMAC_SHA1
    Loading PAM module

    Running tests, querying for verification code
    Testing failed login attempt
    Testing required number of digits
    Testing a blank response
    Test handling of missing state files
    Testing successful login
    Testing WINDOW_SIZE option
    Testing DISALLOW_REUSE option
    Testing RATE_LIMIT option
    Testing TIME_SKEW
    pam_google_authenticator_unittest: pam_google_authenticator_unittest.c:137: verify_prompts_shown: Assertion `num_prompts_shown == expected_prompts_shown' failed.
    Invalid verification code
    Makefile:36: recipe for target 'test' failed
    make: *** [test] Error 1

seems to have been raised before,

[CentOS] CentOS 5.9 and google-authenticator
http://lists.centos.org/pipermail/centos/2013-June/135586.html

but, afaict, no resolution there

@ThomasHabets ThomasHabets self-assigned this Dec 28, 2014
@ThomasHabets
Copy link
Contributor

The CentOS bug you linked to says it works on 64bit, but you seem to have this problem on 64bit, is that right?

Could you retry at current HEAD, with "make check"?

@ghost
Copy link
Author

ghost commented Dec 28, 2014

The CentOS bug you linked to says it works on 64bit, but you seem to have this problem on 64bit,
is that right?

Yes, I see the issue on 64-bit -- Opensuse, though, not Centos

Could you retry at current HEAD, with "make check"?

sure ...

switching from previous

git clone https://code.google.com/p/google-authenticator

to

git clone https://github.com/google/google-authenticator.git

cd /usr/local/src/google-authenticator
cd libpam
git log | head
    commit 45ed12f924bdfed502811dae65108401d1df2d72
    Author: Thomas Habets <habets@google.com>
    Date:   Wed Oct 15 16:34:01 2014 +0100

        List exported names in linker instead of code.

    commit 3bac7340462102290db2f1df0aaac855857e4066
    Author: Thomas Habets <habets@google.com>
    Date:   Wed Oct 15 10:36:50 2014 +0100

build FAILs as above

./bootstrap.sh
./configure \
--enable-shared --disable-static \
--with-gnu-ld
    ...
      google-authenticator version 1.01
      Prefix.........: /usr/local
      Debug Build....: 
      C Compiler.....: /usr/bin/gcc-5 -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=corei7 -mtune=corei7 -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=corei7 -mtune=corei7
      Linker.........: /usr/bin/ld -m elf_x86_64  -ldl 

make check
    ============================================================================
    Testsuite summary for google-authenticator 1.01
    ============================================================================
    # TOTAL: 1
    # PASS:  0
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    See ./test-suite.log
    Please report to habets@google.com
    ============================================================================
    Makefile:1100: recipe for target 'test-suite.log' failed
    make[2]: *** [test-suite.log] Error 1
    make[2]: Leaving directory '/usr/local/src/google-authenticator/libpam'
    Makefile:1206: recipe for target 'check-TESTS' failed
    make[1]: *** [check-TESTS] Error 2
    make[1]: Leaving directory '/usr/local/src/google-authenticator/libpam'
    Makefile:1412: recipe for target 'check-am' failed
    make: *** [check-am] Error 2

cat ./test-suite.log
    =================================================
       google-authenticator 1.01: ./test-suite.log
    =================================================

    # TOTAL: 1
    # PASS:  0
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0

    .. contents:: :depth: 2

    FAIL: pam_google_authenticator_unittest
    =======================================

    pam_google_authenticator_unittest: pam_google_authenticator_unittest.c:137: verify_prompts_shown: Assertion `num_prompts_shown == expected_prompts_shown' failed.
    Invalid verification code

@ThomasHabets
Copy link
Contributor

I installed OpenSUSE in a virtual machine and am unable to reproduce this. I see you run a pre-release snapshot gcc 5, and that particular version doesn't seem to be downloadable. Also the latest GCC 5 snapshot doesn't build at all on my machine.

Could you try with a released GCC?

@ghost
Copy link
Author

ghost commented Dec 29, 2014

For future ref :-), GCC5 is readily installable on Opensuse from the 'devel;:gcc' repo at

http://software.opensuse.org/package/gcc5

with indiv pkgs @

http://download.opensuse.org/repositories/devel:/gcc/openSUSE_13.2/x86_64/

And, here's a repeat of the above, switching to

gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
    Target: x86_64-suse-linux
    Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-4.8 --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
    Thread model: posix
    gcc version 4.8.3 20141208 [gcc-4_8-branch revision 218481] (SUSE Linux) 

building. same revno

cd google-authenticator/libpam
git log | head
    commit 45ed12f924bdfed502811dae65108401d1df2d72
    Author: Thomas Habets <habets@google.com>
    Date:   Wed Oct 15 16:34:01 2014 +0100

        List exported names in linker instead of code.

    commit 3bac7340462102290db2f1df0aaac855857e4066
    Author: Thomas Habets <habets@google.com>
    Date:   Wed Oct 15 10:36:50 2014 +0100

still FAILs similarly

./bootstrap.sh
./configure \
--enable-shared --disable-static \
--with-gnu-ld
    ...
      google-authenticator version 1.01
      Prefix.........: /usr/local
      Debug Build....: 
      C Compiler.....: /usr/bin/gcc-4.8 -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=corei7 -mtune=corei7 -O2 -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=corei7 -mtune=corei7
      Linker.........: /usr/bin/ld -m elf_x86_64  -ldl 

make check
    ============================================================================
    Testsuite summary for google-authenticator 1.01
    ============================================================================
    # TOTAL: 1
    # PASS:  0
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    See ./test-suite.log
    Please report to habets@google.com
    ============================================================================
    Makefile:1100: recipe for target 'test-suite.log' failed
    make[2]: *** [test-suite.log] Error 1
    make[2]: Leaving directory '/usr/local/src/google-authenticator/libpam'
    Makefile:1206: recipe for target 'check-TESTS' failed
    make[1]: *** [check-TESTS] Error 2
    make[1]: Leaving directory '/usr/local/src/google-authenticator/libpam'
    Makefile:1412: recipe for target 'check-am' failed
    make: *** [check-am] Error 2

cat ./test-suite.log
    =================================================
       google-authenticator 1.01: ./test-suite.log
    =================================================

    # TOTAL: 1
    # PASS:  0
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0

    .. contents:: :depth: 2

    FAIL: pam_google_authenticator_unittest
    =======================================

    pam_google_authenticator_unittest: pam_google_authenticator_unittest.c:137: verify_prompts_shown: Assertion `num_prompts_shown == expected_prompts_shown' failed.
    Invalid verification code

@ghost
Copy link
Author

ghost commented Jan 7, 2015

were you looking for some other info?

@ThomasHabets
Copy link
Contributor

No, but I've been on vacation and haven't had the opportunity to try (again) to reproduce this yet.

@ghost
Copy link
Author

ghost commented Jan 7, 2015

np, just making sure I didn't drop the ball

@ghost ghost closed this as completed Jan 27, 2015
@ThomasHabets
Copy link
Contributor

Did you close this on purpose?

@ghost
Copy link
Author

ghost commented Jan 28, 2015

not intentionally, no. i was here checking to see if anything's changed -- might have been an errant click.

@ghost ghost reopened this Jan 28, 2015
@reedloden
Copy link
Contributor

To add to this, I see this on OS X as well. Same failure point (right after "Testing TIME_SKEW").

On my Ubuntu Linux machines, it works just fine, though.

Haven't have a chance to debug this at all...

@pantsman0
Copy link

I don't have much to add to the apart from what I have seen in my recent dev on the project.

make check succeeds on fc21 (GCC 4.9.2) and fails on fc23(GCC 5.3.1).

Having a short look into it reveals that the callback which increments num_prompts_shown (static int conversation(...) ) is being called during the noskewadj test when the test says that it shouldn't.

@ThomasHabets
Copy link
Contributor

Sorry for not making progress on this. It's just been low prio. Anyone who feels like it should feel free to have a look.

@reversefold
Copy link

I'm getting the same issue on my Gentoo machine. Always fails with the same error as above.

pam_google_authenticator_unittest: tests/pam_google_authenticator_unittest.c:528: main: Assertion `num_prompts_shown == (0)' failed.
{master//libpam} $ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.5/work/gcc-4.8.5/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.5 p1.3, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.8.5 (Gentoo 4.8.5 p1.3, pie-0.6.2)

@reversefold
Copy link

As far as I can tell my machines' times are correct and syncing with NTP, so it feels like some kind of mishandling of timezones to me.

@pantsman0
Copy link

pantsman0 commented Aug 20, 2016

Try `emerge -ev gcc' to rebuild and update gcc.
I built a Gentoo VM and it builds fine on that version (4.9.3 pl5)

EDIT: There's gotta be something else going on there. I ran merge =sys-devel/gcc-4.8.5 and rebuilt with that version, passing the tests.

@reversefold
Copy link

Interesting...I'd still been on x86_64-pc-linux-gnu-4.8.5. Changing to x86_64-pc-linux-gnu-4.9.3 (which was already installed, just not selected) made the test failure go away. Why would the version of gcc cause a failure like this?

{master//libpam} $ gcc -v                                                                                             Using built-in specs.                                                                                                 COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5/gcc                                                                COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.5/lto-wrapper                                            Target: x86_64-pc-linux-gnu                                                                                           Configured with: /var/tmp/portage/sys-devel/gcc-4.8.5/work/gcc-4.8.5/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.5 p1.3, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog --enable-libsanitizer        Thread model: posix                                                                                                   gcc version 4.8.5 (Gentoo 4.8.5 p1.3, pie-0.6.2)

@ThomasHabets
Copy link
Contributor

This issue was moved to google/google-authenticator-libpam#7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants