Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mp-3.0.0 and gsl-2.1 - Tests failed #86

Closed
sagitter opened this issue Mar 1, 2016 · 13 comments
Closed

mp-3.0.0 and gsl-2.1 - Tests failed #86

sagitter opened this issue Mar 1, 2016 · 13 comments

Comments

@sagitter
Copy link

sagitter commented Mar 1, 2016

Hi all,

I'm compiling mp-2.1.0 (source code https://github.com/ampl/mp/archive/2.1.0.tar.gz) patched according to issue #85 .
Some tests are failed, I presume because of new gsl-2.1 used on Fedora; here the log:
https://kojipkgs.fedoraproject.org//work/tasks/7848/13187848/build.log

I used this patch to compile MP-2.1.0 against gsl-2.1 (compiler GCC6):

-- src/gsl/amplgsl.orig.c   2016-02-12 18:50:00.000000000 +0100
+++ src/gsl/amplgsl.c   2016-02-29 18:43:46.261287098 +0100
@@ -1490,7 +1490,7 @@
 }

 WRAP_CHECKED(gsl_sf_ellint_P, ARGS3_PREC)
-WRAP_CHECKED(gsl_sf_ellint_D, ARGS3_PREC)
+WRAP_CHECKED(gsl_sf_ellint_D, ARGS2_PREC)
 WRAP_CHECKED(gsl_sf_ellint_RC, ARGS2_PREC)
 WRAP_CHECKED(gsl_sf_ellint_RD, ARGS3_PREC)
 WRAP_CHECKED(gsl_sf_ellint_RF, ARGS3_PREC)
@@ -3959,7 +3959,7 @@
    *
    * The argument $n$ is not used and will be removed in a future release.
    */
-  ADDFUNC(gsl_sf_ellint_D, 3);
+  ADDFUNC(gsl_sf_ellint_D, 2);

   /**
    * Carlson Forms

and replaced old functions in src/gsl/amplgsl.c:

sed -e 's|gsl_sf_mathieu_a|gsl_sf_mathieu_a_e|g' -i src/gsl/amplgsl.c
sed -e 's|gsl_sf_mathieu_b|gsl_sf_mathieu_b_e|g' -i src/gsl/amplgsl.c
sed -e 's|gsl_sf_mathieu_se|gsl_sf_mathieu_se_e|g' -i src/gsl/amplgsl.c
sed -e 's|gsl_sf_mathieu_ce|gsl_sf_mathieu_ce_e|g' -i src/gsl/amplgsl.c
sed -e 's|gsl_sf_mathieu_Ms|gsl_sf_mathieu_Ms_e|g' -i src/gsl/amplgsl.c
sed -e 's|gsl_sf_mathieu_Mc|gsl_sf_mathieu_Mc_e|g' -i src/gsl/amplgsl.c

Please, preview this issue.

@sagitter
Copy link
Author

sagitter commented Mar 2, 2016

Old functions must be replaced also in test/gsl-test.cc, I seen, to fix gsl-test.

...
3: [ RUN      ] GSLTest.Mathieu
3: unknown file: Failure
3: C++ exception with description "function not found: gsl_sf_mathieu_a" thrown in the test body.
3: [  FAILED  ] GSLTest.Mathieu (1 ms)
...

About SegFault errors, it looks related to optimization flag used by compiler; by removing -O2 flag, tests do not fail.

@vitaut
Copy link
Contributor

vitaut commented Mar 3, 2016

Thanks for yet another bug report. The segfaults are troubling; I've tried to reproduce them on GCC 6 but with no luck so far. Could you by any chance provide a stack trace for nl-test?

@vitaut
Copy link
Contributor

vitaut commented Mar 3, 2016

Also do the segfaults happen on master or only on 2.1?

@sagitter
Copy link
Author

sagitter commented Mar 3, 2016

segfaults happen also on mp-3.0.0 (other than 2.1.1).

Is it helpful a strace output? (I don't see any nl-test)
http://fpaste.org/333118/

@sagitter sagitter changed the title mp-2.1.0 and gsl-2.1 - Tests failed mp-3.0.0 and gsl-2.1 - Tests failed Mar 3, 2016
@vitaut
Copy link
Contributor

vitaut commented Mar 3, 2016

nl-test has been renamed to nl-reader-test in 3.0. Unfortunately, strace doesn't seem to help. Does it happen on Fedora 24 and can I get a Docker image of it somewhere to reproduce the issue myself?

@sagitter
Copy link
Author

sagitter commented Mar 3, 2016

Output of nl-reader-test by strace -k command:
http://fpaste.org/333244/

If you want execute Fedora 24 on a virtual machine, there are some iso mages for testing.

@vitaut
Copy link
Contributor

vitaut commented Mar 4, 2016

OK, I've managed to reproduce the segfaults on Fedora Rawhide taken from https://hub.docker.com/_/fedora/. Will look into it.

@vitaut
Copy link
Contributor

vitaut commented Mar 4, 2016

Valgrind reports the following error on expr-test:

==7937== Invalid read of size 8
==7937==    at 0x45B287: GetValueAndDelete (gmock.h:9933)
==7937==    by 0x45B287: InvokeWith (gmock.h:10090)
==7937==    by 0x45B287: Invoke (gmock.h:10425)
==7937==    by 0x45B287: deallocate (mock-allocator.h:40)
==7937==    by 0x45B287: deallocate (mock-allocator.h:97)
==7937==    by 0x45B287: Deallocate<const mp::internal::ExprBase::Impl*> (expr.h:1022)
==7937==    by 0x45B287: mp::BasicExprFactory<AllocatorRef<MockAllocator, char> >::~BasicExprFactory() (expr.h:761)
==7937==    by 0x44EC36: ExprFactoryTest_ExprMemoryAllocation_Test::TestBody() (expr-test.cc:905)
==7937==    by 0x49F453: HandleSehExceptionsInMethodIfSupported<testing::Test, void> (gmock-gtest-all.cc:3563)
==7937==    by 0x49F453: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gmock-gtest-all.cc:3599)
==7937==    by 0x495F99: testing::Test::Run() (gmock-gtest-all.cc:3636)
==7937==    by 0x4960E7: testing::TestInfo::Run() (gmock-gtest-all.cc:3811)
==7937==    by 0x4961C4: testing::TestCase::Run() (gmock-gtest-all.cc:3929)
==7937==    by 0x496476: testing::internal::UnitTestImpl::RunAllTests() (gmock-gtest-all.cc:5800)
==7937==    by 0x49F8D3: HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (gmock-gtest-all.cc:3563)
==7937==    by 0x49F8D3: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gmock-gtest-all.cc:3599)
==7937==    by 0x49678F: testing::UnitTest::Run() (gmock-gtest-all.cc:5411)
==7937==    by 0x444C4E: RUN_ALL_TESTS (gtest.h:20059)
==7937==    by 0x444C4E: main (test-main.cc:37)
==7937==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

@sagitter
Copy link
Author

sagitter commented Mar 4, 2016

Is just expr-test failing ?

@vitaut
Copy link
Contributor

vitaut commented Mar 4, 2016

Not only expr-test. It appears to the a bug in Google Test: google/googletest#705

@vitaut
Copy link
Contributor

vitaut commented Mar 4, 2016

The segfaults in tests should be fixed by 9fdb514. Also mp-3.0.0 should be compatible with gsl-2.1.

@sagitter
Copy link
Author

sagitter commented Mar 4, 2016

I confirm.
Fixed.

Thank you.

@vitaut
Copy link
Contributor

vitaut commented Mar 4, 2016

Great, thanks for the confirmation!

@vitaut vitaut closed this as completed Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants