CARTAvis / carta-backend

Source code repository for the backend component of CARTA, a new visualization tool designed for the ALMA, the VLA and the SKA pathfinders.
https://cartavis.github.io/
GNU General Public License v3.0
22 stars 11 forks source link

[backend crash] region spectral profile from a gz cube #1271

Closed kswang1029 closed 1 year ago

kswang1029 commented 1 year ago

Describe the bug If we request a region spectral profile (including point region) from the attached gz cube, the backend will crash. However, cursor spectral profile works fine.

gass_0_0_1673503751.fits.gz

Thread 3 Crashed: 0 libcfitsio.10.4.2.0.dylib 0x10525253c ffgidm + 48 1 libcfitsio.10.4.2.0.dylib 0x10525628c ffgsv + 112 2 carta_backend 0x104477c9c bool carta::CartaFitsImage::GetDataSubset(fitsfile, int, casacore::Slicer const&, casacore::Array<float, std::1::allocator>&) + 1200 (CartaFitsImage.tcc:61) 3 carta_backend 0x104474318 carta::CartaFitsImage::doGetSlice(casacore::Array<float, std::__1::allocator>&, casacore::Slicer const&) + 316 (CartaFitsImage.cc:138) 4 libcasa_lattices.6.dylib 0x10656c124 casacore::Lattice::getSlice(casacore::Array<float, std::1::allocator>&, casacore::Slicer const&, bool) + 124 5 libcasa_lattices.6.dylib 0x10657b700 casacore::SubLattice::doGetSlice(casacore::Array<float, std::__1::allocator>&, casacore::Slicer const&) + 364 6 libcasa_lattices.6.dylib 0x10656c124 casacore::Lattice::getSlice(casacore::Array<float, std::__1::allocator>&, casacore::Slicer const&, bool) + 124 7 libcasa_lattices.6.dylib 0x10654f6bc casacore::LatticeIterInterface::readData(bool) + 496 8 libcasa_lattices.6.dylib 0x10654f150 casacore::LatticeIterInterface::cursor(bool, bool) + 64 9 libcasa_lattices.6.dylib 0x106565e9c casacore::LatticeApply<float, double>::tiledApply(casacore::MaskedLattice&, casacore::MaskedLattice const&, casacore::TiledCollapser<float, double>&, casacore::IPosition const&, int, casacore::LatticeProgress) + 1296 10 libcasa_lattices.6.dylib 0x106554d88 casacore::LatticeStatistics::generateStorageLattice() + 1300 11 libcasa_lattices.6.dylib 0x10655c414 casacore::LatticeStatistics::getStatistic(casacore::Array<double, std::1::allocator>&, casacore::LatticeStatsBase::StatisticsTypes, bool) + 236 12 carta_backend 0x1045687dc carta::CalcStatsValues(std::1::map<CARTA::StatsType, std::1::vector<double, std::1::allocator>, std::1::less, std::1::allocator<std::1::pair<CARTA::StatsType const, std::1::vector<double, std::1::allocator>>>>&, std::1::vector<CARTA::StatsType, std::1::allocator> const&, casacore::ImageInterface const&, bool) + 640 (StatsCalculator.cc:123) 13 carta_backend 0x10443dfb0 carta::Frame::GetRegionStats(carta::StokesRegion const&, std::1::vector<CARTA::StatsType, std::1::allocator> const&, bool, std::1::map<CARTA::StatsType, std::1::vector<double, std::1::allocator>, std::1::less, std::1::allocator<std::1::pair<CARTA::StatsType const, std::1::vector<double, std::1::allocator>>>>&) + 136 (Frame.cc:1682) 14 carta_backend 0x1045e055c carta::RegionHandler::GetRegionSpectralData(int, int, AxisRange const&, std::__1::basic_string<char, std::1::char_traits, std::1::allocator>&, int, std::1::vector<CARTA::StatsType, std::1::allocator>&, bool, std::1::function<void (std::1::map<CARTA::StatsType, std::1::vector<double, std::1::allocator>, std::1::less, std::1::allocator<std::1::pair<CARTA::StatsType const, std::1::vector<double, std::1::allocator>>>>, float)> const&)::$_21::operator()(std::1::map<CARTA::StatsType, std::1::vector<double, std::1::allocator>, std::1::less, std::1::allocator<std::1::pair<CARTA::StatsType const, std::1::vector<double, std::1::allocator>>>>&, int) const + 372 (RegionHandler.cc:2030) 15 carta_backend 0x1045de424 carta::RegionHandler::GetRegionSpectralData(int, int, AxisRange const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator>&, int, std::1::vector<CARTA::StatsType, std::1::allocator>&, bool, std::1::function<void (std::1::map<CARTA::StatsType, std::1::vector<double, std::1::allocator>, std::1::less, std::1::allocator<std::1::pair<CARTA::StatsType const, std::1::vector<double, std::1::allocator>>>>, float)> const&) + 5024 (RegionHandler.cc:2045) 16 carta_backend 0x1045dcecc carta::RegionHandler::FillSpectralProfileData(std::__1::function<void (CARTA::SpectralProfileData)>, int, int, bool) + 1612 (RegionHandler.cc:1814) 17 carta_backend 0x10460184c carta::Session::SendSpectralProfileData(int, int, bool) + 136 (Session.cc:1683) 18 carta_backend 0x1045f20d8 carta::SpectralProfileTask::execute() + 28 (OnMessageTask.cc:70) 19 carta_backend 0x10464ca18 carta::ThreadManager::StartEventHandlingThreads(int)::$_0::operator()() const + 96 (ThreadingManager.cc:54) [inlined] 20 carta_backend 0x10464ca18 decltype(static_cast<carta::ThreadManager::StartEventHandlingThreads(int)::$_0>(fp)()) std::1::invoke<carta::ThreadManager::StartEventHandlingThreads(int)::$_0>(carta::ThreadManager::StartEventHandlingThreads(int)::$_0&&) + 96 (type_traits:3918) [inlined] 21 carta_backend 0x10464ca18 void std::1::thread_execute<std::__1::unique_ptr<std::1::thread_struct, std::__1::default_delete<std::1::thread_struct>>, carta::ThreadManager::StartEventHandlingThreads(int)::$_0>(std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete>, carta::ThreadManager::StartEventHandlingThreads(int)::$_0>&, std::1::tuple_indices<>) + 96 (thread:287) [inlined] 22 carta_backend 0x10464ca18 void std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::__1::default_delete>, carta::ThreadManager::StartEventHandlingThreads(int)::$_0>>(void) + 192 (thread:298) 23 libsystem_pthread.dylib 0x18aff7fa8 _pthread_start + 148 24 libsystem_pthread.dylib 0x18aff2da0 thread_start + 8

To Reproduce Steps to reproduce the behavior:

  1. load the attached gz cube
  2. enable spectral profiler and see cursor profile (this should work just fine)
  3. create a region (can be a point region) and see the crash

Expected behavior no crash when requesting a region spectral profile

Platform info (please complete the following information):