- Home /
Editor crash "allocation 0x0xc000000000000000 already registered"
I am trying to integrate libfreenect2 and freenect2.net wrapper but I am getting a strange crash that only happens in the Linux editor for my main project. The Windows editor, and Windows and Linux standalone all work fine. I am using editor version 2017.2.0f3. The crash happens almost instantly after I call device = new Device(0);
to initialize the Kinect device. There is an error in the console, then the editor itself closes.
I tried copying just the code that interacts with the Kinect to a new project, and it worked there. How can I find the cause of the crash? Or am I stuck copying pieces one at a time to a new project until it starts crashing?
Relevant bits of scripts:
//KinectManager2.cs
void Start () {
depthSources = GetComponents<DepthSourceBase>();
Array.Sort(depthSources, delegate (DepthSourceBase a, DepthSourceBase b) { return a.Priority.CompareTo(b.Priority); });
foreach (DepthSourceBase source in depthSources)
{
if (source.enabled && source.InitDepthSource())
{
activeDepthSource = source;
break;
}
}
}
//KinectTwoDepthSource.cs
public override bool InitDepthSource()
{
try
{
if (Device.Count > 0)
{
device = new Device(0);
foundKinect = true;
Width = device.DepthFrameSize.Width;
Height = device.DepthFrameSize.Height;
raw = new float[Width * Height];
averageDepth = new float[Width * Height];
averageDepthCount = new int[Width * Height];
for (int i = 0; i < depthBuffer.Length; i++)
{
depthBuffer[i] = new float[Width * Height];
for (int j = 0; j < depthBuffer[i].Length; j++)
{
depthBuffer[i][j] = float.NaN;
}
}
device.FrameReceived += Handle_KinectTwo_DataReceived;
return true;
}
}
catch (DllNotFoundException) { }
return false;
}
Here is the Editor.log from right before initializing the device. I'm not sure why it is complaining about the .so files, since they are all in Assets/Plugins/Libfreenect2/Linux
and it must find them if it gets past if (Device.Count > 0)
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
/home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 14 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:13 with serial 006147365347
[Info] [Freenect2Impl] found 1 devices
Found device
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
KinectTwoDepthSource:InitDepthSource() (at Assets/Script/Kinect/KinectTwoDepthSource.cs:85)
KinectManager2:Start() (at Assets/Script/Kinect/KinectManager2.cs:30)
(Filename: Assets/Script/Kinect/KinectTwoDepthSource.cs Line: 85)
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/Libfreenect2/Linux/libfreenect2c.so
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20*16384 ir: 60*8*33792
[Info] [Freenect2DeviceImpl] opened
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
Fallback handler could not load library /home/adminz/Downloads/unity-editor-2017.2.0f3/Editor/Data/Mono/lib/libAssets/Plugins/x86_64/libfreenect.so
The specified identifier (BoxDimensions) does not exists. please use Exists () to check for existent before calling Load.
returning the default(T) instance.
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogWarningFormat(String, Object[])
BayatGames.SaveGameFree.SaveGame:Load(String, String, Boolean, String, ISaveGameSerializer, ISaveGameEncoder, Encoding, SaveGamePath) (at Assets/BayatGames/SaveGameFree/Scripts/SaveGame.cs:624)
BayatGames.SaveGameFree.SaveGame:Load(String, String) (at Assets/BayatGames/SaveGameFree/Scripts/SaveGame.cs:439)
CalibrationManager:Start() (at Assets/Script/Calibration/CalibrationManager.cs:146)
(Filename: Assets/BayatGames/SaveGameFree/Scripts/SaveGame.cs Line: 624)
InvalidCastException: Specified cast is not valid.
at CalibrationManager.InitTextureDisplay () [0x000d6] in /home/adminz/AR-Sandbox-master/Assets/Script/Calibration/CalibrationManager.cs:256
at CalibrationManager.Start () [0x00653] in /home/adminz/AR-Sandbox-master/Assets/Script/Calibration/CalibrationManager.cs:233
(Filename: Assets/Script/Calibration/CalibrationManager.cs Line: 256)
allocation 0x0xc000000000000000 already registered @ /home/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l234 size 24000; now calling from /home/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l234 size 3000?
(Filename: /home/builduser/buildslave/unity/build/Runtime/Allocator/MemoryManager.cpp Line: 1464)
Receiving unhandled NULL exception
#0 0x007fb6d22aeac0 in funlockfile
#1 0x007ffeb1f58920 in _nv042glcore
#2 0x007ffeb1f58960 in _nv042glcore
#3 0x007ffeb1f58a70 in _nv023glcore
#4 0x007ffeb1f58ab0 in GfxDeviceGLES::DrawBufferRanges(GfxBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ShaderChannelMask, unsigned long, bool)
#5 0x007ffeb1f58b80 in GfxDeviceGLES::DrawBuffers(GfxBuffer*, VertexStreamSource const*, int, DrawBuffersRange const*, int, VertexDeclaration*, ShaderChannelMask)
#6 0x007ffeb1f58c00 in UI::Canvas::DrawRawMesh(UI::Batch&, GfxBuffer*, GfxBuffer*)
#7 0x007ffeb1f58c90 in UI::Canvas::RenderOverlays()
#8 0x007ffeb1f58ce0 in UI::CanvasManager::RenderOverlays(int)
#9 0x007ffeb1f58d30 in RepaintController::RenderGameViewCameras(RenderTexture*, int, RectT<float> const&, Vector2f const&, bool)
#10 0x007ffeb1f58e30 in EditorGUIUtility_CUSTOM_INTERNAL_CALL_RenderGameViewCamerasInternal(MonoObject*, int, RectT<float> const&, Vector2fIcall const&, unsigned char)
#11 0x007ffeb1f58e90 in (Unknown)
#12 0x007ffeb1f58ea0 in (Unknown)
#13 0x007ffeb1f58eb0 in mono_get_jit_info_from_method
#14 0x007ffeb1f597c0 in mono_g_hash_table_print_stats
#15 0x007ffeb1f597f0 in mono_runtime_run_main
#16 0x007ffeb1f598a0 in mono_unity_register_path_remapper
#17 0x007ffeb1f59970 in (Unknown)
#18 0x007ffeb1f59980 in (Unknown)
#19 0x007ffeb1f59990 in (Unknown)
Launching bug reporter
[Unity Package Manager (Upm)] - Application terminated due to HTTP connection being closed on the other end.
Your answer
Follow this Question
Related Questions
Game Always Crashes On Some Android Devices 0 Answers
Unity 2019.3.5f1 Android Build (IL2CPP) crash Log 0 Answers
functional multithreaded c++ code crashes if executed in Unity as native plugin 1 Answer
Andriod native plugin: AndroidAdMob.Client.CreateAdBanner not working 0 Answers
Native plugin device not created with D3D11_CREATE_DEVICE_BGRA_SUPPORT on deploy only 0 Answers