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 caminfo uselabel SegFault #4402

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Conversation

tgiroux
Copy link
Contributor

@tgiroux tgiroux commented Apr 15, 2021

Description

In caminfo there is a call to BandGeometry::collect that closes the input cube object if uselabel=yes. The cube needs to remain open for a few other tasks, so this was causing a segmentation fault. To fix this, I added a few lines after the BandGeometry::collect call that open the cube back up if uselabel=yes.

Related Issue

#4401

Motivation and Context

This bug was found in the release candidate due at end of month.

How Has This Been Tested?

All caminfo gtests are passing. Both sample caminfo calls given in #4401 run correctly.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have added myself to the .zenodo.json document.
  • I have added any user impacting changes to the CHANGELOG.md document.

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

Copy link
Collaborator

@acpaquette acpaquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to remove the cube.close() from the CamTools BandGeometry::collect function. This was something that was incorrectly added when Blob reading was updated.

isis/src/base/apps/caminfo/caminfo.cpp Outdated Show resolved Hide resolved
@tgiroux tgiroux requested a review from acpaquette April 22, 2021 15:37
@jessemapel jessemapel dismissed scsides’s stale review April 22, 2021 16:32

Review is being taken over by @jessemapel

@acpaquette acpaquette merged commit 6c5176f into DOI-USGS:dev Apr 22, 2021
Kelvinrr pushed a commit to Kelvinrr/ISIS3 that referenced this pull request Jun 10, 2021
* conditionally reopen cube to prevent segfault

* relocate cube close
Kelvinrr pushed a commit that referenced this pull request Jun 11, 2021
* Change measure log name to be case-insensitive (#4441)

* Lrowac2pds App and Test Conversion (#4429)

* lrowac2pds app conversion

* Lrowac2pds App and Test Conversion

* Set global variables to static to prevent test failures

* Gui Parameters now right aligned (#4507)

* Findgaps gtests (#4422)

* first few test cases, needs work

* two working tests

* add test for correlation tolerance

* improve test data creation code

* updated mapcam makefile (#4498)

* merge conflict with 561e21e in changelog

* improve grid extend test case (#4506)

* fix sample_bits pvl output (#4500)

* map2map conversion (#4435)

* added code for two tests

* test modifications

* changed crop input and ouput function

* fixed last two tests

* added more tests

* converted map2map

* added conversion code for map2map

* bring crop tests up to date with dev

* added modifications to map2map and tests

* final changes for map2map tests

* Converted app and default test

* Converted tests

* Added histograms to tests.

* Rename FunctionalTestsMap2Map.cpp to FunctionalTestsMap2map.cpp

Co-authored-by: Amy Stamile <astamile@contractor.usgs.gov>
Co-authored-by: Amy Stamile <74275278+amystamile-usgs@users.noreply.github.com>

* thm2isis now uses out attrs and converted to func (#4504)

* thm2isis now uses out attrs and converted to func

* removed commented code that manually set pixel type

* added gtests

* better params

* IR test added

* reordered things

* cropped images

* cropped image for outattr tests too

* added missing changelog lines

* Fix caminfo uselabel SegFault (#4402)

* conditionally reopen cube to prevent segfault

* relocate cube close

* version ticks

* change log merge conflict

* added 5.0.1 bugfixes under a 5.0.1 header in CHANGELOG

* removed unreleased portion of the changelog

Co-authored-by: Jesse Mapel <jmapel@usgs.gov>
Co-authored-by: Amy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Co-authored-by: Tim Giroux <62255438+tgiroux@users.noreply.github.com>
Co-authored-by: robotprogrammer22 <46390033+robotprogrammer22@users.noreply.github.com>
Co-authored-by: Amy Stamile <astamile@contractor.usgs.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants