Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend crash when saving a pv image generated from a FITS cube #1009

Closed
kswang1029 opened this issue Jan 25, 2022 · 2 comments · Fixed by #1044
Closed

backend crash when saving a pv image generated from a FITS cube #1009

kswang1029 opened this issue Jan 25, 2022 · 2 comments · Fixed by #1044
Assignees
Labels
critical bug critical bug which is a showstopper for release
Milestone

Comments

@kswang1029
Copy link
Contributor

Describe the bug
The backend crashes when saving a PV image generated from a FITS cube with a specific set of headers. This is reported by a user with v3b2 using the centos8 AppImage. The same issue can be reproduced with macOS too.

To Reproduce
Steps to reproduce the behavior:

  1. load the attached test FITS cube
  2. generate a PV image
  3. save the PV image as FITS
  4. backend should crash

Expected behavior
Backend should not crash and saving PV should be successful.

Screenshots or videos
N/A

Platform info (please complete the following information):

  • OS: macOS Monterey
  • Browser: only tried Chrome
  • Version: 97.0.4692.71

Additional context
backend crash report from macOS

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libc++.1.dylib 0x7ff81625743d std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::operator=(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 9
1 libcasa_coordinates.5.dylib 0x10a397576 casacore::ObsInfo::copy_other(casacore::ObsInfo const&) + 38
2 libcasa_coordinates.5.dylib 0x10a39772e casacore::ObsInfo::operator=(casacore::ObsInfo const&) + 14
3 libcasa_coordinates.5.dylib 0x10a335450 casacore::CoordinateSystem::copy(casacore::CoordinateSystem const&) + 144
4 libcasa_coordinates.5.dylib 0x10a336304 casacore::CoordinateSystem::CoordinateSystem(casacore::CoordinateSystem const&) + 756
5 carta_backend 0x10765a9a4 GetSpectralCoordPreferences(casacore::ImageInterface, bool&, bool&, bool&, bool&) + 68 (Casacore.cc:121)
6 carta_backend 0x10743e471 carta::Frame::ExportFITSImage(casacore::ImageInterface&, std::__1::__fs::filesystem::path, casacore::String&) + 49 (Frame.cc:1928)
7 carta_backend 0x10744b9b5 carta::Frame::SaveFile(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, CARTA::SaveFile const&, CARTA::SaveFileAck&, std::__1::shared_ptrcarta::Region) + 1829 (Frame.cc:1840)
8 carta_backend 0x1075f9f58 carta::Session::OnSaveFile(CARTA::SaveFile const&, unsigned int) + 1880 (Session.cc:1294)
9 carta_backend 0x107604ad3 carta::SessionManager::OnMessage(uWS::WebSocket<false, true, carta::PerSocketData>
, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode) + 2547 (SessionManager.cc:372)
10 carta_backend 0x10760e9e4 ofats::any_detail::any_invocable_impl<void, false, uWS::WebSocket<false, true, carta::PerSocketData>, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode>::call(uWS::WebSocket<false, true, carta::PerSocketData>, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode) + 17 (MoveOnlyFunction.h:247) [inlined]
11 carta_backend 0x10760e9e4 ofats::any_invocable<void (uWS::WebSocket<false, true, carta::PerSocketData>, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode)>::operator()(uWS::WebSocket<false, true, carta::PerSocketData>, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode) + 17 (MoveOnlyFunction.h:354) [inlined]
12 carta_backend 0x10760e9e4 uWS::WebSocketContext<false, true, carta::PerSocketData>::handleFragment(char*, unsigned long, unsigned int, int, bool, uWS::WebSocketState, void) + 1300 (WebSocketContext.h:93)
13 carta_backend 0x10760dc56 bool uWS::WebSocketProtocol<true, uWS::WebSocketContext<false, true, carta::PerSocketData> >::consumeMessage<6u, unsigned char>(unsigned char, char*&, unsigned int&, uWS::WebSocketState, void) + 726 (WebSocketProtocol.h:328)
14 carta_backend 0x10760d8d0 uWS::WebSocketProtocol<true, uWS::WebSocketContext<false, true, carta::PerSocketData> >::consume(char*, unsigned int, uWS::WebSocketState, void) + 272 (WebSocketProtocol.h:424)
15 carta_backend 0x10760d76a auto uWS::WebSocketContext<false, true, carta::PerSocketData>::init()::'lambda'(auto*, char*, int)::operator()<us_socket_t>(auto*, char*, int) const + 138 (WebSocketContext.h:286)
16 carta_backend 0x10776aca5 us_loop_run + 133 (epoll_kqueue.c:147)
17 carta_backend 0x107609d67 uWS::Loop::run() + 8 (Loop.h:159) [inlined]
18 carta_backend 0x107609d67 uWS::run() + 15 (Loop.h:176) [inlined]
19 carta_backend 0x107609d67 uWS::TemplatedApp::run() + 15 (App.h:393) [inlined]
20 carta_backend 0x107609d67 carta::SessionManager::RunApp() + 343 (SessionManager.cc:555)
21 carta_backend 0x107552ed3 main + 4931 (Main.cc:208)
22 dyld 0x1162674fe start + 462

test.fits.zip

@kswang1029 kswang1029 added the critical bug critical bug which is a showstopper for release label Jan 25, 2022
@kswang1029
Copy link
Contributor Author

@pford would you be able to investigate this for the v3-beta3 release?

@kswang1029
Copy link
Contributor Author

After some more tests with a mockup cube, the root cause is identified.

  • if the input FITS cube is 4D as ra-dec-channel-stokes, then the generated PV image can be saved without problems
  • if the input FITS cube is 3D as ra-dec-channel, then the generated PV image cannot be saved resulting a backend crash.

So I guess this is something to do with the Stokes axis. Does the backend always assume there is a Stokes axis in the saved PV image?

@kswang1029 kswang1029 added this to the v3.0b-3 milestone Jan 25, 2022
@pford pford self-assigned this Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical bug critical bug which is a showstopper for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants