Segfault upon printing Point in GDB

28 views
Skip to first unread message

Corbin Foucart

unread,
May 1, 2021, 12:07:13 AM5/1/21
to deal.II User Group
Hello all,

When I attempt to use the GDB 'print' command to print information about a Point object, I'm having some trouble. For example, suppose I've defined

const Point<dim> p_ex(1, 1);
  • If I run GDB and attempt 'print p_ex[0]' the output is 'Could not find operator[]'
  • If I attempt 'print p_ex', GDB segfaults
I imagine printing these sorts of objects is a common procedure, so I'm hoping someone might be able to help me shed light on this!

More details:
I've attached a minimal code example which reproduces the issue. I compile the program without issue on Ubuntu 18.04.5 LTS and the exact GDB commands I use are:
> gdb ./step
>> break step.cc:26
>> r
Breakpoint 1, main () at src/step.cc:27
27      return 0;
>> print bottom_left[0]
Could not find operator[].
>> print bottom_left
$1 = {<dealii::Tensor<1, 2, double>> = {
Segmentation fault (core dumped)

Best,
Corbin

Corbin Foucart

unread,
May 1, 2021, 12:07:49 AM5/1/21
to deal.II User Group
And the file is here.
step.cc

Bruno Turcksin

unread,
May 3, 2021, 11:23:31 AM5/3/21
to deal.II User Group
Corbin,

Take a look at https://dealii.org/developer/users/gdb.html This should help. Note that gdb should not segfault. It probably means that there is a problem with your code.

Best,

Bruno
Reply all
Reply to author
Forward
0 new messages