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

CARTA crashes when using beam tables with 64-bit floats #1166

Closed
Jordatious opened this issue Aug 1, 2022 · 10 comments · Fixed by #1273
Closed

CARTA crashes when using beam tables with 64-bit floats #1166

Jordatious opened this issue Aug 1, 2022 · 10 comments · Fixed by #1273
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Jordatious
Copy link

Jordatious commented Aug 1, 2022

An issue was discovered by @amirkazemim where certain FITS cubes he was producing with a custom script would not open on the IDIA CARTA server. CARTA would crash trying to read the FITS file in file browser, after which it would display a "Connection lost" error. Amir reduced the issue to the beam table being written as 64-bit floats (the astropy default), whereas when 32-bit beam tables were used, they opened just fine in CARTA. The cubes which have beam tables as 64-bit floats open fine in ds9, and were converted fine to IDIA's HDF5 schema. Therefore it seems like this might be a CARTA bug.

I was hoping one of the CARTA developers could reproduce the issue, but if not, please let us know and we can produce a cube.

@Jordatious Jordatious added the bug Something isn't working label Aug 1, 2022
@kswang1029 kswang1029 transferred this issue from CARTAvis/carta Aug 1, 2022
@kswang1029 kswang1029 added this to the v4.0-stable milestone May 11, 2023
@kswang1029
Copy link
Contributor

@Jordatious would you be able to provide a test cube for investigation please?

@Jordatious
Copy link
Author

Perhaps @amirkazemim can (privately, assuming it's proprietary data)?

@kswang1029
Copy link
Contributor

Perhaps @amirkazemim can (privately, assuming it's proprietary data)?

a cutout (noisy sky) would be just useful if it is proprietary

@amirkazemim
Copy link

amirkazemim commented May 23, 2023

I created a random noise array, saved it once with a 32-bit beam table and another time with the astropy-default (I think 64-bit) beam table.

There are two fits files in the zipped attachment, noise_cube_32.fits can be opened with CARTA. However, CARTA v3.0.1 stalls on noise_cube_64.fits because of its beam table. Hope this helps.

noise_cubes.zip

@kswang1029
Copy link
Contributor

I created a random noise array, saved it once with a 32-bit beam table and another time with the astropy-default (I think 64-bit) beam table.

There are two fits files in the zipped attachment, noise_cube_32.fits can be opened with CARTA. However, CARTA stalls on noise_cube_64.fits because of its beam table. Hope this helps.

noise_cubes.zip

Thank you for supplying the test images.

@kswang1029
Copy link
Contributor

@amirkazemim @Jordatious could you try the v4-beta release to see if the issue persists? I tried but both test images can be loaded just fine.

@Jordatious
Copy link
Author

Are you able to check v4-beta @amirkazemim?

@amirkazemim
Copy link

Unfortunately, I am not able to check with v4-beta, @Jordatious.

@Jordatious
Copy link
Author

I'm unable to load the 64-bit image provided above in either v3.0.1 or v4.0-beta.1 using the IDIA controller / server version. Whenever I try to open it, or click on it within the file browser, the backend disconnects.

@kswang1029
Copy link
Contributor

ok. with macOS Apple silicon chip, it works with v4-beta. However, with macOS intel chip, it crashes.

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000d00000000
Exception Codes: 0x0000000000000001, 0x0000000d00000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [76499]

VM Region Info: 0xd00000000 is not in any region. Bytes after previous region: 51227545601 Bytes before following region: 123089651085312
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE (reserved) 112998000-11299b000 [ 12K] r--/r-- SM=NUL ...(unallocated)
---> GAP OF 0x6ffef8540000 BYTES
Stack Guard 70000aedb000-70000aedc000 [ 4K] ---/rwx SM=NUL

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libcasa_fits.6.dylib 0x10befd289 casacore::BinaryTableExtension::~BinaryTableExtension() + 313
1 libcasa_fits.6.dylib 0x10bf42809 casacore::BinaryTable::BinaryTable(casacore::FitsInput&, void ()(char const, casacore::FITSError::ErrorLevel), bool, bool) + 19465
2 libcasa_images.6.dylib 0x10c5fe509 casacore::ImageFITSConverter::readBeamsTable(casacore::ImageInfo&, casacore::String const&, casacore::DataType) + 2729
3 libcasa_images.6.dylib 0x10c5436aa casacore::FITSImage::setup() + 954
4 libcasa_images.6.dylib 0x10c543225 casacore::FITSImage::FITSImage(casacore::String const&, unsigned int, unsigned int) + 245
5 carta_backend 0x10a41ae81 carta::FitsLoader::OpenFile(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 961
6 carta_backend 0x10a380761 carta::FileExtInfoLoader::FillFileInfoFromImage(CARTA::FileInfoExtended&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) + 49
7 carta_backend 0x10a3805ed carta::FileExtInfoLoader::FillFileExtInfo(CARTA::FileInfoExtended&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) + 477
8 carta_backend 0x10a378b72 carta::FileExtInfoLoader::FillFitsFileInfoMap(std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, CARTA::FileInfoExtended, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, CARTA::FileInfoExtended> > >&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) + 594
9 carta_backend 0x10a5a0fda carta::Session::FillExtendedFileInfo(std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, CARTA::FileInfoExtended, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, CARTA::FileInfoExtended> > >&, CARTA::FileInfo&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) + 362
10 carta_backend 0x10a5a2a02 carta::Session::OnFileInfoRequest(CARTA::FileInfoRequest const&, unsigned int) + 194
11 carta_backend 0x10a5c50c2 carta::SessionManager::OnMessage(uWS::WebSocket<false, true, carta::PerSocketData>, std::__1::basic_string_view<char, std::__1::char_traits >, uWS::OpCode) + 4386
12 carta_backend 0x10a5d3374 uWS::WebSocketContext<false, true, carta::PerSocketData>::handleFragment(char
, unsigned long, unsigned int, int, bool, uWS::WebSocketState, void) + 1300
13 carta_backend 0x10a5d2607 bool uWS::WebSocketProtocol<true, uWS::WebSocketContext<false, true, carta::PerSocketData> >::consumeMessage<6u, unsigned char>(unsigned char, char*&, unsigned int&, uWS::WebSocketState, void) + 711
14 carta_backend 0x10a5d2290 uWS::WebSocketProtocol<true, uWS::WebSocketContext<false, true, carta::PerSocketData> >::consume(char*, unsigned int, uWS::WebSocketState, void) + 272
15 carta_backend 0x10a5d212e auto uWS::WebSocketContext<false, true, carta::PerSocketData>::init()::'lambda'(auto*, char*, int)::operator()<us_socket_t>(auto*, char*, int) const + 142
16 carta_backend 0x10a6900a5 us_loop_run + 133
17 carta_backend 0x10a5c6d57 carta::SessionManager::RunApp() + 343
18 carta_backend 0x10a507a41 main + 3809
19 dyld 0x1128e852e start + 462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants