bugGNU Octave - Bugs: bug #52025, Memory issue with mkoctfile and...

 
 

bug #52025: Memory issue with mkoctfile and helloworld.cc

Submitter:  Rik <rik5>
Submitted:  Thu 14 Sep 2017 08:19:51 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Sep 2017 08:29:28 PM UTC, comment #1: 

This seems to have come about because of a mismatch between the installed libraries used by Octave and the local version in my build directory.  I can't reproduce this anymore so I'm closing the report.

Rik <rik5>
Group administrator
Thu 14 Sep 2017 08:19:51 PM UTC, original submission:  

Compiling helloworld.cc from within Octave with mkoctfile and then running the resulting .oct file produces a segfault.  It is only a segfault when there are outputs requested from helloworld.cc.


octave:4> setenv ('CXXFLAGS', '-O0 -ggdb3 -fsanitize=address -pipe')
octave:5> mkoctfile -v helloworld.cc
g++ -std=gnu++11 -c  -fPIC -I/home/rik/local/include/octave-4.3.0+/octave/.. -I/home/rik/local/include/octave-4.3.0+/octave -I/home/rik/local/include  -pthread -fopenmp -O0 -ggdb3 -fsanitize=address -pipe    helloworld.cc -o helloworld.o
g++ -std=gnu++11 -I/home/rik/local/include/octave-4.3.0+/octave/.. -I/home/rik/local/include/octave-4.3.0+/octave -I/home/rik/local/include  -pthread -fopenmp -O0 -ggdb3 -fsanitize=address -pipe -shared -Wl,-Bsymbolic  -o helloworld.oct  helloworld.o   -L/home/rik/local/lib/octave/4.3.0+ -L/home/rik/local/lib -loctinterp -loctave
octave:6> helloworld (1,2)
Hello World has 2 input arguments and 0 output arguments.
octave:7> [a,b] = helloworld (1,2)


The resulting backtrace is


ASAN:SIGSEGV
=================================================================
==6080==ERROR: AddressSanitizer: SEGV on unknown address 0x7fe7cdeab9e8 (pc 0x7fe7b63c58a6 bp 0x7ffd8cdd0f60 sp 0x7ffd8cdd0f50 T0)
    #0 0x7fe7b63c58a5 in octave::refcount<long>::operator++(int) /home/rik/local/include/octave-4.3.0+/octave/../octave/oct-refcount.h:91
    #1 0x7fe7b63c4bc4 in octave_value::operator=(octave_value const&) /home/rik/local/include/octave-4.3.0+/octave/../octave/ov.h:362
    #2 0x7fe7b63c3d4e in Fhelloworld(octave_value_list const&, int) /home/rik/wip/Projects_Mine/octave-dbg/examples/code/helloworld.cc:13
    #3 0x7fe7cd4053fe in octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) libinterp/octave-value/ov-builtin.cc:65
    #4 0x7fe7cd6faaa1 in octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) libinterp/parse-tree/pt-eval.cc:1252
    #5 0x7fe7cd72d9ec in octave::tree_index_expression::accept(octave::tree_walker&) libinterp/parse-tree/pt-idx.h:101
    #6 0x7fe7cd585556 in octave::tree_evaluator::evaluate_n(octave::tree_expression*, int) libinterp/parse-tree/pt-eval.h:284
    #7 0x7fe7cd6fdd3f in octave::tree_evaluator::visit_multi_assignment(octave::tree_multi_assignment&) libinterp/parse-tree/pt-eval.cc:1751
    #8 0x7fe7cd6e5b5a in octave::tree_multi_assignment::accept(octave::tree_walker&) libinterp/parse-tree/pt-assign.h:148
    #9 0x7fe7cd485e92 in octave::tree_evaluator::evaluate(octave::tree_expression*, int) libinterp/parse-tree/pt-eval.h:271
    #10 0x7fe7cd701164 in octave::tree_evaluator::visit_statement(octave::tree_statement&) libinterp/parse-tree/pt-eval.cc:2209
    #11 0x7fe7cd73f13e in octave::tree_statement::accept(octave::tree_walker&) libinterp/parse-tree/pt-stmt.h:112
    #12 0x7fe7cd70147f in octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) libinterp/parse-tree/pt-eval.cc:2251
    #13 0x7fe7cd486730 in octave::tree_statement_list::accept(octave::tree_walker&) libinterp/parse-tree/pt-stmt.h:187
    #14 0x7fe7cdb886e4 in octave::interpreter::main_loop() libinterp/corefcn/interpreter.cc:974
    #15 0x7fe7cdb86577 in octave::interpreter::execute() libinterp/corefcn/interpreter.cc:695
    #16 0x7fe7ccedd3eb in octave::cli_application::execute() libinterp/octave.cc:384
    #17 0x401d7c in main src/main-cli.cc:90
    #18 0x7fe7ca66282f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #19 0x401808 in _start (/home/rik/wip/Projects_Mine/octave-dbg/src/.libs/lt-octave-cli+0x401808)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/rik/local/include/octave-4.3.0+/octave/../octave/oct-refcount.h:91 octave::refcount<long>::operator++(int)
==6080==ABORTING



Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-14 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code