« Return to Thread: Bug in octave 3.2.x with custom atlas multithread

Re: Bug in octave 3.2.x with custom atlas multithread

by Riccardo Corradini :: Rate this Message:

Reply to Author | View in Thread


Dear stuff,
here you have the output of bt after running gdb octave (compiled with -g 02 etc..)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f2fdb42b710 (LWP 18080)]   
warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

Array<std::complex<double> >::operator= (this=warning: (Internal error: pc 0x7f2fd8d24ee0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

0x7fffe345b4c0, a=@0x0) at Array.cc:88
88            rep = a.rep;           
warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

Current language:  auto; currently c++
warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

(gdb) bt
warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

#0  Array<std::complex<double> >::operator= (this=0x7fffe345b4c0, a=@0x0) at Array.cc:88
#1  0x00007f2fd02c5c1e in EIG::operator= (this=0x7fffe345b4c0, a=@0x0) at ../liboctave/MArray.h:62
#2  0x00007f2fd02c4992 in Feig (args=<value optimized out>, nargout=2) at ./DLD-FUNCTIONS/eig.cc:208
#3  0x00007f2fda47a45f in octave_builtin::do_multi_index_op (this=0x175fa30, nargout=2, args=@0x1d0fdb0) at ov-builtin.cc:107
#4  0x00007f2fda479df3 in octave_builtin::subsref (this=0x175fa30, type=@0x7fffe345c350, idx=@0x7fffe345c330, nargout=2)    
    at ov-builtin.cc:55                                                                                                     
#5  0x00007f2fda4317f0 in octave_value::subsref (this=<value optimized out>, type=@0x21, idx=@0x0, nargout=30474768)        
    at ov.cc:1061                                                                                                           
#6  0x00007f2fda54dc8a in tree_index_expression::rvalue (this=0x1cea9a0, nargout=2) at pt-idx.cc:387
#7  0x00007f2fda53287e in tree_multi_assignment::rvalue (this=0x1cea950) at pt-assign.cc:357
#8  0x00007f2fda5324fe in tree_multi_assignment::rvalue1 (this=0x1cea950, nargout=0) at pt-assign.cc:312
#9  0x00007f2fda53f814 in tree_evaluator::visit_statement (this=0x7f2fdad45bf8, stmt=<value optimized out>) at pt-eval.cc:695
#10 0x00007f2fda53de03 in tree_evaluator::visit_statement_list (this=0x7f2fdad45bf8, lst=@0x1841c40) at pt-eval.cc:731
#11 0x00007f2fda541196 in tree_evaluator::visit_simple_for_command (this=0x7f2fdad45bf8, cmd=<value optimized out>)
    at pt-eval.cc:330
#12 0x00007f2fda53f71c in tree_evaluator::visit_statement (this=0x7f2fdad45bf8, stmt=@0x1c891b0) at pt-eval.cc:665
#13 0x00007f2fda53de03 in tree_evaluator::visit_statement_list (this=0x7f2fdad45bf8, lst=@0x1c04d70) at pt-eval.cc:731
#14 0x00007f2fda481935 in octave_user_script::do_multi_index_op (this=0x1881260, nargout=0, args=@0x7fffe345cdd0)
    at ov-usr-fcn.cc:134
#15 0x00007f2fda42613d in octave_value::do_multi_index_op (this=<value optimized out>, nargout=33, idx=@0x0) at ov.cc:1115
#16 0x00007f2fda548247 in tree_identifier::rvalue (this=0x1cde7e0, nargout=0) at pt-id.cc:86
#17 0x00007f2fda547a5e in tree_identifier::rvalue1 (this=0x1cde7e0, nargout=0) at pt-id.cc:107
#18 0x00007f2fda53f814 in tree_evaluator::visit_statement (this=0x7f2fdad45bf8, stmt=<value optimized out>) at pt-eval.cc:695
---Type <return> to continue, or q <return> to quit---
#19 0x00007f2fda53de03 in tree_evaluator::visit_statement_list (this=0x7f2fdad45bf8, lst=@0x1828d90) at pt-eval.cc:731
#20 0x00007f2fda371d4a in main_loop () at toplev.cc:572
#21 0x00007f2fda30ad75 in octave_main (argc=1, argv=0x7fffe345d658, embedded=0) at octave.cc:877
#22 0x00007f2fd603e5a6 in __libc_start_main () from /lib/libc.so.6
#23 0x00000000004007a9 in _start () at ../sysdeps/x86_64/elf/start.S:113
warning: (Internal error: pc 0x7f2fd8d24f0e in read in psymtab, but not in symtab.)

Please let me know if may send further pieces of information about debug session
Bests
Riccardo Corradini
--- Ven 3/7/09, Riccardo Corradini <riccardocorradini@...> ha scritto:

Da: Riccardo Corradini <riccardocorradini@...>
Oggetto: Re: Bug in octave 3.2.x with custom atlas multithread
A: "Jaroslav Hajek" <highegg@...>
Cc: bug@...
Data: Venerdì 3 luglio 2009, 14:42


1)Here you have the first part of valgrind's output before running obench.m

Octave was configured for "x86_64-unknown-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to <bug@...> (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).

For information about changes from previous versions, type `news'.

==30466==
==30466== Invalid read of size 4
==30466==    at 0x5569680: restore_interrupt_state(void*) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x53A32E1: unwind_protect::run_frame(std::string const&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x54ACFCE: octave_user_function::do_multi_index_op(int, octave_value_list const&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x54ADD14: octave_user_function::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x54AED77: octave_user_function::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x545D813: octave_value::subsref(std::string const&, std::list<octave_value_list, std::allocator<octave_value_list> > const&, int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x5579C89: tree_index_expression::rvalue(int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x557761A: tree_index_expression::rvalue1(int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x555E136: tree_simple_assignment::rvalue1(int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x556B813: tree_evaluator::visit_statement(tree_statement&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x5569E02: tree_evaluator::visit_statement_list(tree_statement_list&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==    by 0x556D5C8: tree_evaluator::visit_simple_for_command(tree_simple_for_command&) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
==30466==  Address 0x7feffb914 is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes

2) yes all the libraries are custom compiled
for lapack3.2 ( from the usual lapack website http://www.netlib.org/lapack/)
in make.inc
#  desired load options for your machine.
#
FORTRAN  = gfortran -fomit-frame-pointer -mfpmath=387 -falign-loops=4  -fPIC -m64
OPTS     = -O2
DRVOPTS  = $(OPTS)
NOOPT    = -O0
LOADER   = gfortran
LOADOPTS =
for atlas8.3 (from the usual http://math-atlas.sourceforge.net/) I followed the tutorial and section 3.1 3.2 3.3 (in http://math-atlas.sourceforge.net/atlas_install/atlas_install.html#SECTION00041000000000000000)
for suitesparse3.4 8 (from the usual http://www.cise.ufl.edu/research/sparse/SuiteSparse/)
these are the relevant parts in Ufconfig/Ufconfig.mk

# ranlib, and ar, for generating libraries
RANLIB = ranlib
AR = ar cr
LIB = -lm -lgfortran -lpthread
# delete and rename a file
RM = rm -f
MV = mv -f
.....
...

# Using default compilers:
 CC = gcc
 CPLUSPLUS = g++
# 64bit:
 F77 = gfortran
 F77FLAGS = -O2 -fomit-frame-pointer -mfpmath=387 -falign-loops=4 -fPIC -m64
 CFLAGS = -Wall -W -Wshadow -Wformat -O2 -fPIC

 
 BLAS = -L/home/corradin/lib/atlas/lib/ -llapack -L/home/corradin/lib/atlas/lib/ -lptcblas -L/home/corradin/lib/atlas/lib/ -lptf77blas -L/home/corradin/lib/atlas/lib/ -latlas
 LAPACK = -L/home/corradin/lib/atlas/lib -llapack

for qrupdate in Makeconf

FC=gfortran
# requested flags
# FFLAGS=-fimplicit-none -O3 -march=native -funroll-loops
FFLAGS= -fomit-frame-pointer -mfpmath=387 -falign-loops=4 -m64
# set if you need shared library
FPICFLAGS=-fPIC

for arpack96

# %---------------------------------------------------%
# | The name of the libraries to be created/linked to |
# %---------------------------------------------------%
#
ARPACKLIB  = $(HOME)/lib/arpack/libarpack.a
 LAPACKLIB = $(HOME)/lib/lapack/lapack.a
 BLASLIB = $(HOME)/lib/atlas/lib/liblapack.a $(HOME)/lib/atlas/lib/libptcblas.a $(HOME)/lib/atlas/lib/libptf77blas.a $(HOME)/lib/atlas/lib/libatlas.a

#
ALIBS =  $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB)
FC      = gfortran
FFLAGS    = -O2 -fomit-frame-pointer -mfpmath=387 -falign-loops=4  -fPIC -m64

LDFLAGS = -lm -lgfortran -lgfortranbegin -lpthread $(ALIBS)

for fftw-3.2.1 this is the relevant part in config.log
./configure -enable-single --enable-shared F77=gfortran  FFLAGS=-O2 -fomit-frame-pointer -mfpmath=387 -falign-loops=4  -fPIC -m64  CXXFLAGS=-O2 -fPIC -m64 --prefix=/home/corradin/lib/fft/

Thanks a lot for all your patience. Hope this gives further help 
Bests
Riccardo Corradini


--- Ven 3/7/09, Jaroslav Hajek <highegg@...> ha scritto:

Da: Jaroslav Hajek <highegg@...>
Oggetto: Re: Bug in octave 3.2.x with custom atlas multithread
A: "Riccardo Corradini" <riccardocorradini@...>
Cc: bug@...
Data: Venerdì 3 luglio 2009, 13:07

On Fri, Jul 3, 2009 at 12:57 PM, Riccardo
Corradini<riccardocorradini@...> wrote:

> Dear jaroslav Hajek,
>
> this is the valgrind report
>
> ==7393==
> ==7393== Invalid read of size 8
> ==7393==    at 0x6001F0E: Array<std::complex<double>
>>::operator=(Array<std::complex<double> > const&) (in
> /home/corradin/d1/packaging/octave-3.2.1/liboctave/liboctave.so)
> ==7393==    by 0x15483C1D: EIG::operator=(EIG const&) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/eig.oct)
> ==7393==    by 0x15482991: Feig(octave_value_list const&, int) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/eig.oct)
> ==7393==    by 0x54A645E: octave_builtin::do_multi_index_op(int,
> octave_value_list const&) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x54A5DF2: octave_builtin::subsref(std::string const&,
> std::list<octave_value_list, std::allocator<octave_value_list> > const&,
> int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x545D7EF: octave_value::subsref(std::string const&,
> std::list<octave_value_list, std::allocator<octave_value_list> > const&,
> int) (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x5579C89: tree_index_expression::rvalue(int) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x555E87D: tree_multi_assignment::rvalue(int) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x555E4FD: tree_multi_assignment::rvalue1(int) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x556B813: tree_evaluator::visit_statement(tree_statement&)
> (in /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x5569E02:
> tree_evaluator::visit_statement_list(tree_statement_list&) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==    by 0x556D195:
> tree_evaluator::visit_simple_for_command(tree_simple_for_command&) (in
> /home/corradin/d1/packaging/octave-3.2.1/src/liboctinterp.so)
> ==7393==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
> panic: Segmentation fault -- stopping myself...
> Thinking... please wait a moment...
> (5/5) Complex matrix operations
> Loop
>  1
> of
>  10
> attempting to save variables to `octave-core'...
> save to `octave-core' complete
> ==7393==
> ==7393== ERROR SUMMARY: 39 errors from 7 contexts (suppressed: 131 from 3)
> ==7393== malloc/free: in use at exit: 82,307,044 bytes in 80,440 blocks.
> ==7393== malloc/free: 871,667 allocs, 791,227 frees, 763,233,387 bytes
> allocated.
> ==7393== For counts of detected errors, rerun with: -v
> ==7393== searching for pointers to 80,440 not-freed blocks.
> ==7393== checked 47,158,088 bytes.
> ==7393==
> ==7393== LEAK SUMMARY:
> ==7393==    definitely lost: 44,547 bytes in 101 blocks.
> ==7393==      possibly lost: 1,146,398 bytes in 22,253 blocks.
> ==7393==    still reachable: 81,116,099 bytes in 58,086 blocks.
> ==7393==         suppressed: 0 bytes in 0 blocks.
> ==7393== Rerun with --leak-check=full to see details of leaked memory.
> Segmentation fault
>

Is this the first error block? (or the first after the initial Octave
prompt, because readline initialization is known to generate false
alerts from valgrind)
There's almost surely nothing wrong in the Array<T>::operator= (it is
very simple), neither in EIG::operator= so the error has probably
happened earlier. Invalid memory writes often behave this weird.

Where does your ATLAS and LAPACK come from? Did you compile it on your own?


--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


-----Segue allegato-----

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave


_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

 « Return to Thread: Bug in octave 3.2.x with custom atlas multithread