help-octave
[Top][All Lists]
Advanced

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

Re: Calling Octave from C++


From: Tatsuro MATSUOKA
Subject: Re: Calling Octave from C++
Date: Sat, 24 Mar 2018 11:05:25 +0900 (JST)

----- Original Message -----
> From: Tatsuro MATSUOKA
> To: tmacchant; andrea.delbravo  "help-octave
> Cc: 
> Date: 2018/3/24, Sat 08:09
> Subject: Re: Calling Octave from C++
> 
> ----- Original Message -----
> 
>>  From: Tatsuro MATSUOKA 
>>  To: andrea.delbravo "help-octave Cc: 
>>  Date: 2018/3/24, Sat 07:47
>>  Subject: Re: Calling Octave from C++
>> 
>>  ----- Original Message -----
>> 
>>>   From: andrea.delbravo 
>>>   To: help-octave
>>>   Cc: 
>>>   Date: 2018/3/23, Fri 19:28
>>>   Subject: Re: Calling Octave from C++
>>> 
>>>   Well, sorry for the nmissing infos.
>>>   I wirk with Fedora 26 Ocatve 4.2.1. I tried also with Fedora 27 Octave 
> 
>>  4.2.2
>>>   but the problem persist.
>>>   The application run perfectly under fedora 25 Octave 4.0.3.
>>>   I minimize the application in order to focalize the problem:
>>>   After several initialization the core of the problem is:
>>> 
>>>   // THIS CODE IS WORKING
>>>   int qq =10;
>>>   int rr =15;
>>>   in(0) = octave_value(qq);
>>>   in(1) = octave_value(rr);
>>>   octave_value_list out = feval ("gcd", in, 1);
>>>   std::cout << out(0).int_value ()
>>>   and it prints the correct result = 5 the Greatest common disisor 
> between 10
>>>   and 15
>> 
>>  I execute the code on Octave-4.2.2 build myself on Ubuntu 16.04.
>>  Octave hangs with Segmentation fault.
>>  Segmentation fault
>> 
>>  Thread 1 "test_01" received signal SIGSEGV, Segmentation fault.
>>  0x00007ffff6e2996a in octave::application::interactive() ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>> 
>>  bt
>> 
>>  #0  0x00007ffff6e2996a in octave::application::interactive() ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #1  0x00007ffff78147a6 in octave_pager_buf::sync() ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #2  0x00007ffff571ce3e in std::ostream::flush() ()
>>     from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
>>  #3  0x00007ffff78151a6 in flush_octave_stdout() ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #4  0x00007ffff7550e2d in ?? ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #5  0x00007ffff75508c5 in ?? ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #6  0x00007ffff75509fe in ?? ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #7  0x00007ffff7550a57 in verror(char const*, __va_list_tag*) ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #8  0x00007ffff7550af9 in error(char const*, ...) ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #9  0x00007ffff73b4fb2 in feval(std::__cxx11::basic_string<char, 
>>  std::char_traits<char>, std::allocator<char> > const&, 
>>  octave_value_list const&, int) ()
>>     from /usr/lib/x86_64-linux-gnu/liboctinterp.so.4
>>  #10 0x0000000000401920 in main () at test_01.cc:16
>> 
>>  Perhaps bug.
> 
> Ah!
> 
> I have forgotten to set LD_LIBRARY_PATH to self build octave directory.Thread 
> 1 
> "test_01" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff6e2202a in octave::application::interactive ()
>     at ../libinterp/octave.cc:362
> 362        interpreter *interp = instance->m_interpreter;
> (gdb) bt
> #0  0x00007ffff6e2202a in octave::application::interactive ()
>     at ../libinterp/octave.cc:362
> #1  0x00007ffff780a436 in octave_pager_buf::sync (this=0x66a120)
>     at ../libinterp/corefcn/pager.cc:236
> #2  0x00007ffff5682e3e in std::ostream::flush() ()
>    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #3  0x00007ffff780ae36 in flush_octave_stdout ()
>     at ../libinterp/corefcn/pager.cc:466
> #4  0x00007ffff754742d in verror(bool, std::ostream &, const char *, const 
> char *, const char *, typedef __va_list_tag __va_list_tag *, bool) (
>     address@hidden, os=..., 
>     address@hidden "error", address@hidden 
> "", 
>     address@hidden "feval: function '%s' not 
> found", 
>     args=0x7fffffffdcd0, with_cfn=false) at ../libinterp/corefcn/error.cc:157
> #5  0x00007ffff7546ec5 in error_1(octave::execution_exception &, 
> std::ostream &, const char *, const char *, const char *, typedef 
> __va_list_tag __va_list_tag *, bool) (e=..., os=..., 
> address@hidden "error", 
>     address@hidden "", fmt=<optimised out>, 
>     address@hidden "feval: function '%s' not found", 
> 
>     address@hidden, with_cfn=false)
>     at ../libinterp/corefcn/error.cc:535
> #6  0x00007ffff7546ffe in error_1(std::ostream &, const char *, const char 
> *, const char *, typedef __va_list_tag __va_list_tag *, bool) (os=..., 
> ---Type <return> to continue, or q <return> to quit---
>     address@hidden "error", address@hidden 
> "", 
>     fmt=0x7ffff792db10 "feval: function '%s' not found", 
>     address@hidden, address@hidden)
>     at ../libinterp/corefcn/error.cc:560
> #7  0x00007ffff7547057 in verror (fmt=<optimised out>, 
>     address@hidden) at ../libinterp/corefcn/error.cc:566
> #8  0x00007ffff75470f9 in error (
>     address@hidden "feval: function '%s' not 
> found")
>     at ../libinterp/corefcn/error.cc:574
> #9  0x00007ffff73aa712 in feval (name="gcd", args=..., 
> address@hidden)
>     at libinterp/parse-tree/oct-parse.yy:4809
> #10 0x0000000000401920 in main () at test_01.cc:16
> 
> 
> Tatsuro

I have executed the recent stable snapshot (5f4550b5d31b).

Thread 1 "test_01" received signal SIGABRT, Aborted.
0x00007ffff4ef0428 in __GI_raise (address@hidden)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54    ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff4ef0428 in __GI_raise (address@hidden)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff4ef202a in __GI_abort () at abort.c:89
#2  0x00007ffff76f7aa7 in octave::__get_interpreter__ (who="feval")
    at libinterp/corefcn/interpreter-private.cc:49
#3  0x00007ffff76f7b39 in octave::__get_symbol_table__ (who="feval")
    at libinterp/corefcn/interpreter-private.cc:86
#4  0x00007ffff7394c31 in octave::feval (name="gcd", args=..., 
    address@hidden) at libinterp/parse-tree/oct-parse.yy:5197
#5  0x000000000040338e in feval (nargout=1, args=..., name="gcd")
    at /opt/octave-stable/include/octave-4.3.0+/octave/../octave/parse.h:647
#6  main () at test_01.cc:16

Octave aborted by  SIGABRT

Tatsuro




reply via email to

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