Problem compiling root

Hello
I can’t get root to compile on my box. I’ve tried root 3.10/02 and 4.0 versions…
The 3.10 version says something about a division by zero, and 4.0/02 and 03 end up with something like this:

Generating dictionary x11ttf/src/G__X11TTF.cxx...
utils/src/rootcint_tmp -f x11ttf/src/G__X11TTF.cxx -c x11ttf/inc/TGX11TTF.h x11ttf/inc/LinkDef.h
Internal Error: malloc failed for fgFontName[kTTMaxFonts] FILE:include/TTF.h LINE:75
make: *** [x11ttf/src/G__X11TTF.cxx] Segmentation fault
make: *** Deleting file `x11ttf/src/G__X11TTF.cxx'

and die…
Some info about the box:

exotic4 root # uname -a
Linux exotic4 2.6.4-gentoo-r1 #3 Tue Apr 6 12:09:51 EEST 2004 i686 AMD Athlon(tm) XP 2200+ AuthenticAMD GNU/Linux
exotic4 root # gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs
Configured with: /var/tmp/portage/gcc-3.3.3/work/gcc-3.3.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib --with-x --disable-multilib
Thread model: posix
gcc version 3.3.3 20040217 (Gentoo Linux 3.3.3, propolice-3.3-7)

Any ideas?

Hello,

Internal Error: malloc failed for fgFontName[kTTMaxFonts]

This error message shows that you have run out of heap memory. You could probably improve the situation by recompiling Linux kernel, but I am not sure about the detail.

Thank you
Masa Goto

Thanks for the reply! well, neither recompiling, nor using another kernel (2.6.5) worked… The weird part is that I have a similar machine at home (gentoo, kernel 2.6.4, gcc 3.3.3, Athlon XP) and I had no troubles in compiling root 4… I don’t remember if I have propolice at home, though… any idea on how to find/modify the heap size?

Start with the result of the shell command ‘limit’ (or ulimit on some unixes).

Cheers,
Philippe.

well, it says “unlimited”

ok, this is really weird…
If I replace fgFontName[kTTMaxFonts] with fgFontName[32] (the value of kTTMaxFonts defined previously in TTF.h) it compiles… then I get a similar complaint (malloc failed) at TMCProcessName[kMaxMCProcess] in vmc/inc/TMCProcess.h, and fixing it by hand works here, too… then for fgAuthMeth[kMAXSEC], in include/TAuthenticate.h (same solution), graf/inc/TTF.h (lots of them here, I had to replace all occurances of kTTMaxFonts and kMaxGlyphs with their numerical values), then in net/inc/TAuthenticate.h (same as above)…
I managed to compile it now… Should I report this as a bug?
Edit:
actually, there are only 3 files that need to be modified, before running make for the first time… I made myself a diff now…

Hi,

Could you install and run valgrind ( valgrind.kde.org ):

and send me the result (of course with the original header files:)).

I do not access to a machine with 2.6.x installed and can not pursue the problem directly.

Cheers,
Philippe.

well, I will, as soon as I manage to get valgrind compiled (it says something like “can’t find a register in class BREG' while reloadingasm’”, and removing -fpic from the CFLAGS doesn’t help… I hope I’ll figure it out).

ok, there seems to be something wrong with my glibc… here is what valgrind says:

exotic4 root # valgrind -v --tool=none utils/src/rootcint_tmp -f x11ttf/src/G__X11TTF.cxx -c x11ttf/inc/TGX11TTF.h x11ttf/inc/LinkDef.h
==19543== Nulgrind, a binary JIT-compiler for x86-linux.
==19543== Copyright (C) 2002-2004, and GNU GPL'd, by Nicholas Nethercote.
==19543== Using valgrind-2.1.1, a program supervision framework for x86-linux.
==19543== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==19543== Valgrind library directory: /usr/lib/valgrind
==19543== Command line
==19543==    utils/src/rootcint_tmp
==19543==    -f
==19543==    x11ttf/src/G__X11TTF.cxx
==19543==    -c
==19543==    x11ttf/inc/TGX11TTF.h
==19543==    x11ttf/inc/LinkDef.h
==19543== Startup, with flags:
==19543==    -v
==19543==    --tool=none
==19543== Reading syms from /usr/src/root/utils/src/rootcint_tmp (0x0)
==19543== Reading syms from /lib/ld-2.3.3.so (0x81000000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /lib/ld-2.3.3.so (0xB0000000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /lib/libdl-2.3.3.so (0xB001F000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /lib/libc-2.3.3.so (0xB0022000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /usr/lib/valgrind/vgskin_none.so (0xB024E000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /usr/lib/valgrind/stage2 (0xB8000000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== REDIRECT soname:libc.so.6(__GI___errno_location) to soname:libpthread.so.0(__errno_location)
==19543== REDIRECT soname:libc.so.6(__errno_location) to soname:libpthread.so.0(__errno_location)
==19543== REDIRECT soname:libc.so.6(__GI___h_errno_location) to soname:libpthread.so.0(__h_errno_location)
==19543== REDIRECT soname:libc.so.6(__h_errno_location) to soname:libpthread.so.0(__h_errno_location)
==19543== REDIRECT soname:libc.so.6(__GI___res_state) to soname:libpthread.so.0(__res_state)
==19543== REDIRECT soname:libc.so.6(__res_state) to soname:libpthread.so.0(__res_state)
==19543== REDIRECT soname:libc.so.6(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==19543== REDIRECT soname:libc.so.6(strnlen) to *vgpreload_memcheck.so*(strnlen)
==19543== REDIRECT soname:ld-linux.so.2(stpcpy) to *vgpreload_memcheck.so*(stpcpy)
==19543== REDIRECT soname:ld-linux.so.2(strchr) to *vgpreload_memcheck.so*(strchr)
==19543== 
==19543== Reading syms from /usr/lib/valgrind/vg_inject.so (0x81015000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /lib/libdl-2.3.3.so (0x81025000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5.0.5 (0x81029000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /lib/libm-2.3.3.so (0x810E3000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Reading syms from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libgcc_s.so.1 (0x81106000)
==19543== Reading syms from /lib/libc-2.3.3.so (0x81110000)
==19543==    object doesn't have a symbol table
==19543==    object doesn't have any debug info
==19543== Warning: client syscall mprotect tried to modify addresses 0x0-0x171000
==19543==    at 0x8100F594: (within /lib/ld-2.3.3.so)
==19543==    by 0x81001C7C: (within /lib/ld-2.3.3.so)
==19543==    by 0x8100D9EB: (within /lib/ld-2.3.3.so)
==19543==    by 0x81000D99: (within /lib/ld-2.3.3.so)
utils/src/rootcint_tmp: error while loading shared libraries: cannot make segment writable for relocation: Cannot allocate memory
==19543== 
--19543--     TT/TC: 0 tc sectors discarded.
--19543--            1005 chainings, 0 unchainings.
--19543-- translate: new     1203 (22211 -> 121948; ratio 54:10)
--19543--            discard 0 (0 -> 0; ratio 0:10).
--19543--  dispatch: 200000 jumps (bb entries), of which 16378 (8%) were unchained.
--19543--            61/1295 major/minor sched events.  1212 tt_fast misses.
--19543-- reg-alloc: 15 t-req-spill, 23225+40 orig+spill uis, 3282 total-reg-r.
--19543--    sanity: 42 cheap, 2 expensive checks.
--19543--    ccalls: 0 C calls, 100% saves+restores avoided (0 bytes)
--19543--            0 args, avg 0.0 setup instrs each (0 bytes)
--19543--            0% clear the stack (0 bytes)
--19543--            0 retvals, 100% of reg-reg movs avoided (0 bytes)

quite strange, though…

Hi,

Quite strange indeed.

You could try to run in the debugger.
Do

gdb utils/src/rootcint_tmp gdb> run -f x11ttf/src/G__X11TTF.cxx -c x11ttf/inc/TGX11TTF.h x11ttf/inc/LinkDef.h gdb> files gdb> where Cheers,
Philippe

Hi

the backtrace ends with

#854 0x00020000 in STLContainerStreamer ()
Previous frame inner to this frame (corrupt stack?)

edit:
I have placed a core file at exotic4.nipne.ro/core.31824.tar.bz2 , in case you need it.

Hi,

It would help if you could reproduce this problem after rebuilding rootcint in debug mode (i.e. do gmak distclean and set the environment variable ROOTBUILD to debug). This would give us a better error from gdb.

Cheers,
Philippe.

Done, here’s the backtrace

#0  0x80146701 in ?? ()
#1  0x00000000 in ?? ()
#2  0x00000000 in ?? ()
#3  0x00000000 in ?? ()
#4  0xffffffff in ?? ()
#5  0xffffffff in ?? ()
#6  0x00000000 in ?? ()
#7  0x00000001 in ?? ()
#8  0x8054ce00 in ?? ()
#9  0x00000000 in ?? ()
#10 0x4016924e in ?? ()
#11 0x00000017 in ?? ()
#12 0x72656d61 in ?? ()
#13 0x0000003b in ?? ()

exotic4.nipne.ro/core.5221.tar.bz2
exotic4.nipne.ro/strace-log.tar.bz2

I hope the strace log helps some more…

It is the backtrace from running from gdb with the debug symbol? This is relatively unusual!?

Philippe