potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
601 stars 79 forks source link

test failure #370

Closed Alessandro-Barbieri closed 2 years ago

Alessandro-Barbieri commented 2 years ago

Gentoo's CI had this test failure

Start testing: May 24 23:23 CEST
----------------------------------------------------------
1/4 Testing: test_reify
1/4 Test: test_reify
Command: "/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/bin/test_reify"
Directory: /var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/libreify/tests
"test_reify" start time: May 24 23:23 CEST
Output:
----------------------------------------------------------
===============================================================================
All tests passed (28 assertions in 1 test case)

<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Passed.
"test_reify" end time: May 24 23:23 CEST
"test_reify" time elapsed: 00:00:00
----------------------------------------------------------

3/4 Testing: test_clingo
3/4 Test: test_clingo
Command: "/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/bin/test_clingo"
Directory: /var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/libclingo/tests
"test_clingo" start time: May 24 23:23 CEST
Output:
----------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_clingo is a Catch v2.13.8 host application.
Run with -? for options

-------------------------------------------------------------------------------
solving
  with control
  set_statistics
-------------------------------------------------------------------------------
/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/libclingo/tests/clingo.cc:139
...............................................................................

/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/libclingo/tests/clingo.cc:153: FAILED:
  REQUIRE( stats["user_step.map"].type() == StatisticsType::Map )
due to unexpected exception with message:
  StatsMap::at with key 'map'

-------------------------------------------------------------------------------
solving
  with control
  events
-------------------------------------------------------------------------------
/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/libclingo/tests/clingo.cc:674
...............................................................................

/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/libclingo/tests/clingo.cc:700: FAILED:
  REQUIRE( f == 1 )
with expansion:
  0 == 1

===============================================================================
test cases:  10 |   9 passed | 1 failed
assertions: 734 | 732 passed | 2 failed

<end of output>
Test time =   0.08 sec
----------------------------------------------------------
Test Failed.
"test_clingo" end time: May 24 23:23 CEST
"test_clingo" time elapsed: 00:00:00
----------------------------------------------------------

4/4 Testing: test_clingo_app
4/4 Test: test_clingo_app
Command: "/usr/bin/python3.10" "/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/app/clingo/tests/run.py" "-c" "/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/bin/clingo" "run" "--"
Directory: /var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/app/clingo/tests
"test_clingo_app" start time: May 24 23:23 CEST
Output:
----------------------------------------------------------
/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/app/clingo/tests/run.py:124: DeprecationWarning: 'U' mode is deprecated
  with open(b + ".lp", 'rU') as inst_file:
/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/app/clingo/tests/run.py:143: DeprecationWarning: 'U' mode is deprecated
  with open(b + ".sol", 'rU') as sol_file:
/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2/app/clingo/tests/run.py:137: DeprecationWarning: 'U' mode is deprecated
  with open(b + ".cmd", 'rU') as cmd_file:
===============================================================================
All tests passed (12 test cases)
<end of output>
Test time =   0.23 sec
----------------------------------------------------------
Test Passed.
"test_clingo_app" end time: May 24 23:23 CEST
"test_clingo_app" time elapsed: 00:00:00
----------------------------------------------------------

2/4 Testing: test_gringo
2/4 Test: test_gringo
Command: "/var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/bin/test_gringo"
Directory: /var/tmp/portage/sci-mathematics/clingo-5.5.2/work/clingo-5.5.2_build/libgringo/tests
"test_gringo" start time: May 24 23:23 CEST
Output:
----------------------------------------------------------
===============================================================================
All tests passed (1731 assertions in 24 test cases)

<end of output>
Test time =   0.57 sec
----------------------------------------------------------
Test Passed.
"test_gringo" end time: May 24 23:23 CEST
"test_gringo" time elapsed: 00:00:00
----------------------------------------------------------

End testing: May 24 23:23 CEST

see https://bugs.gentoo.org/847319 log https://847319.bugs.gentoo.org/attachment.cgi?id=780596

rkaminsk commented 2 years ago

I have never seen these tests fail. It might be because something goes wrong because clasp is used as a shared library. This has never been tested. I'll try to reproduce.

rkaminsk commented 2 years ago

I think this is because of static functions defined in headers. The clasp and libpotassco headers have not been written to be used as a shared libraries. Using static libraries instead should work.

rkaminsk commented 2 years ago

Closing this. Clingo only supports linking to a static clasp/libpotassco libraries.

Alessandro-Barbieri commented 2 years ago

Isn't possible to remove the static keywords?

rkaminsk commented 2 years ago

Isn't possible to remove the static keywords?

No, it cannot easily be removed. Nor can the functions be moved into the source files because they are template functions. Such functions cannot be used across different shared libraries. This requires a different approach. A shared library should be designed from ground up.