Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

when a histogram window exist, sometimes the imageViewer shows broken image #231

Open
grimmer0125 opened this issue Nov 17, 2017 · 0 comments

Comments

@grimmer0125
Copy link
Contributor

grimmer0125 commented Nov 17, 2017

At least it is reproducable on Mac.

  1. clean cache
  2. make histogram window (either CARTA or new CARTA)
  3. open cube_x1920_z100_1474MB.fits

image

Possible reasons:
When
1. a histogram child process uses some casa api (histogram1.cpp), e.g. ImageInterface.
2. parent CARTA process tries to use ImageInterface and casacore::RO_LatticeIterator to loop some data to make the rendered image. (ImageRenderService.cpp). The result rendered image is broken.

Since this histogram forked child process uses casacore's ImageInterface from its parent process without opening the file again, and if this ImageInterface uses something like, open(2), so the offset of file operation in the file descriptor in ImageInterface will by synchronized in these two process (read, write). So become not process-safe, like thread race condition.

ref:
https://stackoverflow.com/questions/5284062/two-file-descriptors-to-same-file

when you use dup() or dup2() or fork() , the file table is shared by both of the file descriptors. so if you write something from one file descriptor , and again write something through other file descriptor , then it is appended not overwritten.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant