Segmentation violation in print to file

Hi
i compiled for armhf (Zynq 7000) root version Version 5.34/39 from patch branch on patch
This is the only version of root I was able to compile. Version 6 (any) the cmake says that 32 bit arm processor is uknown architecture and stop immediately (for me root 6 would be better but i don’t know how to do)
In order to compile I installed qemu-static and chroot into the Zynq filesystem. I’m running ubuntu 20.04 32 bit on Zynq (NOT PETALINUX ROOTFS)

I compiled with the following script

export LOCATION=/home/zynq
export ROOTSYS=${LOCATION}/cern-root/
rm -rf ${ROOTSYS}

CONFIGURE_OPTIONS="\
--enable-soversion --all \
 --disable-mysql \
 --disable-sqlite \
 --disable-cintex \
 --disable-vc \
 --prefix=${ROOTSYS} \
 --etcdir=${ROOTSYS}etc/ \
"
echo CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS}


./configure ${CONFIGURE_OPTIONS}
make -j30
make -j install

Root is working pretty well except for the print

whereever i put this code

mycanvas->Print("graph.pdf");

(i also tried with png), root crash with

*** Break *** segmentation violation
 Generating stack trace...
 0x3ea7d99a in TPad::Print(char const*, char const*) + 0x1485 from /home/zynq/cern-root//lib/root/libGpad.so.5.34
 0x3ea7eeac in TPad::SaveAs(char const*, char const*) const + 0x36b from /home/zynq/cern-root//lib/root/libGpad.so.5.34
 0x3ea7c42c in TPad::Print(char const*) const + 0x1b from /home/zynq/cern-root//lib/root/libGpad.so.5.34
 0x400012ca in macro1() + 0x249 from ./macro1
 0x40001462 in main + 0x65 from ./macro1
 0x3e7cd9a4 in __libc_start_main + 0x97 from /lib/arm-linux-gnueabihf/libc.so.6

i’m compiling my macro with

g++ macro1.cxx -o macro1 `root-config --cflags --glibs`

On the system I have no gui and no x11 installed? is this a problem

thank you very much

Andrea

Not sure if this would work, but try adding

 gROOT->SetBatch(1);

to your macro.

Thank you dastudillo

i’m getting the same error

*** Break *** segmentation violation
Generating stack trace…
0x3e6e899a in TPad::Print(char const*, char const*) + 0x1485 from /home/zynq/cern-root//lib/root/libGpad.so.5.34
0x3e6e9eac in TPad::SaveAs(char const*, char const*) const + 0x36b from /home/zynq/cern-root//lib/root/libGpad.so.5.34
0x40006d04 in FitRoutine(TCanvas*, TH1*, float, float, TString) + 0x453 from ./fitbackgroud
0x4000712a in main + 0x185 from ./fitbackgroud
0x3e1529a4 in __libc_start_main + 0x97 from /lib/arm-linux-gnueabihf/libc.so.6
zynq@2137669d4f08:~/root_test$

I tried to compile the same root (same version) with exaclty the same options on a x64 pc (inside a docker) and it works perfectly.

To install ROOT 6 you should use cmake not configure. I guess you did that?

I tried with cmake but it’s cmake to stop immediately because it does not recognize arm 32bit processor. I tried on aarch64 and works but i have a zynq 7000 that is armhf

The segmentation violation you are seeing is likely due to a conflict between the version of ROOT you are using and the version of the Qt library that is installed on your system. ROOT 5.34/39 was released before Qt 5.15, so it is possible that the Qt library that is installed on your system is not compatible with ROOT 5.34/39.

To fix this problem, you can try installing an older version of the Qt library. For example, you could try installing Qt 5.14 or Qt 5.13. You can also try compiling ROOT with Qt support disabled. To do this, you would remove the --enable-qt option from the CONFIGURE_OPTIONS variable in your script.

Here is a revised version of your script that disables Qt support:

export LOCATION=/home/zynq
export ROOTSYS=${LOCATION}/cern-root/
rm -rf ${ROOTSYS}

CONFIGURE_OPTIONS="\
--enable-soversion --all \
--disable-mysql \
--disable-sqlite \
--disable-cintex \
--disable-vc \
--disable-qt \
--prefix=${ROOTSYS} \
--etcdir=${ROOTSYS}etc/ \
"
echo CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS}


./configure ${CONFIGURE_OPTIONS}
make -j30
make -j install

Once you have compiled ROOT with Qt support disabled, you should be able to print your canvas to a PDF or PNG file without any problems.

As for your question about whether or not the lack of a GUI or X11 installation will cause any problems, the answer is probably not. ROOT is able to run without a GUI or X11 installation, but you will not be able to use any of the GUI features of ROOT.

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