« 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


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


_______________________________________________
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