octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49642] rethrow (lasterror ()) loses stack inf


From: Rik
Subject: [Octave-bug-tracker] [bug #49642] rethrow (lasterror ()) loses stack information from previous error structure
Date: Fri, 18 Nov 2016 19:21:35 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #6, bug #49642 (project octave):

The problem is in error.cc in Frethrow.  The code is


  // Ugh.
  std::string tmp_msg (msg);
  if (tmp_msg[len-1] == '\n')
    {
      if (len > 1)
        {
          tmp_msg.erase (len - 1);
          rethrow_error (id.c_str (), "%s\n", tmp_msg.c_str ());
        }
    }
  else
    rethrow_error (id.c_str (), "%s", tmp_msg.c_str ());

  // FIXME: is this the right thing to do for Vlast_error_stack?
  //        Should it be saved and restored with unwind_protect?

  Vlast_error_stack = err_stack;

  std::cerr << "Pre-Stack 2" << std::endl;


I added simple printf debug code and the internal call to rethrow_error never
returns to this function.  That means Vlast_error_stack is not re-initialized.
 The code for rethrow_error is


void
rethrow_error (const char *id, const char *fmt, ...)
{
  va_list args;
  va_start (args, fmt);
  error_1 (std::cerr, 0, id, fmt, args);
  va_end (args);
}


I tried removing the NO_RETURN attribute on error_1 but that didn't help.  

I'm adding jwe to the CC list since I'm at a loss.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]