Skip to content
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

Recent updates to libspatialite crashing processes #43203

Closed
bricelam opened this issue Aug 16, 2019 · 15 comments

Comments

@bricelam
Copy link

commented Aug 16, 2019

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • are reporting a bug others will be able to reproduce and not asking a question or requesting software. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh. To get software added or changed in Homebrew please file a Pull Request
  • have a problem with brew install (or upgrade, reinstall) a single, Homebrew/homebrew-core formula (not cask) on macOS? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a Linux problem please file this issue at https://github.com/Homebrew/linuxbrew-core/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

Recent updates by @fxcoudert to the libspatialite package are crashing processes using .NET Core and Entity Framework Core to access SpatiaLite databases. (Originally filed by @garfbradaz as aspnet/EntityFrameworkCore#16667)

Steps to reproduce

  1. Download and install the .NET Core 2.2 SDK
  2. git clone https://github.com/StratumFive/EFCore.SQLite.SpatialCrash.
  3. brew install libspatialite
  4. Change directory to the root solution.
  5. dotnet test xunit
  6. Receive error message: The active test run was aborted. Reason: Test host process crashed.

The dotnet executable crashes and I will receive a crash dump report.

Operating system: Mac Mojave 10.14.5

Workaround

Using the previous version works as expected.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/835ae521c065524abdf66578e68032fa24bce514/Formula/libspatialite.rb

Wild Speculation

It may or may not be related to the fact that our native SQLite library is named libe_sqlite3.dylib and not libsqlite3.dylib.

@SMillerDev

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

This seems a lot like a bug in dotnet. If it can't handle recent libspatialite libraries it should just break before that.

@fxcoudert

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Agreed. There is not much indication that the problem lies in libspatialite, especially since we haven't really changed our build for it (just triggered a re-build due to proj being updated).

One thing that could help decide what is going wrong: does the problem persist if you brew reinstall -s libspatialite (i.e. reinstall the latest version, but from source)?

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

I doubt it's related to .NET; that's just our means of invoking native calls like this:

sqlite3 *db;
sqlite3_open(":memory:", &db);
sqlite3_enable_load_extension(db, 1);
sqlite3_exec(db, "SELECT load_extension('mod_spatialite');", 0, 0, 0);

Let me see if it repros with brew reinstall -s...

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

Also worth noting: the same code passes on Ubuntu using their latest libsqlite3-mod-spatialite package.

@SMillerDev

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Does it pass on arch Linux? Cause Ubuntu isn't really a cutting edge distro

bricelam added a commit to bricelam/EFCore that referenced this issue Aug 20, 2019
@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

There was one report of a crash on Debian in Docker, but it's unclear if it's related.

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

Hmm, renaming the library to libsqlite3.dylib didn't help either...

Were you able to repro using the C code above?

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

This might be a problem with PROJ. It looks like it's linked to libsqlite3-0

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

Any chance of reverting to PROJ v5?

@garfbradaz

This comment has been minimized.

Copy link

commented Aug 20, 2019

There was one report of a crash on Debian in Docker, but it's unclear if it's related.

I can confirm when running in Docker Debian I experienced the same. Had to use Alpine instead.

@pond

This comment has been minimized.

Copy link

commented Aug 20, 2019

@fxcoudert

This comment has been minimized.

Copy link
Member

commented Aug 23, 2019

I doubt it's related to .NET

If you have a crash without .NET, on the minimal code you posted (or another one), that would be fine. But we have many other formulas that depend, directly or indirectly, on libspatialite… and no bugs reported there. Which is why I think it might be .NET specific (in the way it links libraries, or something else).

Closing for now, there is no indication that this is a Homebrew-specific issue. Happy to reconsider if this is debugged further.

@fxcoudert fxcoudert closed this Aug 23, 2019

@bricelam

This comment has been minimized.

Copy link
Author

commented Aug 23, 2019

I believe recent updates in PROJ v6 have broken mod_spatialite for certain scenarios. This issue is external to the Homebrew formula. Thanks for helping me dig deeper into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.