Skip to content

Error-Out Behavior #2

@MetzgerSK

Description

@MetzgerSK

Win10, Stata 17.0 MP6, survsim 4.0.9

Problem
If survsim throws an unexpected error and exits out, it doesn't tidy up Mata memory. If you try to rerun the command after an unexpected exit, you get:

. hf1() already exists
(4 lines skipped)
r(3000);

Checking Mata memory confirms the issue:

. mata mata desc

      # bytes   type                        name and extent
-------------------------------------------------------------------------------
          240   transmorphic matrix         hf1()
          256   transmorphic matrix         hf2()
          400   transmorphic matrix         totalhf1()
          408   transmorphic matrix         totalhf3()
           16   pointer colvector           Phfs[2]
           32   pointer colvector           Ptotalhfs[4]
-------------------------------------------------------------------------------

MWE
Run the MWE from #1, then without clearing session memory: keep grp, then recode grp (.=2), then try rerunning #1's survsim call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions