Skip to content

Windows: Data segment for GC not initialized when using shared MSVCRT #1908

@skl131313

Description

@skl131313

Well I have an associative array that holds an array of integers, int[][int] basically. For one frame that is run the contents are valid and the code functions normally. The second time around, most of the contents of the array are empty only one valid entry. Then after a few seconds the program fails trying to access an invalid pointer, for the associative array. It was a global variable using __gshared, when I removed that and used thread local storage, it functioned correctly. The code that's affected is in a DLL file (on windows) that is loaded at runtime using Runtime.loadLibrary. I'm also using the SimpleDllMain mixin from core.sys.windows.dll. So it seems that it is being garbage collected for some reason, even though it still exists and is valid. I'm using LDC 1.1.0-beta5.

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