potassco / clingo

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

Hide more symbols in ELF shared libs #447

Closed haampie closed 1 year ago

haampie commented 1 year ago

In Spack we'd like to distribute optimized libclingo.so, to be dlopened by Python. In practice two optimizations make a big difference: (a) profile-guided optimization and (b) use of mimalloc as an allocator.

To make (b) work, we either have to use a custom allocator in the code base, which is a lot of work, or override operator new and friends locally with mimalloc's version. The latter is pretty easy, but we have to deal with some load order issues when using libclingo from Python: if another module gets imported and pulls in libstdc++, libclingo would be using libstdc++'s operator new instead of mimalloc's.

So, the current solution is to put mimalloc's operator new symbol inside of libclingo.so, statically link libstdc++ (doesn't error about duplicate symbols), and make all non-clingo C++ symbols local to the library.

The latter requires a version script, cause -fvisibility=hidden affects compilation, but not symbols of statically linked libraries. Even if we use the mimalloc implementation header in a clingo source file, -fvisibility=hidden doesn't help, cause mimalloc marks operator new as visible.

Long story short: this PR adds a linker script and ensures that only clingo_*, gringo_* and g_clingo_* are global, to also hide symbols that aren't coming from clingo sources.

Global symbols ```c clingo_add_string clingo_assignment_at clingo_assignment_decision clingo_assignment_decision_level clingo_assignment_has_conflict clingo_assignment_has_literal clingo_assignment_is_false clingo_assignment_is_fixed clingo_assignment_is_total clingo_assignment_is_true clingo_assignment_level clingo_assignment_root_level clingo_assignment_size clingo_assignment_trail_at clingo_assignment_trail_begin clingo_assignment_trail_end clingo_assignment_trail_size clingo_assignment_truth_value clingo_ast_acquire clingo_ast_attribute_delete_ast_at clingo_ast_attribute_delete_string_at clingo_ast_attribute_get_ast clingo_ast_attribute_get_ast_at clingo_ast_attribute_get_location clingo_ast_attribute_get_number clingo_ast_attribute_get_optional_ast clingo_ast_attribute_get_string clingo_ast_attribute_get_string_at clingo_ast_attribute_get_symbol clingo_ast_attribute_insert_ast_at clingo_ast_attribute_insert_string_at clingo_ast_attribute_set_ast clingo_ast_attribute_set_ast_at clingo_ast_attribute_set_location clingo_ast_attribute_set_number clingo_ast_attribute_set_optional_ast clingo_ast_attribute_set_string clingo_ast_attribute_set_string_at clingo_ast_attribute_set_symbol clingo_ast_attribute_size_ast_array clingo_ast_attribute_size_string_array clingo_ast_attribute_type clingo_ast_build clingo_ast_copy clingo_ast_deep_copy clingo_ast_equal clingo_ast_get_type clingo_ast_has_attribute clingo_ast_hash clingo_ast_less_than clingo_ast_parse_files clingo_ast_parse_string clingo_ast_release clingo_ast_to_string clingo_ast_to_string_size clingo_ast_unpool clingo_backend_acyc_edge clingo_backend_add_atom clingo_backend_assume clingo_backend_begin clingo_backend_end clingo_backend_external clingo_backend_heuristic clingo_backend_minimize clingo_backend_project clingo_backend_rule clingo_backend_theory_atom clingo_backend_theory_atom_with_guard clingo_backend_theory_element clingo_backend_theory_term_function clingo_backend_theory_term_number clingo_backend_theory_term_sequence clingo_backend_theory_term_string clingo_backend_theory_term_symbol clingo_backend_weight_rule clingo_configuration_array_at clingo_configuration_array_size clingo_configuration_description clingo_configuration_map_at clingo_configuration_map_has_subkey clingo_configuration_map_size clingo_configuration_map_subkey_name clingo_configuration_root clingo_configuration_type clingo_configuration_value_get clingo_configuration_value_get_size clingo_configuration_value_is_assigned clingo_configuration_value_set clingo_control_add clingo_control_assign_external clingo_control_backend clingo_control_clasp_facade clingo_control_cleanup clingo_control_configuration clingo_control_free clingo_control_get_const clingo_control_get_enable_cleanup clingo_control_get_enable_enumeration_assumption clingo_control_ground clingo_control_has_const clingo_control_interrupt clingo_control_is_conflicting clingo_control_load clingo_control_new clingo_control_register_observer clingo_control_register_propagator clingo_control_release_external clingo_control_set_enable_cleanup clingo_control_set_enable_enumeration_assumption clingo_control_solve clingo_control_statistics clingo_control_symbolic_atoms clingo_control_theory_atoms clingo_error_code clingo_error_message clingo_error_string clingo_main clingo_main_ clingo_model_contains clingo_model_context clingo_model_cost clingo_model_cost_size clingo_model_extend clingo_model_is_true clingo_model_number clingo_model_optimality_proven clingo_model_symbols clingo_model_symbols_size clingo_model_thread_id clingo_model_type clingo_options_add clingo_options_add_flag clingo_parse_term clingo_program_builder_add clingo_program_builder_begin clingo_program_builder_end clingo_program_builder_init clingo_propagate_control_add_clause clingo_propagate_control_add_literal clingo_propagate_control_add_watch clingo_propagate_control_assignment clingo_propagate_control_has_watch clingo_propagate_control_propagate clingo_propagate_control_remove_watch clingo_propagate_control_thread_id clingo_propagate_init_add_clause clingo_propagate_init_add_literal clingo_propagate_init_add_minimize clingo_propagate_init_add_watch clingo_propagate_init_add_watch_to_thread clingo_propagate_init_add_weight_constraint clingo_propagate_init_assignment clingo_propagate_init_freeze_literal clingo_propagate_init_get_check_mode clingo_propagate_init_number_of_threads clingo_propagate_init_propagate clingo_propagate_init_remove_watch clingo_propagate_init_remove_watch_from_thread clingo_propagate_init_set_check_mode clingo_propagate_init_solver_literal clingo_propagate_init_symbolic_atoms clingo_propagate_init_theory_atoms clingo_register_script clingo_script_version clingo_set_error clingo_signature_arity clingo_signature_create clingo_signature_hash clingo_signature_is_equal_to clingo_signature_is_less_than clingo_signature_is_negative clingo_signature_is_positive clingo_signature_name clingo_solve_control_add_clause clingo_solve_control_symbolic_atoms clingo_solve_handle_cancel clingo_solve_handle_close clingo_solve_handle_core clingo_solve_handle_get clingo_solve_handle_model clingo_solve_handle_resume clingo_solve_handle_wait clingo_statistics_array_at clingo_statistics_array_push clingo_statistics_array_size clingo_statistics_map_add_subkey clingo_statistics_map_at clingo_statistics_map_has_subkey clingo_statistics_map_size clingo_statistics_map_subkey_name clingo_statistics_root clingo_statistics_type clingo_statistics_value_get clingo_statistics_value_set clingo_symbol_arguments clingo_symbol_create_function clingo_symbol_create_id clingo_symbol_create_infimum clingo_symbol_create_number clingo_symbol_create_string clingo_symbol_create_supremum clingo_symbol_hash clingo_symbolic_atoms_begin clingo_symbolic_atoms_end clingo_symbolic_atoms_find clingo_symbolic_atoms_is_external clingo_symbolic_atoms_is_fact clingo_symbolic_atoms_is_valid clingo_symbolic_atoms_iterator_is_equal_to clingo_symbolic_atoms_literal clingo_symbolic_atoms_next clingo_symbolic_atoms_signatures clingo_symbolic_atoms_signatures_size clingo_symbolic_atoms_size clingo_symbolic_atoms_symbol clingo_symbol_is_equal_to clingo_symbol_is_less_than clingo_symbol_is_negative clingo_symbol_is_positive clingo_symbol_name clingo_symbol_number clingo_symbol_string clingo_symbol_to_string clingo_symbol_to_string_size clingo_symbol_type clingo_theory_atoms_atom_elements clingo_theory_atoms_atom_guard clingo_theory_atoms_atom_has_guard clingo_theory_atoms_atom_literal clingo_theory_atoms_atom_term clingo_theory_atoms_atom_to_string clingo_theory_atoms_atom_to_string_size clingo_theory_atoms_element_condition clingo_theory_atoms_element_condition_id clingo_theory_atoms_element_to_string clingo_theory_atoms_element_to_string_size clingo_theory_atoms_element_tuple clingo_theory_atoms_size clingo_theory_atoms_term_arguments clingo_theory_atoms_term_name clingo_theory_atoms_term_number clingo_theory_atoms_term_to_string clingo_theory_atoms_term_to_string_size clingo_theory_atoms_term_type clingo_version clingo_warning_string g_clingo_ast_attribute_names g_clingo_ast_constructors gringo_main_ ```
rkaminsk commented 1 year ago

This looks okay. I think it is fine to just export the clingo related C symbols. I am just not sure if it is necessary to enable this in general. The advantage seems to be limited to your specific case where there are other static libraries contained within libclingo. Not enabling by default might prevent breakage (even though I don't see a reason) elsewhere. :smile:

haampie commented 1 year ago

I sort of agree, but I decided to open the PR anyways because it's cleaner in general, given that even when doing shared linking against libstdc++, still around ~110 C++ symbols end up as public in the library:

$ nm --defined-only --extern-only libclingo.so | awk '{ print $3; }' | c++filt | wc -l
359
List of exported C++ symbols ``` std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::find(unsigned int const&) const std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::find(unsigned long const&) const std::ctype::do_widen(char) const std::_Rb_tree, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::_Identity, std::allocator > >, std::less, std::allocator > >, std::allocator, std::allocator > > >::find(std::__cxx11::basic_string, std::allocator > const&) const std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_rehash(unsigned long, unsigned long const&) std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_rehash(unsigned long, unsigned long const&) std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::equal_range(unsigned int const&) std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_insert_multi_node(std::__detail::_Hash_node, false>*, unsigned long, std::__detail::_Hash_node, false>*) std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::~_Hashtable() std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::~_Hashtable() std::_Hashtable, std::allocator >, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_rehash(unsigned long, unsigned long const&) std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node*, unsigned long) std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::find(unsigned long const&) std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_rehash(unsigned long, unsigned long const&) std::_Hashtable, std::allocator >, std::pair, std::allocator > const, unsigned int>, std::allocator, std::allocator > const, unsigned int> >, std::__detail::_Select1st, std::equal_to, std::allocator > >, std::hash, std::allocator > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::_M_rehash(unsigned long, unsigned long const&) std::unique_lock::unlock() void std::_Destroy_aux::__destroy(Gringo::TheoryAtomDef*, Gringo::TheoryAtomDef*) void std::__exception_ptr::__dest_thunk(void*) std::__exception_ptr::exception_ptr::~exception_ptr() std::__exception_ptr::exception_ptr::~exception_ptr() std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use_cold() std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::_M_destroy() std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::_M_dispose() std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&) std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::~_Sp_counted_ptr_inplace() std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::~_Sp_counted_ptr_inplace() std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::~_Sp_counted_ptr_inplace() std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > >::_M_run() std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > >::~_State_impl() std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > >::~_State_impl() std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > >::~_State_impl() std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > >::_M_run() std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > >::~_State_impl() std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > >::~_State_impl() std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > >::~_State_impl() void std::vector >::emplace_back(char&&) std::vector >::_M_default_append(unsigned long) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, int&&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, unsigned int&) void std::vector >::emplace_back(unsigned int&&) void std::vector >::emplace_back(unsigned int&) std::vector >::_M_default_append(unsigned long) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, unsigned int&&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, unsigned int&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, unsigned int const&) std::vector >::reserve(unsigned long) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, long const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TermVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::BdLitVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::BoundVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::RelLitVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::CondLitVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TermVecVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryAtomUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryTermUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryOpDefUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryOpVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryDefVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryOptermUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::BdAggrElemVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::HdAggrElemVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryAtomDefUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryElemVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryTermDefUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryOpDefVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TheoryOptermVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::LitUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::TermUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::HdLitUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::IdVecUid const&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, Gringo::Input::LitVecUid const&) std::vector, std::allocator >, std::allocator, std::allocator > > >::_M_default_append(unsigned long) void std::vector, std::allocator >, std::allocator, std::allocator > > >::_M_realloc_insert, std::allocator > const&>(__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >, std::__cxx11::basic_string, std::allocator > const&) void std::vector, std::allocator >, std::allocator, std::allocator > > >::_M_realloc_insert, std::allocator > >(__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >, std::__cxx11::basic_string, std::allocator >&&) std::vector, std::allocator >, std::allocator, std::allocator > > >::~vector() std::vector, std::allocator >, std::allocator, std::allocator > > >::~vector() void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, char*&&) void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, char const* const&) void std::vector >, std::allocator > > >::_M_realloc_insert<>(__gnu_cxx::__normal_iterator >*, std::vector >, std::allocator > > > >) void std::vector >, std::allocator > > >::_M_realloc_insert(__gnu_cxx::__normal_iterator >*, std::vector >, std::allocator > > > >, int const*&&, int const*&&) void std::vector >, std::allocator > > >::_M_realloc_insert(__gnu_cxx::__normal_iterator >*, std::vector >, std::allocator > > > >, char*&&) void std::vector, std::allocator > >::emplace_back(unsigned int&, unsigned int&&) void std::vector, std::allocator > >::emplace_back >(std::pair&&) void std::vector, std::allocator > >::_M_realloc_insert(__gnu_cxx::__normal_iterator*, std::vector, std::allocator > > >, unsigned int&, unsigned int&&) void std::vector, std::allocator > >::_M_realloc_insert >(__gnu_cxx::__normal_iterator*, std::vector, std::allocator > > >, std::pair&&) void std::vector > >, std::allocator > > > >::_M_realloc_insert > >(__gnu_cxx::__normal_iterator > >*, std::vector > >, std::allocator > > > > >, unsigned int&&, std::vector >&&) void std::vector, std::allocator > >::_M_realloc_insert >(__gnu_cxx::__normal_iterator*, std::vector, std::allocator > > >, std::pair&&) void std::__cxx11::list >::sort(Clasp::ClaspVmtf::LessLevel) std::pair, std::allocator > >, bool> std::_Rb_tree, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::_Identity, std::allocator > >, std::less, std::allocator > >, std::allocator, std::allocator > > >::_M_insert_unique, std::allocator > const&>(std::__cxx11::basic_string, std::allocator > const&) std::_Rb_tree, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::_Identity, std::allocator > >, std::less, std::allocator > >, std::allocator, std::allocator > > >::_M_get_insert_unique_pos(std::__cxx11::basic_string, std::allocator > const&) std::pair, std::allocator > const, unsigned long> >, bool> std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, unsigned long>, std::_Select1st, std::allocator > const, unsigned long> >, std::less, std::allocator > >, std::allocator, std::allocator > const, unsigned long> > >::_M_insert_unique, std::allocator > const, unsigned long> >(std::pair, std::allocator > const, unsigned long>&&) unsigned int* std::__rotate_adaptive(unsigned int*, unsigned int*, unsigned int*, long, long, unsigned int*, long) typeinfo for std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > > typeinfo for std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > > typeinfo for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2> typeinfo for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2> typeinfo for std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2> typeinfo name for std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > > typeinfo name for std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > > typeinfo name for std::_Mutex_base<(__gnu_cxx::_Lock_policy)2> typeinfo name for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2> typeinfo name for std::_Sp_make_shared_tag typeinfo name for std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2> vtable for std::thread::_State_impl, Clasp::ClaspFacade::SolveStrategy::Async*, Clasp::SolveMode_t::E> > > vtable for std::thread::_State_impl, Clasp::mt::ParallelSolve*, unsigned int> > > vtable for std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2> std::_Sp_make_shared_tag::_S_ti()::__tag std::__detail::__to_chars_10_impl(char*, unsigned int, unsigned int)::__digits std::__detail::__to_chars_10_impl(char*, unsigned int, unsigned long)::__digits ```
haampie commented 1 year ago

Dug into the pros and cons a bit further: to be able to catch exceptions in a different binary from libclingo.so, you need visible typeinfo for each exception type in libclingo.

If libclingo.so is supposed to be basically a C library, I guess that's not an issue.

rkaminsk commented 1 year ago

Dug into the pros and cons a bit further: to be able to catch exceptions in a different binary from libclingo.so, you need visible typeinfo for each exception type in libclingo.

If libclingo.so is supposed to be basically a C library, I guess that's not an issue.

All exceptions are caught internally. Anything else is a bug.

rkaminsk commented 1 year ago

We can just give it a try. If there are issues on some platform, it is still possible to switch to a more conservative change.

rkaminsk commented 1 year ago

I (again) missed that this PR was against the master. All PRs have to go to the wip branch first. Can you please reopen?

haampie commented 1 year ago

See #449, perhaps set the default branch to wip?

rkaminsk commented 1 year ago

See #449, perhaps set the default branch to wip?

I wanted the latest stable code to be shown but PR against the wip.