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

Running pkg-config --list-all with PROJ installed causes segfault #2064

Closed
volleio opened this issue Mar 12, 2020 · 5 comments · Fixed by #2067
Closed

Running pkg-config --list-all with PROJ installed causes segfault #2064

volleio opened this issue Mar 12, 2020 · 5 comments · Fixed by #2067
Labels

Comments

@volleio
Copy link

volleio commented Mar 12, 2020

Example of problem

Found this issue debugging the install of RMagick.

Installing PROJ and then running

pkg-config --debug --list-all

causes a segfault while Parsing package file '/usr/local/lib/pkgconfig/proj.pc'.
Running

pkg-config --exists --print-errors "proj"

results in Variable 'datarootdir' not defined in '/usr/local/lib/pkgconfig/proj.pc'. Removing /usr/local/lib/pkgconfig/proj.pc (renaming it to proj.pc.backup) and re-running the pkg-config --list-all command succeeds without segfault.

Problem description

PROJ shouldn't affect pkg-config's ability to list all packages.

Expected Output

pkg-config --list-all should output all of the installed packages in the pkg-config pc paths.

Environment Information

  • PROJ version 7.0.0
  • MacOS Catalina 10.15.3 (19D76)
  • pkg-config version 0.29.2

Installation method

  • brew install proj
@volleio volleio added the bug label Mar 12, 2020
@hobu
Copy link
Contributor

hobu commented Mar 12, 2020

PROJ shouldn't affect pkg-config's ability to list all packages.

Can you past the proj.pc file here too?

pkg-config also shouldn't segfault ever 😄, but that's pkg-config's issue

@volleio
Copy link
Author

volleio commented Mar 12, 2020

Yep, here is my proj.pc contents!

prefix=/usr/local/Cellar/proj/7.0.0
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datadir=${datarootdir}/proj

Name: PROJ
Description: Coordinate transformation software library
Requires:
Version: 7.0.0
Libs: -L${libdir} -lproj
Libs.private: -lsqlite3 -lstdc++
Cflags: -I${includedir}

@hobu
Copy link
Contributor

hobu commented Mar 12, 2020

hmph, that doesn't look that interesting.

@mwtoews
Copy link
Member

mwtoews commented Mar 12, 2020

@volleio I'm unable to recreate the segfault under Ubuntu 18.04, but let's see if #2067 can resolve this issue. Could you try this proj.pc file content (the new added line is datarootdir=${prefix}/share):

prefix=/usr/local/Cellar/proj/7.0.0
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share
datadir=${datarootdir}/proj

Name: PROJ
Description: Coordinate transformation software library
Requires:
Version: 7.0.0
Libs: -L${libdir} -lproj
Libs.private: -lsqlite3 -lstdc++
Cflags: -I${includedir}

@volleio
Copy link
Author

volleio commented Mar 12, 2020

@mwtoews that resolved it, thank you!

jonchang pushed a commit to urschrei/homebrew-core that referenced this issue Apr 10, 2020
Prior to this, pkg-config would fail due to the missing definition.
Also fix autoconf errors

See OSGeo/PROJ#2064
and the fix in OSGeo/PROJ#2067
BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this issue Apr 18, 2020
Prior to this, pkg-config would fail due to the missing definition.
Also fix autoconf errors

See OSGeo/PROJ#2064
and the fix in OSGeo/PROJ#2067

Closes #51902.

Signed-off-by: Jonathan Chang <jonathan.chang@monash.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants