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

Frequent need to restart #507

Open
JoelSjogren opened this issue Dec 18, 2023 · 4 comments
Open

Frequent need to restart #507

JoelSjogren opened this issue Dec 18, 2023 · 4 comments

Comments

@JoelSjogren
Copy link
Contributor

Hello, I frequently need to restart the kernel in order to avoid this sort of error message when evaluating a cell:

In file included from input_line_1:1:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/new:41:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/exception:147:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/exception_ptr.h:43:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/move.h:57:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits:144:31: error: no member named 'value' in 'std::__not_<std::is_lvalue_reference<std::basic_ostream<char> &> >'
    : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
                         ~~~~~^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/ostream:767:24: note: in instantiation of template class 'std::__and_<std::__not_<std::is_lvalue_reference<std::basic_ostream<char> &> >, std::__is_convertible_to_basic_ostream<std::basic_ostream<char> &>, std::__is_insertable<std::basic_ostream<char> &, const bool &, void> >' requested here
    typename enable_if<__and_<__not_<is_lvalue_reference<_Ostream>>,
                       ^
input_line_50:4:6: note: while substituting deduced template arguments into function template 'operator<<' [with _Ostream = std::basic_ostream<char> &, _Tp = bool]
cout << is_base_of<A, B>::value << endl;
     ^
input_line_50:5:9: error: no member named 'value' in 'std::is_base_of<B, __cling_N537::A>'; did you mean 'std::is_base_of<A, B>::value'?
cout << is_base_of<B, A>::value << endl;
        ^~~~~~~~~~~~~~~~~~~~~~~
        std::is_base_of<A, B>::value
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits:59:45: note: 'std::is_base_of<A, B>::value' declared here
      static constexpr _Tp                  value = __v;
                                            ^

Interpreter Error: 

I have noticed that std::__not_ is always part of this message but I don't know what the message means in whole.

In this case I was playing around with code like the following but it is a really general issue.

#include <type_traits>

struct A {};
struct B : A {};

cout << is_base_of<A, B>::value << endl;
cout << is_base_of<B, A>::value << endl;
@JoelSjogren
Copy link
Contributor Author

Another kind of error that I sometimes get and which is fixed by restarting is this.

In file included from input_line_11:1:
/home/joel/miniforge3/envs/cling/include/xcpp/xmime.hpp:49:30: error: no viable overloaded '='
        bundle["text/plain"] = cling::printValue(&value);
        ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
input_line_95:2:2: note: in instantiation of function template specialization 'xcpp::mime_bundle_repr<long>' requested here
 mime_bundle_repr(*((long*)0x7ffdab631e88));
 ^
/home/joel/miniforge3/envs/cling/include/nlohmann/json.hpp:1219:17: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >' for 1st argument
    basic_json& operator=(basic_json other) noexcept (

(That is to say, always something about nlohmann's json library with this kind of repeatedly occurring error.)

In the case of what happened right now my cell looked like this to provoke this error:

cout.precision(1000000);
cout << 3.141592653589793238;
cout.precision(6);  // default value

@JoelSjogren
Copy link
Contributor Author

Another error that was solved by restarting:

In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:65:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2280:41: error: indirection requires pointer operand ('__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >' invalid)
      return __i != __last && !(__val < *__i);
                                        ^~~~
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
 binary_search(v.begin(), v.end(), 16);
 ^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:66:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_iterator_base_funcs.h:181:2: error: cannot increment value of type '__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >'
        ++__i;
        ^ ~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_iterator_base_funcs.h:206:12: note: in instantiation of function template specialization 'std::__advance<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, long>' requested here
      std::__advance(__i, __d, std::__iterator_category(__i));
           ^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1321:9: note: in instantiation of function template specialization 'std::advance<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, long>' requested here
          std::advance(__middle, __half);
               ^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
        = std::__lower_bound(__first, __last, __val,
               ^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
 binary_search(v.begin(), v.end(), 16);
 ^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1325:8: error: cannot increment value of type '__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >'
              ++__first;
              ^ ~~~~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
        = std::__lower_bound(__first, __last, __val,
               ^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
 binary_search(v.begin(), v.end(), 16);
 ^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:71:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/predefined_ops.h:67:16: error: indirection requires pointer operand ('__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >' invalid)
      { return *__it < __val; }
               ^~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1322:8: note: in instantiation of function template specialization '__gnu_cxx::__ops::_Iter_less_val::operator()<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, const int>' requested here
          if (__comp(__middle, __val))
              ^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
        = std::__lower_bound(__first, __last, __val,
               ^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
 binary_search(v.begin(), v.end(), 16);
 ^

Interpreter Error: 

Here I was running these cells (error on second cell):

vector<int> v = range(10, 20);
cout << v;
binary_search(v.begin(), v.end(), 16);

@JoelSjogren
Copy link
Contributor Author

Similar error fixed after kernel restart:

input_line_61:5:21: error: no viable conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'list<int>::iterator' (aka '_List_iterator<int>')
list<int>::iterator it = li2.begin();
                    ^    ~~~~~~~~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_list.h:185:12: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'const std::_List_iterator<int> &' for 1st argument
    struct _List_iterator
           ^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_list.h:185:12: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'std::_List_iterator<int> &&' for 1st argument

Interpreter Error: 
#include <vector>
#include <list>
using namespace std;

vector<int> vi = { 45, 2, 9, 0, -2, 155 };
list<int> li2 = { 0, 1, 2, 3, 4, 5, 6 };
list<int>::iterator it = li2.begin();
for (int i = 0; i < 3; i++) it++;
copy(vi.begin(), vi.end(), inserter(li2, it));

Will stop posting examples now.

@carlosal1015
Copy link

carlosal1015 commented Dec 31, 2023

No errors from my side for first two. Third snippet as C++ program is not compiling with C++20.

image

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