Author Topic: MidiFilterProc throws an AccessViolationException in BASSMIDI x86 (BASS.NET 2.4)  (Read 284 times)

KaleidonKep99

  • Posts: 162
Hello.
I recently stumbled upon a weird issue.

I use BASS_MIDI_StreamSetFilter to ignore specific tracks and events that the user doesn't want to play, and to send events to a VST instrument.
The 64-bit release of my converter, which makes use of this function, does work fine, but the 32-bit one throws an AccessViolationError inside MidiFilterProc, no matter what I do.

I'm pretty sure the 32-bit version of BASSMIDI is to blame, since everything works fine with the 64-bit library.
Even weirder is how passing an empty MidiFilterProc function still triggers the error.

Here's KMC x64 playing a MIDI with MidiFilterProc, which is used by my app to send events to the VST instrument:


And here's KMC x86, crashing as soon as BASS_ChannelGetData is called:

(Ignore BASS_ERROR_ILLPARAM, it's related to BASS_VST_ProcessEvent not recognizing the event.)

Ian @ un4seen

  • Administrator
  • Posts: 20903
Please upload a dump file for the crash. You can generate a dump file using the ProcDump tool. For example, run "procdump -e -ma -x . your.exe". Then ZIP and upload the generated dump file to have a look at here:

   ftp.un4seen.com/incoming/

KaleidonKep99

  • Posts: 162
I sent the dump. Its name is KeppyMIDIConverter.exe_180618_163556.dmp.

Ian @ un4seen

  • Administrator
  • Posts: 20903
For some reason I can't see the call stack in the dump file's exception record, but it looks like the crash may have happened when BASSMIDI called your MIDIFILTERPROC callback function. I'll send you a debug version to confirm that. I believe callback issues in .Net are usually the result of a delegate being garbarge collected, so you also could check that.

KaleidonKep99

  • Posts: 162
Here's the log, in case you didn't see the e-mail.

[attachment deleted by admin]

Ian @ un4seen

  • Administrator
  • Posts: 20903
I didn't receive your email for some reason, so just as well you posted the log here :)

The log doesn't show any problems with the MIDIFILTERPROC callback; it was called twice, and returned twice. The log doesn't reveal any other problems either. Did the AccessViolationError (described in the 1st post) happen when the log was generated?

KaleidonKep99

  • Posts: 162
I didn't receive your email for some reason, so just as well you posted the log here :)

The log doesn't show any problems with the MIDIFILTERPROC callback; it was called twice, and returned twice. The log doesn't reveal any other problems either. Did the AccessViolationError (described in the 1st post) happen when the log was generated?
It happened when the log was already generated, yes.

The weird thing is, it happens when there's nothing inside the MidiFilterProc function too. I don't know what's going on...

Chris

  • Posts: 1846
Hi, is in the MidiFilterProc any Guistuff? eg Access to a Component on your Form/MainThread?
If yes remove it and change it to Postmessage .....

KaleidonKep99

  • Posts: 162
Hi, is in the MidiFilterProc any Guistuff? eg Access to a Component on your Form/MainThread?
If yes remove it and change it to Postmessage .....
I already said that this happens when the MidiFilterProc function is empty too, so it must be something wrong with BASSMIDI.

Ian @ un4seen

  • Administrator
  • Posts: 20903
I tried adding a MIDIFILTERPROC callback to the MIDITEST example and there was no problem with it. Your log didn't show any problem with the MIDIFILTERPROC calls either. So I'm not sure what's going wrong there. To perhaps get a more useful dump file, please try generating a new dump file with the "-g" option added to the ProcDump command-line.

KaleidonKep99

  • Posts: 162
I tried adding a MIDIFILTERPROC callback to the MIDITEST example and there was no problem with it. Your log didn't show any problem with the MIDIFILTERPROC calls either. So I'm not sure what's going wrong there. To perhaps get a more useful dump file, please try generating a new dump file with the "-g" option added to the ProcDump command-line.
Done, I uploaded it to the FTP server, its name is "KeppyMIDIConverter.exe_180629_234316.dmp.7z".

Ian @ un4seen

  • Administrator
  • Posts: 20903
Unfortunately, the upload seems to be corrupt/incomplete. Can you try again? I forgot to ask you to include the BASSMIDI.LOG file from the same run as the dump file was generated, so please do that too (if you didn't already).

KaleidonKep99

  • Posts: 162
Sorry for the late response, I was doing my final exams! I just graduated. ;D ;D
I'll try getting the dump again asap.