Re: [ROOT] TPostScript and Debian woody {Segfault on ~TVirtualPS}

From: Marcos Gimenez Alvarez (margial@ific.uv.es)
Date: Sat May 29 2004 - 17:13:08 MEST


Hello again

rootn.exe does not crashes anymore when deleting ps, (at least for me).
And after debugging rootn.exe again, only 2 errors appeared, those 2
related to libX11 and none related to postscipt things.

Maybe Christian Vogel could check the new version in cvs, too

Bye

Marcos

> Hi Marcos,
>
> Thanks for sending the gdb traceback. I believe that I understand the
> problem and fixed it in CVS. Could you try the CVS version?
> I still do not understand why the problem was not visible on the other
> systems.
>
> Rene Brun
>
> On Sat, 29 May
> 2004, Marcos Gimenez Alvarez wrote:
>
>>
>> I used valgrind and i got the following output, i hope it helps
>>
>> margial@margial:~$ valgrind root
>> ==6064== Memcheck, a.k.a. Valgrind, a memory error detector for
>> x86-linux. ==6064== Copyright (C) 2002-2003, and GNU GPL'd, by Julian
>> Seward. ==6064== Using valgrind-2.0.0, a program supervision framework
>> for x86-linux.
>> .....
>>   *******************************************
>>   *                                         *
>>   *        W E L C O M E  to  R O O T       *
>>   *                                         *
>>   *   Version   4.00/04       29 May 2004   *
>>   *                                         *
>>   *  You are welcome to visit our Web site  *
>>   *          http://root.cern.ch            *
>>   *                                         *
>>   *******************************************
>>
>> FreeType Engine v2.1.3 used to render TrueType fonts.
>> Compiled for linuxdeb with thread support.
>>
>> CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004
>> Type ? for help. Commands must be C++ statements.
>> Enclose multiple statements between { }.
>> root [0] gDebug=5  //To get more info
>> (const int)5
>> root [1] TPostScript *ps = new TPostScript("test.ps");
>> Info in <TPluginManager::FindHandler>: did not find plugin for class
>> TSystem and uri test.ps
>> root [2]  TF1 f("sin(x)","sin(x)");
>> root [3]  f.Draw();
>> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>> Info in <TPluginManager::FindHandler>: found plugin for THistPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TGraphPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TPainter3dAlgorithms
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class THistPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TPaletteAxis
>> Info in <TPluginManager::FindHandler>: found plugin for TUtilHist root
>> [4] delete ps;
>> root [5] .q
>> ==6064==
>> ==6064== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from
>> 0) ==6064== malloc/free: in use at exit: 26 bytes in 1 blocks.
>> ==6064== malloc/free: 682 allocs, 681 frees, 406469 bytes allocated.
>> ==6064== For a detailed leak analysis,  rerun with: --leak-check=yes
>> ==6064== For counts of detected errors, rerun with: -v
>>
>> margial@margial:~$ valgrind rootn.exe
>> ==6069== Memcheck, a.k.a. Valgrind, a memory error detector for
>> x86-linux. ==6069== Copyright (C) 2002-2003, and GNU GPL'd, by Julian
>> Seward. ==6069== Using valgrind-2.0.0, a program supervision framework
>> for x86-linux.
>> ......
>>   *******************************************
>>   *                                         *
>>   *        W E L C O M E  to  R O O T       *
>>   *                                         *
>>   *   Version   4.00/04       29 May 2004   *
>>   *                                         *
>>   *  You are welcome to visit our Web site  *
>>   *          http://root.cern.ch            *
>>   *                                         *
>>   *******************************************
>>
>> FreeType Engine v2.1.3 used to render TrueType fonts.
>> Compiled for linuxdeb with thread support.
>>
>> CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004
>> Type ? for help. Commands must be C++ statements.
>> Enclose multiple statements between { }.
>> root [0] gDebug=5
>> (const int)5
>> root [1] TPostScript *ps = new TPostScript("test.ps");
>> Info in <TPluginManager::FindHandler>: did not find plugin for class
>> TSystem and uri test.ps
>> root [2]  TF1 f("sin(x)","sin(x)");
>> root [3]  f.Draw();
>> ==6069== Syscall param writev(vector[...]) contains uninitialised or
>> unaddressable byte(s)
>> ==6069==    at 0x40185973: vgAllRoadsLeadToRome_writev
>> (vg_intercept.c:111)
>> ==6069==    by 0x401859B0: __writev (vg_intercept.c:774)
>> ==6069==    by 0x46DF5532: (within /usr/X11R6/lib/libX11.so.6.2)
>> ==6069==    by 0x46DF604A: _X11TransWritev (in /usr/X11R6/lib/
>> libX11.so.6.2)
>> ==6069==    Address 0x480BF0D2 is 50 bytes inside a block of size 2048
>> alloc'd
>> ==6069==    at 0x40028074: calloc (vg_replace_malloc.c:284)
>> ==6069==    by 0x46DCE24E: XOpenDisplay (in
>> /usr/X11R6/lib/libX11.so.6.2) ==6069==    by 0x46CE02AF:
>> TGX11::OpenDisplay(char const *) (in /usr/ local/lib/root/libGX11.so)
>> ==6069==    by 0x472C002D: TGClient::TGClient(char const *) (in /usr/
>> local/lib/root/libGui.so)
>> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>> Info in <TPluginManager::FindHandler>: found plugin for THistPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TGraphPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TPainter3dAlgorithms
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class THistPainter
>> Info in <TCint::AutoLoadCallback>: loaded library libHistPainter.so
>> for class TPaletteAxis
>> ==6069==
>> ==6069== Invalid write of size 1
>> ==6069==    at 0x4002019B: strcpy (mac_replace_strmem.c:174)
>> ==6069==    by 0x403D48D2: TVirtualPS::PrintFast(int, char const *)
>> (in / usr/local/lib/root/libCore.so)
>> ==6069==    by 0x486569E1: TPostScript::MovePS(int, int) (in
>> /usr/local/ lib/root/libPostscript.so)
>> ==6069==    by 0x48652F1A: TPostScript::DrawFrame(double, double,
>> double, double, int, int, int, int) (in
>> /usr/local/lib/root/libPostscript.so) ==6069==    Address 0x487E409E
>> is 0 bytes after a block of size 250 alloc'd
>> ==6069==    at 0x40027D88: __builtin_vec_new (vg_replace_malloc.c:203)
>> ==6069==    by 0x403D4485: TVirtualPS::TVirtualPS(char const *, int)
>> (in / usr/local/lib/root/libCore.so)
>> ==6069==    by 0x48651458: TPostScript::TPostScript(char const *, int)
>> (in /usr/local/lib/root/libPostscript.so)
>> ==6069==    by 0x48663BBF: G__G__PostScript_125_2_0(G__value *, char
>> const *, G__param *, int) (in /usr/local/lib/root/libPostscript.so)
>> Info in <TPluginManager::FindHandler>: found plugin for TUtilHist root
>> [4] delete ps;
>> root [5] .q
>> ==6069==
>> ==6069== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 190 from
>> 3) ==6069== malloc/free: in use at exit: 14944021 bytes in 29550
>> blocks. ==6069== malloc/free: 70454 allocs, 40904 frees, 21849214
>> bytes allocated. ==6069== For a detailed leak analysis,  rerun with:
>> --leak-check=yes ==6069== For counts of detected errors, rerun with:
>> -v
>>
>>
>> I get the same output when i use valgrind root.exe and valgrind
>> rootn.exe, and no errors with valgrind root. (Notice when i don't use
>> valgrind to debug, root and root.exe don't crash and don't find any
>> errors but rootn.exe it does)
>>
>>  Could you run under the debugger and report the trace back when you
>>  get the crash? the automatic traceback that you report below is not
>>  always correct.
>> >
>> > Rene Brun
>> >
>> > On Sat, 29
>> > May 2004, Marcos Gimenez Alvarez wrote:
>> >
>> >> Hello
>> >> I installed root 4.00/04 on a deb woody and these are the outputs i
>> >> got.
>> >>
>> >> ps()
>> >> {
>> >> TPostScript *ps = new TPostScript("test.ps");
>> >>  TF1 f("sin(x)","sin(x)");
>> >>  f.Draw();
>> >>  delete ps;
>> >> }
>> >>
>> >>
>> >> with root works fine
>> >>
>> >> margial@margial:~$ root
>> >>   *******************************************
>> >>   *                                         *
>> >>   *        W E L C O M E  to  R O O T       *
>> >>   *                                         *
>> >>   *   Version   4.00/04       29 May 2004   *
>> >>   *                                         *
>> >>   *  You are welcome to visit our Web site  *
>> >>   *          http://root.cern.ch            *
>> >>   *                                         *
>> >>   *******************************************
>> >>
>> >> FreeType Engine v2.1.3 used to render TrueType fonts.
>> >> Compiled for linuxdeb with thread support.
>> >>
>> >> CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004
>> >> Type ? for help. Commands must be C++ statements.
>> >> Enclose multiple statements between { }.
>> >> root [0] .x ps.C
>> >> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1 root
>> >> [1]
>> >>
>> >> with rootn.exe
>> >>
>> >> margial@margial:~$ rootn.exe
>> >>   *******************************************
>> >>   *                                         *
>> >>   *        W E L C O M E  to  R O O T       *
>> >>   *                                         *
>> >>   *   Version   4.00/04       29 May 2004   *
>> >>   *                                         *
>> >>   *  You are welcome to visit our Web site  *
>> >>   *          http://root.cern.ch            *
>> >>   *                                         *
>> >>   *******************************************
>> >>
>> >> FreeType Engine v2.1.3 used to render TrueType fonts.
>> >> Compiled for linuxdeb with thread support.
>> >>
>> >> CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004
>> >> Type ? for help. Commands must be C++ statements.
>> >> Enclose multiple statements between { }.
>> >> root [0] .x ps.C
>> >> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>> >> Fatal in <operator delete>: storage area overwritten
>> >> aborting
>> >>  Generating stack trace...
>> >> /usr/bin/addr2line: rootn.exe: No such file or directory
>> >> /usr/bin/addr2line: rootn.exe: No such file or directory
>> >>  0x40024716 in __builtin_vec_delete + 0x1e from
>> >>  /usr/local/lib/root/
>> >> libNew.so
>> >>  0x401b7603 in TVirtualPS::~TVirtualPS(void) + 0x57 from
>> >>  /usr/local/lib/
>> >> root/libCore.so
>> >>  0x4192d9c2 in TPostScript::~TPostScript(void) + 0x66 from
>> >>  /usr/local/lib/
>> >> root/libPostscript.so
>> >>  0x41942260 in <unknown> from /usr/local/lib/root/libPostscript.so
>> >>  0x4079ba1e in G__call_cppfunc + 0x28a from
>> >>  /usr/local/lib/root/libCint.so 0x4078a28a in G__interpret_func +
>> >>  0x7ea from /usr/local/lib/root/
>> >> libCint.so
>> >>  0x40770099 in G__getfunction + 0x17b5 from
>> >>  /usr/local/lib/root/libCint.so 0x4079ad38 in G__delete_operator +
>> >>  0x2fc from /usr/local/lib/root/
>> >> libCint.so
>> >>  0x407b3f75 in G__exec_delete + 0x55 from
>> >>  /usr/local/lib/root/libCint.so 0x407ba6b7 in G__exec_statement +
>> >>  0x1b07 from /usr/local/lib/root/
>> >> libCint.so
>> >>  0x40749b78 in G__exec_tempfile_core + 0x2b4 from
>> >>  /usr/local/lib/root/
>> >> libCint.so
>> >>  0x40749d6d in G__exec_tempfile + 0x25 from
>> >>  /usr/local/lib/root/libCint.so 0x407c42bc in G__process_cmd +
>> >>  0x4cf8 from /usr/local/lib/root/libCint.so 0x401d88e0 in
>> >>  TCint::ProcessLine(char const *, TInterpreter::EErrorCode
>> >> *) + 0xac from /usr/local/lib/root/libCore.so
>> >>  0x401d8a0b in TCint::ProcessLineSynch(char const *,
>> >> TInterpreter::EErrorCode *) + 0x4f from
>> >> /usr/local/lib/root/libCore.so
>> >>  0x4014d043 in TApplication::ProcessFile(char const *, int *) +
>> >>  0x6d3
>> >> from /usr/local/lib/root/libCore.so
>> >>  0x4014c7fd in TApplication::ProcessLine(char const *, bool, int *)
>> >>  +
>> >> 0x54d from /usr/local/lib/root/libCore.so
>> >>  0x410bac0a in TRint::HandleTermInput(void) + 0x1ea from
>> >>  /usr/local/lib/
>> >> root/libRint.so
>> >>  0x410b9c52 in TTermInputHandler::Notify(void) + 0x2a from
>> >>  /usr/local/lib/
>> >> root/libRint.so
>> >>  0x410bb379 in TTermInputHandler::ReadNotify(void) + 0x25 from
>> >>  /usr/local/
>> >> lib/root/libRint.so
>> >>  0x40241f09 in TUnixSystem::CheckDescriptors(void) + 0xf5 from
>> >>  /usr/local/
>> >> lib/root/libCore.so
>> >>  0x40241671 in TUnixSystem::DispatchOneEvent(bool) + 0x105 from
>> >>  /usr/
>> >> local/lib/root/libCore.so
>> >>  0x401a4d37 in TSystem::InnerLoop(void) + 0x2f from
>> >>  /usr/local/lib/root/
>> >> libCore.so
>> >>  0x401a4cbb in TSystem::Run(void) + 0x6f from /usr/local/lib/root/
>> >> libCore.so
>> >>  0x4014d2a3 in TApplication::Run(bool) + 0x33 from
>> >>  /usr/local/lib/root/
>> >> libCore.so
>> >>  0x410ba60b in TRint::Run(bool) + 0x303 from /usr/local/lib/root/
>> >> libRint.so
>> >>  0x080487c7 in main + 0x87 from rootn.exe
>> >>  0x4117514f in __libc_start_main + 0xbb from /lib/libc.so.6
>> >>  0x08048681 in __register_frame_info + 0x3d from rootn.exe
>> >> Aborted
>> >>
>> >> Maybe it helps. Anyway it seems there is a difference between your
>> >> instalation and mine, you installed it using ./configure linux and
>> >> i did using ./configure linuxdeb, but i don't know which is more
>> >> suitable (i have tried both with other root versions and i did not
>> >> notice differences, but i am not an expert)
>> >>
>> >> > Hi,
>> >> >
>> >> > I have now tried this on three different Installations of
>> >> > Debian-Woody (=stable) and all show the same behaviour. Is
>> >> > someone here who uses Debian-Woody (x86) and is able to do what's
>> >> > outlined in my mail below without root crashing?
>> >> >
>> >> > 	Chris
>> >> >
>> >> > On Thu, May 27, 2004 at 01:16:53PM +0200, Christian Vogel wrote:
>> >> >> using root-4.00.03 and 04, compiled with gcc-3.3 or gcc-2.95 I
>> >> >> get a fatal error after saving a postscript file, the moment
>> >> >> when TPostScript is being destroyed. To reproduce:
>> >> >>
>> >> >> TF1 f("sin(x)","sin(x)");
>> >> >> f.Draw();
>> >> >> MENU: File -> Save As -> c1.ps
>> >> >>
>> >> >> or...
>> >> >>
>> >> >> TPostScript *ps = new TPostScript("test.ps")
>> >> >> TF1 f("sin(x)","sin(x)");
>> >> >> f.Draw();
>> >> >> delete ps;
>> >> >>
>> >> >> This is on Linux/x86, debian-woody.
>> >> >>
>> >> >> 	Chris
>> >> >>
>> >> >> > chris@pi2105:~$ root
>> >> >> >   *******************************************
>> >> >> >   *                                         *
>> >> >> >   *        W E L C O M E  to  R O O T       *
>> >> >> >   *                                         *
>> >> >> >   *   Version   4.00/04       27 May 2004   *
>> >> >> >   *                                         *
>> >> >> >   *  You are welcome to visit our Web site  *
>> >> >> >   *          http://root.cern.ch            *
>> >> >> >   *                                         *
>> >> >> >   *******************************************
>> >> >> > FreeType Engine v2.1.3 used to render TrueType fonts.
>> >> >> > Compiled for linux with thread support.
>> >> >> > CINT/ROOT C/C++ Interpreter version 5.15.133, Apr 18 2004 Type
>> >> >> > ? for help. Commands must be C++ statements.
>> >> >> > Enclose multiple statements between { }.
>> >> >> > root [0] TPostScript *ps = new TPostScript("test.ps")
>> >> >> > root [1] TF1 f("sin(x)","sin(x)");
>> >> >> > root [2] f.Draw();
>> >> >> > <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>> >> >> > root [3] delete ps;
>> >> >> > Fatal in <operator delete>: storage area overwritten
>> >> >> > aborting
>> >> >> >  Generating stack trace...
>> >> >> > /usr/bin/addr2line: rootn.exe: No such file or directory
>> >> >> > /usr/bin/addr2line: rootn.exe: No such file or directory
>> >> >> >  0x40026746 in __builtin_vec_delete + 0x1e from
>> >> >> >  /usr/opt/root/lib/root/libNew.so.4.00 0x401b9613 in
>> >> >> >  TVirtualPS::~TVirtualPS(void) + 0x57 from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x419f49e2 in
>> >> >> >  TPostScript::~TPostScript(void) + 0x66 from
>> >> >> >  /usr/opt/root-4.00.04/lib/root/libPostscript.so 0x41a09280 in
>> >> >> >  <unknown> from
>> >> >> >  /usr/opt/root-4.00.04/lib/root/libPostscript.so 0x4079da2e in
>> >> >> >  G__call_cppfunc + 0x28a from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x4078c29a in
>> >> >> >  G__interpret_func + 0x7ea from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x407720a9 in
>> >> >> >  G__getfunction + 0x17b5 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x4079cd48 in
>> >> >> >  G__delete_operator + 0x2fc from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x407b5f85 in
>> >> >> >  G__exec_delete + 0x55 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x407bc6c7 in
>> >> >> >  G__exec_statement + 0x1b07 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x4074bb88 in
>> >> >> >  G__exec_tempfile_core + 0x2b4 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x4074bd4d in
>> >> >> >  G__exec_tempfile_fp + 0x25 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x407c6717 in
>> >> >> >  G__process_cmd + 0x5143 from
>> >> >> >  /usr/opt/root/lib/root/libCint.so.4.00 0x401da8f0 in
>> >> >> >  TCint::ProcessLine(char const *, TInterpreter::EErrorCode *)
>> >> >> >  + 0xac from /usr/opt/root/lib/root/libCore.so.4.00 0x4014e88e
>> >> >> >  in TApplication::ProcessLine(char const *, bool, int *) +
>> >> >> >  0x5ce from /usr/opt/root/lib/root/libCore.so.4.00 0x410bcbca
>> >> >> >  in TRint::HandleTermInput(void) + 0x1ea from
>> >> >> >  /usr/opt/root/lib/root/libRint.so.4.00 0x410bbc12 in
>> >> >> >  TTermInputHandler::Notify(void) + 0x2a from
>> >> >> >  /usr/opt/root/lib/root/libRint.so.4.00 0x410bd339 in
>> >> >> >  TTermInputHandler::ReadNotify(void) + 0x25 from
>> >> >> >  /usr/opt/root/lib/root/libRint.so.4.00 0x40243f19 in
>> >> >> >  TUnixSystem::CheckDescriptors(void) + 0xf5 from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x40243681 in
>> >> >> >  TUnixSystem::DispatchOneEvent(bool) + 0x105 from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x401a6d47 in
>> >> >> >  TSystem::InnerLoop(void) + 0x2f from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x401a6ccb in
>> >> >> >  TSystem::Run(void) + 0x6f from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x4014f2b3 in
>> >> >> >  TApplication::Run(bool) + 0x33 from
>> >> >> >  /usr/opt/root/lib/root/libCore.so.4.00 0x410bc5cb in
>> >> >> >  TRint::Run(bool) + 0x303 from
>> >> >> >  /usr/opt/root/lib/root/libRint.so.4.00 0x080487e7 in main +
>> >> >> >  0x87 from rootn.exe
>> >> >> >  0x4117714f in __libc_start_main + 0xbb from /lib/libc.so.6
>> >> >> >  0x080486a1 in __register_frame_info + 0x31 from rootn.exe
>> >> >>
>> >> >>
>> >> >> --
>> >> >> programming java / steaming mugs of fresh brewed code / chill,
>> >> >> jobless winter. -- gnovos on the kuro5hin.org Textad Haiku
>> >> >> Contest
>> >> >>
>> >> >
>> >> > --
>> >> > Windows (ms): Will install needless data on whole system
>> >>
>> >>
>> >>
>>
>>
>>



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET