Skip to content

Conversation

TiborGY
Copy link
Contributor

@TiborGY TiborGY commented Nov 11, 2022

Description

While testing PR #2756, I have discovered a regression introduced by an earlier PR (#2700) of mine.
Before throwing, psio_error() tries to write some data to the scratch files. But if psio_error() is called due to a write error, and the scratch disk is completely full, then this write will also fail, leading to psio_error() getting called again, and an infinite recursion ensues. The source of the regression is that psio_tocwrite() ends up calling wt_toclen(), which has been enhanced in #2700 to use psio_error() if it fails.
This PR resolves the issue by not trying to write anything to scratch if psio_error() is called due to a write failure.

User API & Changelog headlines

  • None? This regression was new enough that no release suffered from it.

Dev notes & details

  • Do not call psio_tocwrite() in psio_error() if errval == PSIO_ERROR_WRITE

Status

  • Ready for review
  • Ready for merge

@TiborGY TiborGY changed the title Fix possible infinite recursion in psio_error when the scatch disk is completely full Fix possible infinite recursion in psio_error when the scratch disk is completely full Nov 11, 2022
@TiborGY TiborGY marked this pull request as ready for review November 12, 2022 15:06
@loriab loriab added this to the Psi4 1.7 milestone Nov 14, 2022
@loriab loriab added the libpsio For all issue involving LIBPSIO, I/O library. label Nov 14, 2022
@loriab loriab merged commit 3041e4d into psi4:master Nov 14, 2022
@TiborGY TiborGY deleted the psio_write_error branch November 16, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libpsio For all issue involving LIBPSIO, I/O library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants