Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

monodevelop fails to load projects due to sqlite3 issue on Ubuntu 17.10 #4224

Open
atsushieno opened this issue Mar 19, 2018 · 14 comments
Open
Labels

Comments

@atsushieno
Copy link
Member

On Ubuntu (17.10) monodevelop fails to open a project due to some problem with related to sqlite3 usage in Roslyn:

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) SQLitePCL.SQLite3Provider_e_sqlite3/NativeMethods.sqlite3_open_v2 (byte[],intptr&,int,byte[]) [0x00020] in <effd1c25d63e468eb3b1d32e723a302f>:0
  at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_open_v2 (string,intptr&,int,string) [0x0000f] in <effd1c25d63e468eb3b1d32e723a302f>:0
  at SQLitePCL.raw.sqlite3_open_v2 (string,SQLitePCL.sqlite3&,int,string) [0x0000a] in <ee692e8bd0574ccebb8ed2c4862d409c>:0
  at Microsoft.CodeAnalysis.SQLite.Interop.SqlConnection.Create (Microsoft.CodeAnalysis.Host.IPersistentStorageFaultInjector,string) [0x0000f] in /_/src/Workspaces/Core/Desktop/Workspace/SQLite/Interop/SqlConnection.cs:57
  at Microsoft.CodeAnalysis.SQLite.SQLitePersistentStorage.GetConnection () [0x00039] in /_/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs:172
  at Microsoft.CodeAnalysis.SQLite.SQLitePersistentStorage.GetPooledConnection () [0x00000] in /_/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs:243
  at Microsoft.CodeAnalysis.SQLite.SQLitePersistentStorage.Initialize (Microsoft.CodeAnalysis.Solution) [0x00000] in /_/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorage.cs:248
  at Microsoft.CodeAnalysis.SQLite.SQLitePersistentStorageService.TryOpenDatabase (Microsoft.CodeAnalysis.Solution,string,string,Microsoft.CodeAnalysis.Host.IPersistentStorage&) [0x00027] in /_/src/Workspaces/Core/Desktop/Workspace/SQLite/SQLitePersistentStorageService.cs:64
  at Microsoft.CodeAnalysis.Storage.AbstractPersistentStorageService.TryCreatePersistentStorage (Microsoft.CodeAnalysis.Solution,string,Microsoft.CodeAnalysis.Host.IPersistentStorage&) [0x00016] in /_/src/Workspaces/Core/Desktop/Workspace/Storage/AbstractPersistentStorageService.cs:173
  at Microsoft.CodeAnalysis.Storage.AbstractPersistentStorageService.TryCreatePersistentStorage (Microsoft.CodeAnalysis.Solution,string) [0x00000] in /_/src/Workspaces/Core/Desktop/Workspace/Storage/AbstractPersistentStorageService.cs:152
  at Microsoft.CodeAnalysis.Storage.AbstractPersistentStorageService.GetStorage (Microsoft.CodeAnalysis.Solution,bool) [0x000d7] in /_/src/Workspaces/Core/Desktop/Workspace/Storage/AbstractPersistentStorageService.cs:97
  at Microsoft.CodeAnalysis.FindSymbols.SyntaxTreeIndex/<PrecalculatedAsync>d__57.MoveNext () [0x00035] in /_/src/Workspaces/Core/Portable/FindSymbols/SyntaxTree/SyntaxTreeIndex_Persistence.cs:128
<snip>

This occurs with any kind of project as far as I tried.

Ubuntu 17.10 / mono 2f21177 / monodevelop b21f597 / sqlite3 3.19.3-3 (system installed package)

@atsushieno
Copy link
Member Author

I wonder if dotnet/roslyn#22996 fixes the issue.

@Therzok
Copy link
Contributor

Therzok commented Mar 19, 2018

@atsushieno are you on ARM64? if so this needs fixing ericsink/SQLitePCL.raw#199

I need to open a PR against roslyn to fix this from occurring again dotnet/roslyn#24042

As a workaround, https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs#L112

bump this number to 1gb or so so it doesn't try to use persistent storage

@atsushieno
Copy link
Member Author

atsushieno commented Mar 19, 2018

It is amd64. And your workaround worked for me. Thanks.

@Therzok
Copy link
Contributor

Therzok commented Mar 19, 2018

Hmm, this is entrypoint not found, not dllnotfound. Seems to be another issue.

@Therzok
Copy link
Contributor

Therzok commented Mar 19, 2018

@atsushi can you provide a full log with MONO_LOG_MASK=dll? I wonder if we end up loading a system provided .so, rather than the one in main/build/bin

@Therzok
Copy link
Contributor

Therzok commented Mar 19, 2018

Opened dotnet/roslyn#25590 which should fix issues like this by logging that persistent storage was disabled via the exception.

@atsushieno
Copy link
Member Author

I'm not sure if this log helps (it doesn't for me) but anyways... https://gist.github.com/atsushieno/7391f28db0768ec113c17b25941e45b3

@Therzok
Copy link
Contributor

Therzok commented Mar 20, 2018

Is that log with MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll? @mkrueger mentioned that the .dylib ended up being copies in the bin dir, not the .so

@atsushieno
Copy link
Member Author

I must have missed MONO_LOG_LEVEL...! I have updated gist that now somewhat makes more sense.

@Therzok
Copy link
Contributor

Therzok commented Mar 20, 2018

https://github.com/ericsink/SQLitePCL.raw/blob/aacca15515a3d1ab1671379dc9f0af9e0a5bc70a/src/cs/sqlite3_pinvoke.cs#L1524-L1525

and

➜  native git:(master) ✗ nm libe_sqlite3.so | grep sqlite3_open
000000000009a557 T sqlite3_open
000000000009a57d T sqlite3_open16
000000000009a56f T sqlite3_open_v2

Seems like the symbol is there. I'm not sure why this is failing.

@slluis slluis added the linux label Mar 21, 2018
Therzok added a commit that referenced this issue Apr 16, 2018
Fixes #4224. Missing binding redirects
Therzok added a commit that referenced this issue Apr 16, 2018
Fixes #4224. Missing binding redirects
@xamarin-release-manager
Copy link
Contributor

Fixed in version 7.6.0.534 (master)

Author: therzok
Commit: a871b7f (mono/monodevelop)

1 similar comment
@xamarin-release-manager
Copy link
Contributor

Fixed in version 7.6.0.534 (master)

Author: therzok
Commit: a871b7f (mono/monodevelop)

@Therzok
Copy link
Contributor

Therzok commented Apr 20, 2018

Seems it's still busted. Will reopen and take a look at it soon.

@Therzok Therzok reopened this Apr 20, 2018
@Therzok
Copy link
Contributor

Therzok commented Apr 20, 2018

As a workaround, committing this: #4647

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants