Skip to content

SIGSEGV / SIGILL fix #11

Description

@AJ92

in PiperLib.cs:

            public struct OptionalLong
            {
                [MarshalAs(UnmanagedType.I1)]  // ensures 1-byte boolean
                public bool hasValue;
                public long value;
            }

            [StructLayout(LayoutKind.Sequential)]
            public struct OptionalPhonemeSilenceSecondsMap
            {
                [MarshalAs(UnmanagedType.I1)]  // ensures 1-byte boolean
                public bool hasValue;
                public PhonemeSilenceSecondsMap* value;
            }

Note the extra [MarshalAs(UnmanagedType.I1)] ! without them this produces random crashes (segmentation fault or illegal instructions)

bools in C are 1 byte, but in C# they are 4 bytes !!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions