.Net 9 Preview 6 causes all BASS calls to instantly crash app

Started by pgruebele,

Ian @ un4seen

The issue above only affected the x86_64 build, not the arm64 build, so your crash must be something else. Do you have any information on the crash, eg. a callstack?

BassPassion

Quote from: Ian @ un4seenThe issue above only affected the x86_64 build, not the arm64 build, so your crash must be something else. Do you have any information on the crash, eg. a callstack?

Ah, yes sorry, the crash on ARM64 is happening in bassenc_mp3.dll.

Exception thrown at 0x00007FF8436C57E8 (bassenc_mp3.dll) in myapp.exe: 0xC0000005: Access violation reading location 0x00007FF9436D2124.

>   bassenc_mp3.dll!00007ff8436c57e8()   Unknown
    bassenc_mp3.dll!00007ff8436c6164()   Unknown
    bassenc_mp3.dll!00007ff8436c1bc0()   Unknown
    bassenc_mp3.dll!00007ff8436b5200()   Unknown
    bassenc_mp3.dll!00007ff8436ba6d4()   Unknown
    bassenc_mp3.dll!00007ff8436b13a8()   Unknown
    bassenc.dll!00007ff86085362c()   Unknown
    bass.dll!00007ff83239f43c()   Unknown
    bass.dll!00007ff83239f9a8()   Unknown
    bass.dll!00007ff8323a00d0()   Unknown
    bass.dll!00007ff83239b680()   Unknown
    bass.dll!00007ff83239b8fc()   Unknown
    bass.dll!00007ff83239b9f0()   Unknown
    kernel32.dll!00007ff8b7a58740()   Unknown
    ntdll.dll!00007ff8b9490e54()   Unknown

This is my c# code (using the ManagedBass wrapper https://github.com/ManagedBass/ManagedBass)

_recordingHandle = BassEnc_Mp3.Start(_mixerStream, null, EncodeFlags.ConvertFloatAuto | EncodeFlags.Unicode, filePath);

Which is calling that wrapper:
public static int Start(int Handle, string Options, EncodeFlags Flags, EncodeProcedureEx ProcedureEx, IntPtr User)
{
    return BASS_Encode_MP3_Start(Handle, Options, Flags | EncodeFlags.Unicode, ProcedureEx, User);
}

Which in turn calls this:
[DllImport("bassenc_mp3", CharSet = CharSet.Unicode)]
private static extern int BASS_Encode_MP3_Start(int Handle, string Options, EncodeFlags Flags, EncodeProcedureEx ProcedureEx, IntPtr User);

Ian @ un4seen

OK, I'll email you a debug BASSenc_MP3 version to hopefully get some more info on that.