A
A
Alexandre2015-06-29 18:44:12
JavaScript
Alexandre, 2015-06-29 18:44:12

No backtrace when debugging gdb in docker. What additional libraries or options to install?

based on debian:wheezy FROM image
installed: apt-get install gcc , g++, make, gdb
program compiles normally
program compiled in docker crashes, it works fine on localhost (debugging also works), when run in debugger (gdb) no stack. Debug options ( -ggdb ) on compilation and build added.
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
No stack.
What might be missing?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
0
0xD34F, 2018-10-12
@cody-maverick

The point here is that you do not need to re-count what you have already considered. Namely - all these sums of degrees. Each next amount is the previous amount plus one more value. A separate method is not needed, it is enough to declare a variable outside the loop and add the value of the next degree at each iteration:

function movie(card, ticket, perc) {
  let
    sum = card,
    count = 0;

  while (Math.ceil(sum) >= ticket * count) {
    count++;
    sum += ticket * Math.pow(perc, count);
  }

  return count;
}

J
jcmvbkbc, 2015-06-30
@jcmvbkbc

Debug options ( -ggcc ) on compilation and build added.

Did you mean -ggdb?

A
Alexandre, 2015-06-30
@Alexandre

corrected, there was a typo.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question