Stack overflow OnAudioFilterReader on Ubuntu 16.04 or 19.04

I’m using U3D 2018.3.10f1 on Ubuntu OS, and the stackoverflow happend when implement OnAudioFilterReader .
Source code :
using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;

public class AudioRenderer : MonoBehaviour
{
private int rateZIME = 0;
private short[ ] buffer = new short[480];
private byte[ ] buffertoZIME = new byte[960];
private int frameLen = 960;

public bool Rendering = false;

void Start()
{
Rendering = true;
}

/// Write a chunk of data to the output stream.
public void Write(float[ ] audioData)
{
for (int i = 0; i < audioData.Length; i++)
{
i++;
if (rateZIME < 480)
{
buffer[rateZIME] = (short)(audioData * (float)Int16.MaxValue);
buffertoZIME[rateZIME * 2 + 1] = (byte)(buffer[rateZIME] >> 8);
buffertoZIME[rateZIME * 2] = (byte)(buffer[rateZIME] & 255);
rateZIME++;
}
else
{
rateZIME = 0;
IntPtr pFrame = Marshal.AllocHGlobal(frameLen);//Error happened
Marshal.Copy(buffertoZIME, 0, pFrame, frameLen);
}
}
}
// write the incoming audio to the output string
void OnAudioFilterRead(float[ ] data, int channels)
{
if (this.Rendering)
{
this.Write(data);
}
}
}
Logs:
Started listening to [0.0.0.0:55448]
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56619
Preloaded ‘ScreenSelector.so’
PlayerConnection already initialized - listening to [0.0.0.0:55448]
Display 0 ‘VBOX monitor’: 1440x792 (primary device).
Logging to /home/jind/.config/unity3d/DefaultCompany/TestUbuntu/Player.log
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c027118
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c025598
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c024df8
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c025598
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c024de8
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c0249e8
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c0249e8
Stack overflow in unmanaged: IP: 0x7f4584f13c67, fault addr: 0x7f457c023fe8
Stack overflow in unmanaged: IP: 0x7f4584f13c67, fault addr: 0x7f457c022b48
Stack overflow in unmanaged: IP: 0x7f4584f13c67, fault addr: 0x7f457c021d88
Stack overflow in unmanaged: IP: 0x7f4584ea222f, fault addr: 0x7f457c024d88
Stack overflow: IP: 0x415804cf, fault addr: (nil)
Stacktrace:
at (wrapper runtime-invoke) .runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) [0x0005d] in :0
<…>
at <0xffffffff>
at UnityEngine.UnhandledExceptionHandler.m__0 (object,System.UnhandledExceptionEventArgs) [0x0000c] in :0
at (wrapper runtime-invoke) .runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) [0x00027] in :0
at <0xffffffff>
at (wrapper managed-to-native) System.Environment.get_Platform () [0x00024] in :0
at System.Environment.get_IsRunningOnWindows () [0x00000] in :0
at System.Runtime.InteropServices.Marshal…cctor () [0x00006] in :0
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) [0x0001f] in :0
at <0xffffffff>
at AudioRenderer.Write (single[ ]) [0x00093] in E:\Unity\Projects\TestUbuntu\Assets\AudioRenderer.cs:38
at AudioRenderer.OnAudioFilterRead (single[ ],int) [0x00013] in E:\Unity\Projects\TestUbuntu\Assets\AudioRenderer.cs:49
at (wrapper runtime-invoke) .runtime_invoke_void__this___object_int (object,intptr,intptr,intptr) [0x00028] in <543a1ee137f5450f8b44180286d5f88e>:0

Hello! Have you tried debugging the script (for example, with VS Debugger) and checking where all the memory is being allocated, and if you run into an infinite loop maybe?