Skip to content

Unity 6 Editor crash on play in Linux #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alansley opened this issue May 5, 2025 · 5 comments
Open

Unity 6 Editor crash on play in Linux #68

alansley opened this issue May 5, 2025 · 5 comments
Labels
bug Something isn't working linux Issue occurs on Linux platform

Comments

@alansley
Copy link

alansley commented May 5, 2025

Hi there!

When using your unity-sqlite-net library in Linux I'm seeing it crash the Unity editor on play (v6000.1.1f1). I've tried the exact same simple code in Windows and it doesn't crash the editor, and I've found the creating a standalone build of the Linux test project also doesn't cause any crashes - it can query a simple DB and print a record just fine.

I tried rebuilding libgilzoide-sqlite-net.so locally via the makefile and still got the crash, then I tried creating a debug version to see if I could get gdb or valgrind to give me any useful info (there's nothing that seems to stand out in Editor.log) but I couldn't get it to give me anything useful - which might be a skill issue on my side, unfortunately. As the standalone version works fine Player.log has nothing of interest to report.

Any thoughts you might have to help resolve this would be greatly appreciated! Thanks!

@gilzoide
Copy link
Owner

gilzoide commented May 5, 2025

Hey @alansley, thanks for the report.
Can you post the crash stack trace, at least the part where SQLite code is involved (preferably using your debug version)?

@gilzoide gilzoide added bug Something isn't working linux Issue occurs on Linux platform labels May 5, 2025
@alansley
Copy link
Author

alansley commented May 5, 2025

Hi! I replaced the libgilzoide-sqlite-net.so from your package with the one I built from the makefile with debug symbols - but it hasn't been a great deal of help, I'm afraid.

The call to:
var db = new SQLiteConnection(dictionaryDatabaseFilename);

Results in:

DB is located at: /home/r3dux/.config/unity3d/DefaultCompany/SQLite-Net-Test/dictionary_en.db
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
SQLiteDatabaseCreator:CreateTestDB () (at Assets/Scripts/Database/SQLiteDatabaseCreator.cs:53)
SQLiteDatabaseCreator:Start () (at Assets/Scripts/Database/SQLiteDatabaseCreator.cs:40)

(Filename: Assets/Scripts/Database/SQLiteDatabaseCreator.cs Line: 53)

Caught fatal signal - signo:11 code:1 errno:0 addr:(nil)
Obtained 7 stack frames.
#0  0x0057ccbf67b61c in burst_signal_handler(int, siginfo_t*, void*)
#1  0x007982ba7b2ef0 in (Unknown)
Launching bug reporter

And that's as much as it seems to know before it falls over and launches the Unity crash reporter. I did delete the Unity project's Library and obj folders in-case it was caching an older version of the lib, but it didn't change the level of debug output.

I then put a breakpoint on the DB connection line and stepped it through into SQLite.cs where it got to line 406 before falling over:
var r = SQLite3.Open (databasePathAsBytes, out handle, (int)connectionString.OpenFlags, connectionString.VfsName);

I then ran it again and tried to step into the SQLite3.Open call - and it crashed again, so it looks like that's about as far as I can go there. What's weird though is that if I build and run it rather than hitting play in the editor then it works without issue & I get console output from Player.log like the following (I'm not concerned about the primary key UNIQUE constraint - it's just trying to put the word "Cat" into a table as a PK when it already exists):

DB is located at: /home/r3dux/.config/unity3d/DefaultCompany/SQLite-Net-Test/dictionary_en.db
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
SQLiteDatabaseCreator:CreateTestDB () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:54)
SQLiteDatabaseCreator:Start () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:42)

(Filename: /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs Line: 54)

Error inserting word: UNIQUE constraint failed: WordRecord.Word
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
SQLiteDatabaseCreator:CreateTestDB () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:75)
SQLiteDatabaseCreator:Start () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:42)

(Filename: /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs Line: 75)

Found word: Cat which means: A feline.
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
SQLiteDatabaseCreator:CreateTestDB () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:89)
SQLiteDatabaseCreator:Start () (at /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs:42)

(Filename: /home/r3dux/UnityProjects/SQLite-Net-Test/Assets/Scripts/Database/SQLiteDatabaseCreator.cs Line: 89)

I've attached the full Editor.log in case it's of any use. Should there be any other files that might help track things down then if you let me know I'll do my best to provide. Thank you!

Editor.log

@alansley
Copy link
Author

alansley commented May 5, 2025

Oh, and I also gave the project a go in Unity 2022.3.55f1 just in case it was a Unity 6 thing, but same issue unfortunately.

@Spamming-Spammer
Copy link

Hey, I've run in to the same issue today myself using Arch Linux on Unity 6.

All test done using IL2CPP not Mono.

Tried unity-sqlite-net version 1.0.0, 1.2.0 and 1.2.3 all same issue

Tried switching between .Net Standard 2.1 and .Net Framework same issue

@gilzoide
Copy link
Owner

gilzoide commented May 6, 2025

Thanks for the additional information both of you. These logs don't show much indeed. So you get a SEGFAULT in the call to SQLite3.Open, that already helps. I'll try reproducing it in a Linux machine later and see what I can find. I'll be testing with the "SQLite REPL" sample scene that's bundled with this package. Will let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux Issue occurs on Linux platform
Projects
None yet
Development

No branches or pull requests

3 participants