ROOT Version: 6.24
Platform: Centos7.9
Compiler: gcc8
I am using THttpServer
to display a histogram on the web, and I want to save the histogram as a PNG file. However, I encountered an issue where the program crashes. Could you help me understand why this might be happening? Thank you!
The stack is as follows:
#6 0x00007ffa580e4675 in decode_asscanline_native () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libASImage.so
#7 0x00007ffa580e44bc in decode_image_scanline_normal () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libASImage.so
#8 0x00007ffa580fd791 in tile_asimage () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libASImage.so
#9 0x00007ffa580a894b in TASImage::BeginPaint(bool) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libASImage.so
#10 0x00007ffa583a823f in TImageDump::DrawBox(double, double, double, double) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libPostscript.so
#11 0x00007ffa7d8077fc in TPad::PaintBox(double, double, double, double, char const*) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libGpad.so
#12 0x00007ffa7d7ff10b in TPad::PaintBorder(short, bool) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libGpad.so
#13 0x00007ffa7d7ff616 in TPad::Clear(char const*) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libGpad.so
#14 0x00007ffa7fd6da0c in TH1::Draw(char const*) () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libHist.so
#15 0x00007ffa7b7d857b in HistogramDraw::drawHistogram (this=0x337ec60, data=std::vector of length 30, capacity 30 = {...}) at /opt/daq/daqv2.0/Monitor/Draw/src/HistogramDraw.cpp:1151
#16 0x000000000045d0d1 in MonitorControl::drawData (this=0x337d640) at /opt/daq/daqv2.0/Monitor/src/MonitorControl_ROOT.cpp:171
#17 0x000000000045c4e7 in MonitorControl::<lambda()>::operator()(void) const (__closure=0x38ae288) at /opt/daq/daqv2.0/Monitor/src/MonitorControl_ROOT.cpp:48
#18 0x000000000045dd8f in std::__invoke_impl<void, MonitorControl::start()::<lambda()> >(std::__invoke_other, MonitorControl::<lambda()> &&) (__f=...) at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/invoke.h:60
#19 0x000000000045dac0 in std::__invoke<MonitorControl::start()::<lambda()> >(MonitorControl::<lambda()> &&) (__fn=...) at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/invoke.h:95
#20 0x000000000045e194 in std::thread::_Invoker<std::tuple<MonitorControl::start()::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x38ae288) at /opt/rh/devtoolset-8/root/usr/include/c++/8/thread:244
#21 0x000000000045e150 in std::thread::_Invoker<std::tuple<MonitorControl::start()::<lambda()> > >::operator()(void) (this=0x38ae288) at /opt/rh/devtoolset-8/root/usr/include/c++/8/thread:253
#22 0x000000000045e114 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<MonitorControl::start()::<lambda()> > > >::_M_run(void) (this=0x38ae280) at /opt/rh/devtoolset-8/root/usr/include/c++/8/thread:196
#23 0x00007ffa7ce63d2f in execute_native_thread_routine () from /opt/daq/daqv2.0/external/installed/root6-24/lib/libRHTTP.so
#24 0x00007ffa7bbfdea5 in start_thread () from /lib64/libpthread.so.0
#25 0x00007ffa79ff6b0d in clone () from /lib64/libc.so.6
My code is as follows:
auto canvas_tmp = new TCanvas("canvas_fansile", "Canvas_fansile", 800, 600);
mergedHist->Draw();
{
if(mergedHist && canvas_tmp)
{
canvas_tmp->SaveAs("test.png");
delete canvas_tmp;
}
}