You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some examples dont work (segfault and std::runtime_error) #316
I cloned the repo, made a build directory and made all of the examples. When trying to run them, however, certain ones worked and others didnt. The ones that simply segfaulted still displayed a plot. the ones that resulted in a runtime error didnt even show a plot.
$ ./basic
Saving result to ./basic.png
Segmentation fault (core dumped)
$ ./contour
Segmentation fault (core dumped)
$ ./fill
Segmentation fault (core dumped)
$ ./bar
Segmentation fault (core dumped)
$ ./colorbar
Segmentation fault (core dumped)
$ ./lines3d
Segmentation fault (core dumped)
$ ./minimal
Segmentation fault (core dumped)
$ ./surface
Segmentation fault (core dumped)
$ ./modern
Segmentation fault (core dumped)
$ ./spy
Segmentation fault (core dumped)
$ ./subplot2grid
Segmentation fault (core dumped)
$ ./update
Segmentation fault (core dumped)
$ ./xkcd
findfont: Font family ['xkcd', 'xkcd Script', 'Humor Sans', 'Comic Neue', 'Comic Sans MS'] not found. Falling back to DejaVu Sans.
findfont: Font family ['xkcd', 'xkcd Script', 'Humor Sans', 'Comic Neue', 'Comic Sans MS'] not found. Falling back to DejaVu Sans.
Segmentation fault (core dumped)
$ ./fill_inbetween
terminate called after throwing an instance of 'std::runtime_error'
what(): Call to show() failed.
Aborted (core dumped)
$ ./nonblock
terminate called after throwing an instance of 'std::runtime_error'
what(): Call to subplot() failed.
Aborted (core dumped)
I am seeing the same problem and this solution did not work for me. I am running on Windows and I have only one installation of matplotlib. It's version 3.7.1.
Same error for me. Arch linux with python 3.10.10
here's the backtrace from gdb:
(gdb) bt
#0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0)
at pthread_kill.c:44 #1 0x00007ffff74a0953 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78 #2 0x00007ffff7451ea8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007ffff743b53d in __GI_abort () at abort.c:79 #4 0x00007ffff769a833 in __gnu_cxx::__verbose_terminate_handler ()
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95 #5 0x00007ffff76a6d0c in __cxxabiv1::__terminate (handler=)
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48 #6 0x00007ffff76a6d79 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58 #7 0x00007ffff76a6fdd in __cxxabiv1::__cxa_throw (obj=,
tinfo=0x555555562d60 <typeinfo for std::runtime_error@GLIBCXX_3.4>,
dest=0x7ffff76be480 std::runtime_error::~runtime_error())
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98 #8 0x000055555555a369 in matplotlibcpp::plot_surface (x=std::vector of length 41, capacity 64 = {...},
y=std::vector of length 41, capacity 64 = {...}, z=std::vector of length 41, capacity 64 = {...},
keywords=std::map with 0 elements, fig_number=0) at ../matplotlibcpp.h:567 #9 0x00005555555569e7 in main () at surface.cpp:22
Activity
[-]Some examples dont work[/-][+]Some examples dont work (segfault and std::runtime_error)[/+]xiang-tao commentedon Feb 19, 2023
I ran into a similar error to yours, my bug report is:
terminate called after throwing an instance of 'std::runtime_error' ,what(): No axis
The reason for my error is that Ubuntu installed matplotlib in two ways:
Therefore, one of them should be uninstalled when performing 3D drawing, so I executed:
After that it ran successfully.
mitrakelly commentedon Apr 21, 2023
I am seeing the same problem and this solution did not work for me. I am running on Windows and I have only one installation of matplotlib. It's version 3.7.1.
kevinpowell commentedon Apr 21, 2023
Same error for me. Arch linux with python 3.10.10
here's the backtrace from gdb:
(gdb) bt
#0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0)
at pthread_kill.c:44
#1 0x00007ffff74a0953 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78
#2 0x00007ffff7451ea8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff743b53d in __GI_abort () at abort.c:79
#4 0x00007ffff769a833 in __gnu_cxx::__verbose_terminate_handler ()
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#5 0x00007ffff76a6d0c in __cxxabiv1::__terminate (handler=)
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6 0x00007ffff76a6d79 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#7 0x00007ffff76a6fdd in __cxxabiv1::__cxa_throw (obj=,
tinfo=0x555555562d60 <typeinfo for std::runtime_error@GLIBCXX_3.4>,
dest=0x7ffff76be480 std::runtime_error::~runtime_error())
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#8 0x000055555555a369 in matplotlibcpp::plot_surface (x=std::vector of length 41, capacity 64 = {...},
y=std::vector of length 41, capacity 64 = {...}, z=std::vector of length 41, capacity 64 = {...},
keywords=std::map with 0 elements, fig_number=0) at ../matplotlibcpp.h:567
#9 0x00005555555569e7 in main () at surface.cpp:22
kevinpowell commentedon Apr 22, 2023
And, I've got a fix for this issue.
see https://stackoverflow.com/questions/76077363/why-does-matplotlib-cpp-throw-runtime-exceptions-in-the-3d-examples