Menu

#289 Fix for segfault on macOS Ventura

None
closed-fixed
None
5
2023-12-11
2023-12-07
iMichka
No

Hello

We found a segfault when running gspim on macOS Ventura. There might be an issue with undefined behavior, relating to static class member s_ProgramFileTypeList initialization order.
Here is a patch that fixes it:

_END__
--- gpsim-0.32.1-old/src/program_files.cc 2023-12-05 23:22:02
+++ gpsim-0.32.1/src/program_files.cc 2023-12-05 23:22:10
@@ -97,6 +97,7 @@

ProgramFileTypeList &ProgramFileTypeList::GetList()
{
+ static ProgramFileTypeList s_ProgramFileTypeList = new ProgramFileTypeList();
return
s_ProgramFileTypeList;
}

See https://github.com/Homebrew/homebrew-core/pull/155899

1 Attachments

Discussion

  • Roy Rankin

    Roy Rankin - 2023-12-07
    • assigned_to: Roy Rankin
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +bug289.patch (870 Bytes; text/x-patch)
    
    • Group: -->
     
  • Roy Rankin

    Roy Rankin - 2023-12-07

    I have attached my fix to the issue. Can you try it and see that it fixes the issue.

    Roy

     
  • iMichka

    iMichka - 2023-12-09

    I confirm that your patch fixes it too.

     
  • Roy Rankin

    Roy Rankin - 2023-12-11
    • status: open --> closed-fixed
     
  • Roy Rankin

    Roy Rankin - 2023-12-11

    Alternative fix made.

     

Anonymous
Anonymous

Add attachments
Cancel