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

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

[Octave-bug-tracker] [bug #59228] embedded.cc example crashes with segfa


From: anonymous
Subject: [Octave-bug-tracker] [bug #59228] embedded.cc example crashes with segfault
Date: Wed, 7 Oct 2020 14:19:01 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Follow-up Comment #5, bug #59228 (project octave):

Slightly different problem here. Compiling embedded.cc with g++ works as OP
describes, but mkoctfile does not. This is with dev version 7.0.0.

Original version:

$ tail -4 embedded.cc 
    }

  return 0;
}
$ g++ embedded.cc -I /usr/local/include/octave-7.0.0/ -L
/usr/local/lib/octave/7.0.0/ -loctinterp -loctave
$ ./a.out 
GCD of [10, 15] is 5
Segmentation fault (core dumped)


Add the line interpreter.shutdown() to the end:

$ tail -5 embedded.cc 
    }

  interpreter.shutdown();
  return 0;
}
$ g++ embedded.cc -I /usr/local/include/octave-7.0.0/ -L
/usr/local/lib/octave/7.0.0/ -loctinterp -loctave
$ ./a.out 
GCD of [10, 15] is 5


Try the same with mkoctfile, with and without the interpreter.shutdown():

$ mkoctfile embedded.cc
$ ./a.out 
Segmentation fault (core dumped)
$ mkoctfile --link-stand-alone embedded.cc
$ ./a.out 
Segmentation fault (core dumped)



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59228>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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