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 10 forks source link

Backend segmentation fault crash when working with high resolution region, cube and image #1383

Open AstroAaron opened 1 week ago

AstroAaron commented 1 week ago

Describe the bug Segmentation fault: /usr/bin/carta: line 20: 223486 Segmentation fault Having loaded in a cube (size \~2.6GB) and another image (mom0 map), and having a region file loaded in with many points (~>300) crashes the backend immediately when moving the region with the cursor. See the number of points of the region in the image below.

To Reproduce Steps to reproduce the behavior:

  1. Load in your cube produced with tclean in fits format.
  2. Append the second image (matched in spatial coordinates)
  3. Import region with high number of points (both pixel and sky coordinates will crash CARTA).
  4. Move the region with the cursor.
  5. See error.

Expected behavior Moving the region should show the stats and spectra for that position.

Screenshots or videos image

Platform info (please complete the following information):

kswang1029 commented 1 week ago

May I have a copy of all your test images/files for debugging purpose?

AstroAaron commented 1 week ago

Since the data is unpublished, I cannot share it here directly. Can you send me an email (it's in my profile)? We can discuss this there.

kswang1029 commented 1 week ago

Thanks. I can reproduce the issue with a different step. The root cause should be this same. We will schedule a fix.

v4.1 macOS election app crash log (dev has the same issue):

Thread 2 Crashed: 0 carta_backend 0x10229fe78 carta::Region::RemoveHorizontalPolygonPoints(casacore::Vector&, casacore::Vector&) + 520 1 carta_backend 0x10229fdd4 carta::Region::RemoveHorizontalPolygonPoints(casacore::Vector&, casacore::Vector&) + 356 2 carta_backend 0x10229e490 carta::Region::GetAppliedPolygonRegion(int, std::1::shared_ptr, casacore::IPosition const&) + 464 3 carta_backend 0x1022a778c carta::Region::GetImageRegion(int, std::1::shared_ptr, casacore::IPosition const&, StokesSource const&, bool) + 1084 4 carta_backend 0x1021150e0 carta::Frame::GetImageRegion(int, std::1::shared_ptr, StokesSource const&, bool) + 168 5 carta_backend 0x1022af4d8 carta::RegionHandler::ApplyRegionToFile(int, int, StokesSource const&, bool) + 596 6 carta_backend 0x1022af91c carta::RegionHandler::ApplyRegionToFile(int, int, AxisRange const&, int, std::1::shared_ptr, carta::StokesRegion&) + 216 7 carta_backend 0x1022b9b88 carta::RegionHandler::GetRegionStatsData(int, int, int, std::1::vector<CARTA::StatsType, std::__1::allocator> const&, CARTA::RegionStatsData&) + 896 8 carta_backend 0x1022c6798 carta::RegionHandler::FillRegionStatsData(std::1::function<void (CARTA::RegionStatsData)>, int, int)::$_22::operator()(int, int, std::1::vector<CARTA::SetStatsRequirements_StatsConfig, std::1::allocator>) const + 580 9 carta_backend 0x1022c627c carta::RegionHandler::FillRegionStatsData(std::1::function<void (CARTA::RegionStatsData)>, int, int) + 356 10 carta_backend 0x1022e10c0 carta::Session::SendRegionStatsData(int, int) + 124 11 carta_backend 0x1022e0c74 carta::Session::OnSetStatsRequirements(CARTA::SetStatsRequirements const&) + 1800 12 carta_backend 0x10230aee4 carta::GeneralMessageTask::execute() + 24 13 carta_backend 0x10233276c 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 14 libsystem_pthread.dylib 0x18b40bfa8 _pthread_start + 148 15 libsystem_pthread.dylib 0x18b406da0 thread_start + 8

@pford do you have time to have a look? If so, let me know and I can share the secret files to you with steps to reproduce the crash.