Home | News | Documentation | Download

Segmentation violation occurs in Tree->Fill() only in some events. How find the problem?

tree

#1

ROOT Version: 5.08
Platform: AIX 5
Compiler: xlC


Hello everyone,
We are working on an implementation of a software to produce the output of experiment in a ROOT Tree. To this aim, we mixed FORTRAN and C++ programming to connect the current software to the new version. The software loops over all the events and for each one, takes data and writes them in a TTree contained in an output file. Then, at the end of processing on every event, it calls the Tree->Fill() method.

The problem occurred in a specific event and seems that the program crashed during the writing phase. The size of the output file is small (about 150MB), then we think that the problem is in the data. The traceback by the debugger is the following:

R__send_bits()
R__send_all_trees()
R__flush_block()
R__Deflate_fast()
R__zip()
TKey::TKey(const TObject*..)
TDirectory::CreateKey(const..)
TDirectory::WriteTObject(..)
TObject::Write(const char..)
TObject::Write(const char..)
TTree::AutoSave(const char..)
TTree::Fill()
TreeWriter::fillTTree()
fillntu_()
samev_()
sigtad_()
uicadr_()
anproc_()
anbgan_()

And the following is the std err:


  Traceback:
    Location 0xd4d28cec
    Location 0xd4d26cec
    Location 0xd4d28f30
    Location 0xd4d28558
    Location 0xd4d27f30
    Location 0xd4d55910
    Location 0xd48bf764
    Location 0xd48c5490
    Location 0xd48a85c0
    Location 0xd48a8784
    Location 0xd40c41ac
    Location 0xd40c9278
    Offset 0x00000068 in procedure fillTTree__10TreeWriterFv, near line 1323 in file ../ref/TreeWriter.cpp
    Offset 0x00000014 in procedure fillntu_, near line 24 in file ../ref/Fort2C.cpp
    Offset 0x0002257c in procedure samev_, near line 6697 in file sample.f
    Offset 0x00000018 in procedure sigtad_
    Offset 0x0000001c in procedure uicadr_
    Offset 0x000004f0 in procedure ancevt_
    Offset 0x00000fdc in procedure anproc_
    Offset 0x000008c8 in procedure anbgan_
    Offset 0x00000544 in procedure anpars_
    Offset 0x0000000c in procedure angen_pars_, near line 700 in file sample_bj.f
    Offset 0x000000a4 in procedure anmain
    --- End of call chain ---

I cannot figure out how find the problem, every suggestion is more than welcome.
Thanks everyone!


#2

Hi Luigi,

As I understood you are using ROOT 5.08 on old version AIX 5?
@Axel can you please recommend what we can do here?

Cheers,
Oksana.


#3

Could you run this under valgrind? It seems to support AIX 5.3!

  • Install valgrind,
  • build a debug build of your software and ROOT,
  • prepend valgrind --num-callers=50 --track-origins=yes --suppressions=$ROOTSYS/etc/valgrind-root.supp to whatever you run, e.g. valgrind --num-callers=50 --track-origins=yes --suppressions=$ROOTSYS/etc/valgrind-root.supp ./myProgram

Cheers, Axel.


#4

Thanks for your reply! Unfortunately we cannot install valgrind on our machine, at least for now… Meanwhile we tried to profile the ROOT memory and process memory.
This is before the first event

Object statistics
class                         cnt    on heap     size    total size    heap size
================================================================================
TFile                           1          1      288           288          288
TLeafI                        271        271       72         19512        19512
TNamed                          1          1       28            28           28
TObject                       156        156       12          1872         1872
TBasket                       636        636      128         81408        81408
TKey                            1          1       96            96           96
TLeafF                        357        357       72         25704        25704
TLeafB                          8          8       68           544          544
TTree                           1          1      376           376          376
TObjArray                    2008       2008       40         80320        80320
TStreamerInfo                  28         28       92          2576         2576
TList                         898        896       44         39512        39424
TBranch                       636        636      296        188256       188256
TStreamerBasicType             61         61      124          7564         7564
TStreamerBase                  27         27      128          3456         3456
TStreamerObject                 5          5      120           600          600
TStreamerObjectPointer         10         10      120          1200         1200
TStreamerObjectAny              2          2      120           240          240
TStreamerString                 7          7      120           840          840
TStreamerBasicPointer           4          4      144           576          576
TBuffer                       636        636       84         53424        53424
TObjString                    580        580       20         11600        11600
TGlobal                       676        676       32         21632        21632
TMethod                       370        370       76         28120        28120
TDataMember                   304        304       88         26752        26752
TPair                         570        570       20         11400        11400
TDataType                     191        191       52          9932         9932
TPluginHandler                 77         77       68          5236         5236
TRealData                     390        390       36         14040        14040
TBaseClass                     31         31       40          1240         1240
TClass                         60         60      192         11520        11520
TFolder                        19         19       36           684          684
THashList                      10         10       48           480          480
TROOT                           1          0      328           328            0
TOrdCollection                  6          6       44           264          264
TClassMenuItem                 63         63       60          3780         3780
TMap                            1          0       28            28            0
TObjectTable                    1          1       24            24           24
THashTable                     12         11       40           480          440
TMethodCall                    18         18       60          1080         1080
TGuiFactory                     1          1       28            28           28
TImagePalette                   2          2       36            72           72
TStyle                          5          5      812          4060         4060
TProcessUUID                    1          1       44            44           44
TSystemDirectory                1          1       44            44           44
TRandom                         2          2       32            64           64
TProcessID                      1          1       36            36           36
TCint                           1          1      240           240          240
TPluginManager                  1          1       16            16           16
TClassTable                     1          1       12            12           12
TEnv                            1          1       24            24           24
TTimer                          1          0       64            64            0
TMessageHandler                 1          1       56            56           56
TVirtualX                       1          1       84            84           84
TFree                           1          1       32            32           32
TUnixSystem                     1          1      236           236          236
TBits                           1          1       24            24           24
--------------------------------------------------------------------------------
Total:                       9157       9151     5684        662148       661600
================================================================================

This is in the last event before the crash:

Object statistics
class                         cnt    on heap     size    total size    heap size
================================================================================
TFile                           1          1      288           288          288
TLeafI                        271        271       72         19512        19512
TNamed                          1          1       28            28           28
TObject                       156        156       12          1872         1872
TBasket                       636        636      128         81408        81408
TKey                            1          1       96            96           96
TLeafF                        357        357       72         25704        25704
TLeafB                          8          8       68           544          544
TTree                           1          1      376           376          376
TObjArray                    2017       2017       40         80680        80680
TStreamerInfo                  28         28       92          2576         2576
TList                         929        927       44         40876        40788
TBranch                       636        636      296        188256       188256
TStreamerBasicType             61         61      124          7564         7564
TStreamerBase                  27         27      128          3456         3456
TStreamerObject                 5          5      120           600          600
TStreamerObjectPointer         10         10      120          1200         1200
TStreamerObjectAny              2          2      120           240          240
TStreamerString                 7          7      120           840          840
TStreamerBasicPointer           4          4      144           576          576
TBuffer                       636        636       84         53424        53424
TObjString                    580        580       20         11600        11600
TGlobal                       676        676       32         21632        21632
TMethod                       370        370       76         28120        28120
TDataMember                   304        304       88         26752        26752
TPair                         570        570       20         11400        11400
TDataType                     191        191       52          9932         9932
TPluginHandler                 77         77       68          5236         5236
TRealData                     390        390       36         14040        14040
TBaseClass                     31         31       40          1240         1240
TClass                         70         70      192         13440        13440
TFolder                        19         19       36           684          684
THashList                      10         10       48           480          480
TROOT                           1          0      328           328            0
TOrdCollection                  6          6       44           264          264
TClassMenuItem                 72         72       60          4320         4320
TMap                            1          0       28            28            0
TObjectTable                    1          1       24            24           24
THashTable                     12         11       40           480          440
TMethodCall                    18         18       60          1080         1080
TGuiFactory                     1          1       28            28           28
TImagePalette                   2          2       36            72           72
TStyle                          5          5      812          4060         4060
TProcessUUID                    1          1       44            44           44
TSystemDirectory                1          1       44            44           44
TRandom                         2          2       32            64           64
TProcessID                      1          1       36            36           36
TCint                           1          1      240           240          240
TPluginManager                  1          1       16            16           16
TClassTable                     1          1       12            12           12
TEnv                            1          1       24            24           24
TTimer                          1          0       64            64            0
TMessageHandler                 1          1       56            56           56
TVirtualX                       1          1       84            84           84
TFree                           5          5       32           160          160
TUnixSystem                     1          1      236           236          236
TBits                           1          1       24            24           24
TQClass                         2          2      204           408          408
--------------------------------------------------------------------------------
Total:                       9222       9216     5888        666868       666320
================================================================================

It doesn’t seems that ROOT structure grow too much… and also the process memory (vsz) reach a peak of 70.74 MB. I don’t know if this information could help to understand the problem… I’ll try to convince to install valgrind!