Adding sparse matrices

Hi,

OK, then let’s clarify what we are talking about exactly.

Please provide the output of “hw_prefs os_type machine_type cpu_type” and the content of $ROOTSYS/config.status.

Also, could you build ROOT with debug info (–build=debug)? Then please download valgrind http://valgrind.org, run it on your test case and send us the output.

Cheers, Axel.

Hello Axel,

after recompiling ROOT with debug I don’t see the crash anymore. I’ll try compiling without debug again. Maybe it’s just some weird setup of my machine ?!

Anyway here is the info:

[code]% hwprefs os_type machine_type cpu_type
Mac OS X 10.6.3 (10D573)
MacBookPro1,1
Intel Core (Yonah) Duo v14.0

% cat $ROOTSYS/config.status
macosx --enable-minuit2 --enable-roofit --build=debug
[/code]

Cheers,
Dano

Hello,

still crashes when compiled without --build=debug.

I also tried to compile in the following configuration:

and I see a crash. The full output including the stack trace is:

[code]Processing testSparse.C…
Matrix A:

3x3 matrix is as follows

 |      0    |      1    |      2    |

0 | 0 0 0
1 | 0 1 0
2 | 0 1 0

Matrix B:

3x3 matrix is as follows

 |      0    |      1    |      2    |

0 | 0 0 0
1 | 1 0 0
2 | 1 0 0

now do the addition
Matrix C = A + B:

*** Break *** segmentation violation

3x3 matrix is as follows

 |      0    |      1    |      2    |

0 | 0 0 0
1 | 1 1 0
2 | 1 1 0

===========================================================
There was a crash (kSigSegmentationViolation).
This is the entire stack trace of all threads:

Thread 1 (process 34529):
#0 0x994af711 in wait4 ()
#1 0x9951e7c3 in system$UNIX2003 ()
#2 0x001298ee in TUnixSystem::StackTrace (this=0x1503490) at core/unix/src/TUnixSystem.cxx:2101
#3 0x00126c90 in TUnixSystem::DispatchSignals (this=0x1503490, sig=kSigSegmentationViolation) at core/unix/src/TUnixSystem.cxx:1108
#4 0x00126d68 in SigHandler (sig=kSigSegmentationViolation) at core/unix/src/TUnixSystem.cxx:352
#5
#6 0x00b242f3 in G__getexpr (expression=0x182d805 “=cc2”) at cint/cint/src/expr.cxx:1395
#7 0x00bba263 in G__exec_statement (mparen=0xbffed634) at cint/cint/src/parse.cxx:6757
#8 0x00b6471e in G__interpret_func (result7=0xbfff8410, funcname=0x1810800 “testSparse”, libp=0xbffedc80, hash=1070, p_ifunc=0x21569a0, funcmatch=1, memfunc_flag=0) at cint/cint/src/ifunc.cxx:6122
#9 0x00b49d5c in G__getfunction (item=0x180ea00 “testSparse()”, known3=0xbfff85ec, memfunc_flag=0) at cint/cint/src/func.cxx:2641
#10 0x00b17789 in G__getitem (item=0x180ea00 “testSparse()”) at cint/cint/src/expr.cxx:1894
#11 0x00b1c648 in G__getexpr (expression=0x21524c0 “testSparse()”) at cint/cint/src/expr.cxx:1464
#12 0x00b2b255 in G__calc_internal (exprwithspace=0x182c800 “testSparse()”) at cint/cint/src/expr.cxx:1066
#13 0x00bd1271 in G__process_cmd (line=0x15af7b0 “.X /Users/dkollar/work/atlas/align/tmp/sparseMatrix/./testSparse.C”, prompt=0x150aaa4 “”, more=0x150aa9c, err=0xbfffc8fc, rslt=0xbfffc8c0) at cint/cint/src/pause.cxx:2305
#14 0x00022361 in TCint::ProcessLine (this=0x150aa80, line=0x15af7b0 “.X /Users/dkollar/work/atlas/align/tmp/sparseMatrix/./testSparse.C”, error=0xbfffd654) at core/meta/src/TCint.cxx:455
#15 0x000fb69f in TCint::ProcessLineSynch (this=0x150aa80, line=0x15af7b0 “.X /Users/dkollar/work/atlas/align/tmp/sparseMatrix/./testSparse.C”, error=0xbfffd654) at core/meta/src/TCint.cxx:537
#16 0x0007a685 in TApplication::ExecuteFile (file=0xbfffd65d “testSparse.C”, error=0xbfffd654, keep=false) at core/base/src/TApplication.cxx:977
#17 0x0007811b in TApplication::ProcessLine (this=0x15ae890, line=0xbfffd65a “.x testSparse.C”, sync=false, err=0xbfffd654) at core/base/src/TApplication.cxx:826
#18 0x013de64f in TRint::Run (this=0x15ae890, retrn=false) at core/rint/src/TRint.cxx:401
#19 0x00001abe in main (argc=1, argv=0xbffff710) at main/src/rmain.cxx:29

[/code]

I tried valgrind (it was a little pain to install in OS X 10.6.3) but it didn’t show anything when run in the default mode.

As before, when compiled, the script runs normally.

Let me know if I should try anything else. I can also provide my laptop for you to have a look at if it helps. Or maybe this isssue is too small to continue worrying about it.

Cheers,
Dano

Hi,

OK, if it works in debug and fails in optimized mode then there’s probably a compiler bug: it mis-optimizes something. It’s up to you to decide whether this is relevant enough for you to submit a bug report to Apple or not; we will of course help you with collecting the necessary ingredients. Let us know.

Cheers, Axel.