# Random crash when using root6 and ublas

**URL:** <https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088>\
**Category:** ROOT\
**Created:** [February 26, 2018, 4:49pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088 "2018-02-26T16:49:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![atha.stam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atha.stam/32/14293_2.png) [@atha.stam](https://root-forum.cern.ch/u/atha.stam)\
**Post date:** [February 26, 2018, 4:49pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/1 "2018-02-26T16:49:48Z")

</div>

Dear co-rooters ,

I am facing a rather bizarre issue. I am doing some rather simple (but could be heavy memory-wise) matrix calculations, using `ublas`.

My code is the following

**covariance\_linear-interpolation.C**

```auto
//ROOT6
// source /afs/cern.ch/sw/lcg/external/gcc/4.8/x86_64-slc6/setup.csh
// source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/bin/thisroot.csh

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>// std::max()

#include "TROOT.h"
#include "TGraph.h"
#include "TH1.h"
#include "TMath.h"
#include "TMatrixF.h"
#include "TMatrixFSym.h"
#include "TMatrixFSparse.h"
#include "TMatrixTSym.h"
#include "TString.h"
#include "TRandom.h"

#include </usr/include/boost/numeric/ublas/matrix.hpp>
#include </usr/include/boost/numeric/ublas/matrix_sparse.hpp>
#include </usr/include/boost/numeric/ublas/symmetric.hpp>
#include </usr/include/boost/numeric/ublas/io.hpp>

#include "covariance_lib.cc"

using namespace std;
using namespace boost::numeric::ublas;

void covariance_linear_interpolation(TString filename, int E_MIN, int E_MAX, int N_BPDEC, bool return_TMatrix){
// (2) Define the isolethargic binning - MeV
	int ndec = E_MAX - E_MIN;
	int nbins = (int) ndec*N_BPDEC;
	float	step = (float) ndec / nbins;
	float*	En_USER = new float[nbins];

	for(int i=0; i < nbins; i++) {
		En_USER[i] = (float) pow(10., step * (float) i + E_MIN);
	}

// (3) Read the evaluation and interpolate
	int nbins_EVAL = count_lines(filename);
	float* xs_USER = new float[nbins];
	float* En_EVAL = new float[nbins_EVAL];
	float* xs_EVAL = new float[nbins_EVAL];
	int* idx = new int[nbins];
	input_ascii(filename, En_EVAL, xs_EVAL);	
	linear_interpolation(nbins, nbins_EVAL, En_USER, xs_USER, En_EVAL, xs_EVAL, idx);

// (2) Define the size for the covariance matrices
	const int size_EVAL = nbins_EVAL;
	const int size_USER = nbins;
	
// (3) Define the types of T-objects that will be used
	float *covariance_EVAL = new float[size_EVAL*(size_EVAL+1)/2];
	for (int i=0; i<size_EVAL*(size_EVAL+1)/2; ++i){
		covariance_EVAL[i] = 1.e-3*i;
	}
	//TMatrixFSym *COV_EVAL = new TMatrixFSym(size_EVAL, covariance_EVAL);
	//TMatrixFSym COV_EVAL(size_EVAL, covariance_EVAL);
	symmetric_matrix<float, upper> COV_EVAL (size_EVAL, size_EVAL);
	COV_EVAL = fill_symmetric( COV_EVAL, covariance_EVAL, size_EVAL);	

	delete[] covariance_EVAL;
	delete[] xs_USER;
	delete[] xs_EVAL;

// () Define the non-zero elements of the SParse TMatrix
	int* icol = new int[2*(nbins)];
	int* irow = new int[2*(nbins)];
	float* coeff = new float[2*(nbins)];

	for (int i=0; i<(nbins)-1; ++i){//<-------------This is the loop where it randomly crashes
	cout << i << " ";
		icol[2*i] = idx[i];
		icol[2*i+1] = idx[i] + 1;	
		irow[2*i] = i;
		irow[2*i+1] = i;
		coeff[2*i] = 1 + (En_USER[i]-En_EVAL[idx[i]])/(En_EVAL[idx[i]]-En_EVAL[idx[i+1]]);
		coeff[2*i+1] = coeff[2*i] - 1;
		if ( !isfinite(coeff[2*i]) ){// If En_USER == En_EVAL then sensitivity coefficient is 1
			coeff[2*i] = 1;
			coeff[2*i+1] = 0;
		}
	}
	
	delete[] En_USER;
	delete[] En_EVAL;
	delete[] idx;

	//TMatrixFSparse G(size_USER, size_EVAL);
	//G.SetMatrixArray(2*(nbins), irow, icol, coeff);
	
	//mapped_matrix<float> G(size_USER, size_EVAL,2*nbins);
	//cout << "Rows = " << size_USER << ", Cols = " << G.size1() << ", DATA = " << G.size2() << endl;
	//for (int i=0; i<2*nbins; ++i) {cout << i << ". " << irow[i] << "/" << icol[i] << " ";}
	//G = fill_sparse( G, 2*nbins, irow, icol, coeff);//here it crashes
	
	delete[] icol;
	delete[] irow;
	delete[] coeff;
	
	//cout << G << endl;
/*
// (7) Calculate the covariance matrix - will be symmetric
	TMatrixF COV_USER(G, TMatrixF::kMult, COV_EVAL);
	int size_MAX = max(size_USER, size_EVAL);
	G.ResizeTo(size_MAX, size_MAX);
	G.T();
	G.ResizeTo(size_EVAL, size_USER);
	COV_USER *= G;
	//COV_USER.TMatrixF::Mult(COV_USER, G.T());
	COV_USER.Print();
	//delete COV_USER;
	
	//if (return_TMatrix) return ;
	return;
*/
}

```

**covariance\_lib.cc**

```auto
// Inputs : -name = name of the ascii file to be read - two column file with x and y values, rescpectively assumed
// -X_USER = array that contains the user defined energy binning
// -output = if output = TRUE exports the interpolation array
// if output = FALSE exports the index of the input values used in the interpolation
void linear_interpolation(int size_USER, int size_EVAL, float* X_USER, float* Y_USER, float* X_EVAL, float* Y_EVAL, int* index){

	float x1, x2,y1, y2, a, b;
	bool boo;
	x1 = 0.; x2 = 0.; y1 = 0; y2 = 0.; a = 0.; b = 0.;
    	for(int i=0; i<size_USER; ++i){
		boo = true;
		for (int j=0; j<size_EVAL; j++){
			if (boo==true){
				if(X_USER[i] == X_EVAL[j]){
					Y_USER[i] = Y_EVAL[j];
					index[i] = j;
					boo = false;
				}
				else if(X_USER[i]>X_EVAL[j]){
					x1 = X_EVAL[j];
					y1 = Y_EVAL[j];
					index[i] = j;
				}
				else if( X_USER[i]<X_EVAL[j] && boo == true ){
					x2 = X_EVAL[j];
					y2 = Y_EVAL[j];
					a = (y2-y1)/(x2-x1);
					b = y2-a*x2;
					Y_USER[i] = a*X_USER[i]+b;
					//index[i] = j;
					boo = false;
				}
			}
		}//end of loop over EVAL
	}//end of loop over USER	
}// ____ linear_interpolation()

void input_ascii(TString filename, float* X_EVAL, float* Y_EVAL){

	std::ifstream myfile;
	myfile.open(filename);
	float x = 0, y = 0;
	int i = 0;
  	while(1){
		myfile >> x >> y;
		if (!myfile.good()) break;
		X_EVAL[i] = x;
		Y_EVAL[i] = y;
		i++;
	}
    	myfile.close();
}//___input_ascii()

int count_lines(TString filename){

	float	x, y;
	int nlines;	
	// (1) Open the file to count its lines
	std::ifstream myfile;
	myfile.open(filename);
  	if(!myfile){
		cout << "File not found" << endl;
  	}
  	nlines = 0;
  	while(1){
  		myfile >> x >> y;
  		if (!myfile.good()) break;
		nlines++;
	}
	myfile.close();
	return nlines;

}//___count_lines()

std::vector<float> isolethargic_binning(int min, int max, int bpd){

	int ndec = max - min;
	int nbins = (int) ndec*bpd;
	float	step = (float) ndec / nbins;
	std::vector<float> xbins(nbins+1);

	for(int i=0; i <= nbins; i++) {
		xbins[i] = (float) pow(10., step * (float) i + min);
	}
	
	return xbins;

}//___isolethargic_binning()

boost::numeric::ublas::symmetric_matrix<float> fill_symmetric (boost::numeric::ublas::symmetric_matrix<float> m_sym, float* filler, int size_FILLER){

	float* in = filler;
	for (size_t i=0; i<m_sym.size1(); ++ i)
    		for (size_t j = 0; j <= i && in != &filler[size_FILLER+1]; ++ j)
        		m_sym (i, j) = *in++;
        				
	return m_sym;

}//___fill_symmetric

boost::numeric::ublas::mapped_matrix<float> fill_sparse (boost::numeric::ublas::mapped_matrix<float> m_spar, int size_DATA, int* row, int* col, float* data){

		for (int i=0; i<size_DATA; ++ i)
        	    m_spar( row[i], col[i] ) = data[i];}
    				
	return m_spar;

}//___fill_sparse

```

The problem is that the code crashes after a random number of iterations (the `for` loop where the crash takes place is indicated in the code) and I can’t understand what it the matter.

Note that I am running the code in lxplus using ROOT6.

A sample file can be found [here](https://cernbox.cern.ch/index.php/s/up69yHQNKJPDlc6) and the code can be run using

```
root [0] .L covariance_linear-interpolation.C++
root [1] covariance_linear_interpolation("ENDF_B-VII_1_reduced.dat", -3, 0, 1000, 0)

```

Any idea on what be the issue?

Thanks in advance!

\*For completeness the output can be found below

> ```auto
> ***Break*** segmentation violation
> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 
>  
>  
> ===========================================================
> There was a crash.
> This is the entire stack trace of all threads:
> ===========================================================
> #0 0x00007fb96268182e in waitpid () from /lib64/libc.so.6
> #1 0x00007fb962613479 in do_system () from /lib64/libc.so.6
> #2 0x00007fb963b0ce7f in TUnixSystem::StackTrace() () from /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so
> #3 0x00007fb963b0e9ec in TUnixSystem::DispatchSignals(ESignals) () from /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so
> #4 <signal handler called>
> #5 0x00007fb957725813 in covariance_linear_interpolation(TString, int, int, int, bool) () from /eos/user/a/astamato/covariance/code/covariance_linear-interpolation_C.so
> #6 0x00007fb963f6fce1 in ?? ()
> #7 0x0000000000000000 in ?? ()
> ===========================================================
>  
>  
> The lines below might hint at the cause of the crash.
> If they do not help you then please submit a bug report at
> http://root.cern.ch/bugs. Please post the ENTIRE stack trace
> from above as an attachment in addition to anything else
> that might help us fixing this issue.
> ===========================================================
> #5 0x00007fb957725813 in covariance_linear_interpolation(TString, int, int, int, bool) () from /eos/user/a/astamato/covariance/code/covariance_linear-interpolation_C.so
> #6 0x00007fb963f6fce1 in ?? ()
> #7 0x0000000000000000 in ?? ()
> ===========================================================
> 
> ```

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 26, 2018, 5:21pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/2 "2018-02-26T17:21:16Z")

</div>

Try something like (note: some [Valgrind](http://valgrind.org/) functionality requires that the source code, that you want to analyse, is compiled with debug symbols):

```auto
valgrind --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'covariance_linear_interpolation.C++g("ENDF_B-VII_1_reduced.dat", -3, 0, 1000, 0)'
valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'covariance_linear_interpolation.C++g("ENDF_B-VII_1_reduced.dat", -3, 0, 1000, 0)'

```

and especially carefully study messages that appear in the beginning of the output.  
(Note: the `--show-reachable=yes` option will give you too many warnings, I believe.)

See also:

> [@AddressSanitizer memory error detector](https://root-forum.cern.ch/t/addresssanitizer-memory-error-detector/21046):
>
> The default [valgrind’s “memcheck” memory error detector](http://valgrind.org/docs/manual/mc-manual.html) will not find various {stack,global}-buffer overflow bugs. [Valgrind](http://valgrind.org/) does provide a dedicated complementary [“exp-sgcheck” experimental stack and global array overrun detector](http://valgrind.org/docs/manual/sg-manual.html) but, for the time being, [it does not work, as soon as ROOT related libraries are used](https://root-forum.cern.ch/t/valgrind-tool-exp-sgcheck/21044) [and it seems that it is possible to use it](https://root-forum.cern.ch/t/valgrind-tool-exp-sgcheck/21044/2). On the other hand, gcc 4.8 and newer compilers provide their own [AddressSanitizer (a.k.a. ASan) fast memory error detector](https://github.com/google/sanitizers/wiki/AddressSanitizer) (note: you may n…

---

<div class="post-metadata">

**Author:** ![atha.stam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atha.stam/32/14293_2.png) [@atha.stam](https://root-forum.cern.ch/u/atha.stam)\
**Post date:** [February 26, 2018, 6:02pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/3 "2018-02-26T18:02:42Z")

</div>

Thank you very much for your answer!

I wasn’t able to run exactly what you proposed ☹

```auto
[astamato@lxplus041 code]$ valgrind --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'covariance_linear_interpolation.C++g("ENDF_B-VII_1_reduced.dat", -3, 0, 1000, 0)'
valgrind: No match.

```

so I tried

```auto
[astamato@lxplus041 code]$ valgrind --suppressions=/afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/etc/valgrind-root.supp --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] root.exe -b -l
valgrind: No match.

```

but again with no luck. Instead I was able to run what I pasted [here](https://pastebin.com/9LfSXmj2)

I have to note that it took a long time to start even root and I cannot see if there is something wrong apart from `Invalid read of size 4` which I don’t know what it means.

Any idea?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 26, 2018, 6:13pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/4 "2018-02-26T18:13:28Z")

</div>

Try with:

```auto
root [0] .L covariance_linear-interpolation.C++g

```

---

<div class="post-metadata">

**Author:** ![atha.stam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atha.stam/32/14293_2.png) [@atha.stam](https://root-forum.cern.ch/u/atha.stam)\
**Post date:** [February 26, 2018, 6:30pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/5 "2018-02-26T18:30:57Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> .L covariance\_linear-interpolation.C++g

I tried `.L covariance_linear-interpolation.C++g` outside `valgrind` but I still get the random crash.

I also tried with `valgrind` and I get the following

```auto
[astamato@lxplus041 code]$ valgrind --suppressions=/afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/etc/valgrind-root.supp root.exe -b -l
==24431== Memcheck, a memory error detector
==24431== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==24431== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==24431== Command: root.exe -b -l
==24431== 
==24431== Conditional jump or move depends on uninitialised value(s)
==24431== at 0x882B310: clang::ASTDeclReader::VisitFriendDecl(clang::FriendDecl*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x8830434: clang::ASTDeclReader::Visit(clang::Decl*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x8830921: clang::ASTReader::ReadDeclRecord(unsigned int) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x87E73C4: clang::ASTReader::GetDecl(unsigned int) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x87E80D3: (anonymous namespace)::FindExternalLexicalDeclsVisitor::visit(clang::serialization::ModuleFile&, bool, void*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x888B903: clang::serialization::ModuleManager::visitDepthFirst(bool (*)(clang::serialization::ModuleFile&, bool, void*), void*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x87DC15E: clang::ASTReader::FindExternalLexicalDecls(clang::DeclContext const*, bool (*)(clang::Decl::Kind), llvm::SmallVectorImpl<clang::Decl*>&) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x8CB1232: clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x8CB12EE: clang::DeclContext::decls_begin() const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x896C67C: clang::CXXRecordDecl::method_begin() const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x8D5751D: clang::ASTContext::getCurrentKeyFunction(clang::CXXRecordDecl const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x88AEAA2: clang::Sema::ActOnEndOfTranslationUnit() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== 
root [0] 

root [0] 
root [0] 
root [0] 
root [0] 
root [0] 
root [0] 
root [0] .L covariance_linear-interpolation.C++g
Info in <TUnixSystem::ACLiC>: creating shared library /eos/user/a/astamato/covariance/code/./covariance_linear-interpolation_C.so
Warning in cling::IncrementalParser::CheckABICompatibility():
  C++ ABI mismatch, compiled with __GLIBCXX__ v20130531 running with v20141219
root [1] covariance_linear_interpolation("ENDF_B-VII_1_reduced.dat", -3, 0, 1000, 0)
==24431== Use of uninitialised value of size 8
==24431== at 0x14384806: covariance_linear_interpolation(TString, int, int, int, bool) (in /eos/user/a/astamato/covariance/code/covariance_linear-interpolation_C.so)
==24431== by 0x409E3D0: ???
==24431== by 0x80263FC: cling::IncrementalExecutor::executeFunction(llvm::StringRef, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FD801F: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FDE006: cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions const&, cling::Value*, cling::Transaction**) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FDE18C: cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x806A4EA: cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7F82AB6: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x501F3F4: TApplication::ProcessLine(char const*, bool, int*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so)
==24431== by 0x574AEAE: TRint::ProcessLineNr(char const*, char const*, int*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libRint.so)
==24431== by 0x574B1A0: TRint::HandleTermInput() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libRint.so)
==24431== by 0x50D9184: TUnixSystem::CheckDescriptors() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so)
==24431== 
==24431== Invalid read of size 4
==24431== at 0x14384806: covariance_linear_interpolation(TString, int, int, int, bool) (in /eos/user/a/astamato/covariance/code/covariance_linear-interpolation_C.so)
==24431== by 0x409E3D0: ???
==24431== by 0x80263FC: cling::IncrementalExecutor::executeFunction(llvm::StringRef, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FD801F: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FDE006: cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions const&, cling::Value*, cling::Transaction**) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7FDE18C: cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x806A4EA: cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x7F82AB6: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCling.so)
==24431== by 0x501F3F4: TApplication::ProcessLine(char const*, bool, int*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so)
==24431== by 0x574AEAE: TRint::ProcessLineNr(char const*, char const*, int*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libRint.so)
==24431== by 0x574B1A0: TRint::HandleTermInput() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libRint.so)
==24431== by 0x50D9184: TUnixSystem::CheckDescriptors() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.02/x86_64-slc6-gcc48-opt/root/lib/libCore.so)
==24431== Address 0x1e011fd88 is not stack'd, malloc'd or (recently) free'd
==24431== 

 ***Break*** segmentation violation
0 #0 vgModuleLocal_do_syscall_for_client_WRK () at m_syswrap/syscall-amd64-linux.S:147
#1 0x0000000000000008 in ?? ()
#2 0x0000000402f00dd0 in ?? ()
#3 0x0000000402f00e40 in ?? ()
#4 0x000000003aaf0b60 in vgPlain_threads ()
#5 0x000000000000003d in ?? ()
#6 0x0000000402f00e40 in ?? ()
#7 0x000000003aed8768 in syscallInfo ()
#8 0x000000000000003d in ?? ()
#9 0x0000000000000001 in ?? ()
#10 0x000000003aaf0b50 in vgPlain_threads ()
#11 0x000000003aed86d8 in syscallInfo ()
#12 0x000000003807c1ae in do_syscall_for_client (tid=1, trc=<value optimized out>) at m_syswrap/syswrap-main.c:310
#13 vgPlain_client_syscall (tid=1, trc=<value optimized out>) at m_syswrap/syswrap-main.c:1560
#14 0x0000000038078a50 in handle_syscall (tid=1, trc=73) at m_scheduler/scheduler.c:1057
#15 0x0000000038079be7 in vgPlain_scheduler (tid=1) at m_scheduler/scheduler.c:1335
#16 0x00000000380a641a in thread_wrapper (tidW=1) at m_syswrap/syswrap-linux.c:103
#17 run_a_thread_NORETURN (tidW=1) at m_syswrap/syswrap-linux.c:156
#18 0x0000000000000000 in ?? ()
Root > 

```

I would expect to get an error pointing at some line of the code…but…  
Any idea?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 26, 2018, 6:35pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/6 "2018-02-26T18:35:09Z")

</div>

You really try to use ROOT 6.02/02?  
Try with ROOT 6.12/06!

BTW. I just noticed that you tried my valgrind commands including all `[something_optional]` options (if you want to use any of these options, REMOVE the “square brackets”).

---

<div class="post-metadata">

**Author:** ![atha.stam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/atha.stam/32/14293_2.png) [@atha.stam](https://root-forum.cern.ch/u/atha.stam)\
**Post date:** [February 26, 2018, 6:43pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/7 "2018-02-26T18:43:41Z")

</div>

Really?  
I hope it’s that!!!

Do you know how to use it on lxplus?  
I’ve searched [here](https://root.cern.ch/content/release-61206) but there aren’t instructions on how to set it up on lxplus (similar to the ones that are for instance [here](https://root.cern.ch/content/release-60606).

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 26, 2018, 6:44pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/8 "2018-02-26T18:44:44Z")

</div>

There is the “lxplus7” (CentOS Cern 7 gcc4.8).

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 12, 2018, 6:44pm UTC](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/9 "2018-03-12T18:44:58Z")

</div>

Closed on March 12, 2018, 6:44pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
