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

Fix temporary file name collisions in hictk convert *cool -> hic #274

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

robomics
Copy link
Contributor

@robomics robomics commented Oct 2, 2024

This PR fixes the bug reported in #271.

This bug is a regression introduced by #210.

In brief, when performing *cool -> hic conversion, a randomly-named, self-deleting temporary directory was created under the default temporary directory (e.g. /tmp) or a user provided temporary folder.
However, due to a silly mistake, the parent of this folder was passed to one of the functions creating temporary files. When converting multiple files sharing one or more resolution in parallel using the default temporary folder, this results in unintended file truncation (which could lead to all kinds of errors).

Other commands creating .hic files (e.g. hictk load and hictk zoomify) are not affected.

@robomics robomics added the bug Something isn't working label Oct 2, 2024
@robomics robomics linked an issue Oct 2, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.01%. Comparing base (0dafc0d) to head (a59f894).
Report is 102 commits behind head on main.

Files with missing lines Patch % Lines
src/hictk/convert/cool_to_hic.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #274      +/-   ##
==========================================
- Coverage   79.02%   79.01%   -0.02%     
==========================================
  Files         171      171              
  Lines       16324    16327       +3     
  Branches     2250     2250              
==========================================
  Hits        12900    12900              
- Misses       2455     2457       +2     
- Partials      969      970       +1     
Flag Coverage Δ
[tests integration](https://app.codecov.io/gh/paulsengroup/hictk/pull/274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 69.38% <80.00%> (-0.04%)
[tests unittests](https://app.codecov.io/gh/paulsengroup/hictk/pull/274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=paulsengroup) 76.43% <100.00%> (-0.01%)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robomics robomics merged commit 9fd7986 into main Oct 8, 2024
122 of 123 checks passed
@robomics robomics deleted the fix/convert-tmpdir branch October 8, 2024 06:31
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 this pull request may close these issues.

"attempt of out-of-bound read" when using -t option
1 participant