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

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

[Octave-bug-tracker] [bug #50068] Segfault, when eval_string is used in


From: Rik
Subject: [Octave-bug-tracker] [bug #50068] Segfault, when eval_string is used in interpreter embedded mode
Date: Wed, 18 Jan 2017 16:55:41 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #50068 (project octave):

                  Status:               Need Info => Confirmed              

    _______________________________________________________

Follow-up Comment #7:

Confirmed.  This is a regression between 4.0.2 and 4.2.0.  The problem is
still present on the development branch (4.3.0+) as well.  I'm adding jwe to
the CC list since he significantly changed the exception handling mechanisms
of Octave to which this appears to relate.

For a test case, I am using the vanilla code present in Appendix A, shown here
for reference.


#include <iostream>
#include <octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/interpreter.h>

int
main (void)
{
  string_vector argv (2);
  argv(0) = "embedded";
  argv(1) = "-q";

  octave_main (2, argv.c_str_vec (), 1);

  octave_idx_type n = 2;
  octave_value_list in;

  for (octave_idx_type i = 0; i < n; i++)
    in(i) = octave_value (5 * (i + 2));

  octave_value_list out = feval ("gcd", in, 1);

  if (out.length () > 0)
  std::cout << "GCD of ["
            << in(0).int_value ()
            << ", "
            << in(1).int_value ()
            << "] is " << out(0).int_value ()
            << std::endl;
  else
    std::cout << "invalid\n";

   clean_up_and_exit (0);
}


To compile, I type at a shell prompt


mkoctfile-4.2.0 --link-stand-alone tst.cc -o tst


Also, at the shell, I have to add in the runtime libraries


setenv LD_LIBRARY_PATH /usr/local/lib/octave/4.2.0


Finally, I run the resulting executable and I get


GCD of [10, 15] is 5
terminate called after throwing an instance of 'octave::exit_exception'
Abort


It seems that clean_up_and_exit() behaves differently than it did in 4.0.2. 
If I eliminate the call to clean_up_and_exit and just let the interpreter go
out of scope at the end of main() theni I get


GCD of [10, 15] is 5
Inconsistency detected by ld.so: dl-close.c: 764: _dl_close: Assertion
`map->l_init_called' failed!





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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