Skip to content

In Postgres 12.15 Image, LLVMBuildGEP symbol not found. #1076

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

Closed
shynyng opened this issue May 12, 2023 · 14 comments · Fixed by edm-su/api#238 or #1077
Closed

In Postgres 12.15 Image, LLVMBuildGEP symbol not found. #1076

shynyng opened this issue May 12, 2023 · 14 comments · Fixed by edm-su/api#238 or #1077

Comments

@shynyng
Copy link

shynyng commented May 12, 2023

Hello! I am using the Postgres 12 image and Django for my backend application.

However, after updating the Postgres 12 image to version 12.15, I encountered some failed operations due to the absence of LLVMBuildGEP.

The error message is as follows:

django.db.utils.OperationalError: could not load library "/usr/local/lib/postgresql/llvmjit.so": Error relocating /usr/local/lib/postgresql/llvmjit.so: LLVMBuildGEP: symbol not found.

Upon investigation, I discovered that the Alpine Linux version in the updated Postgres 12.15 image is now 3.18, and this version no longer includes LLVMBuildGEP because it was removed in LLVM 16. (LLVM 16 Release Notes)

I was able to resolve this issue by reverting my Postgres image version back to 12.14.

@ImreSamu
Copy link
Contributor

ImreSamu commented May 12, 2023

I'm experiencing a similar issue with the https://github.com/postgis/docker-postgis - alpine3.18 test.

#7 157.9  ./core/regress_spgist_index_2d ..2023-05-12 05:05:53.730 UTC [11898] ERROR:  could not load library "/usr/local/lib/postgresql/llvmjit.so": Error relocating /usr/local/lib/postgresql/llvmjit.so: LLVMBuildGEP: symbol not found

(I'm just guessing)
It might be necessary to build it with llvm15 until the upstream postgres resolves the compatibility with llvm16.

At least in Alpine3.18, postgresql12 built with llvm14.

EDIT:

  • my temporary workaround: JIT=OFF

@basdebakker
Copy link

We have the same issue with PostgreSQL 15. We are using the 15-alpine tag that was just updated to 15.3 and now run into this same error.

@jonfinerty
Copy link

This is also affecting the 13-alpine image, we've worked around in the meantime by pinning to the previous version, the 13.10-alpine tag.

@thienandangthanh
Copy link

thienandangthanh commented May 12, 2023

I have the same issue with PostgreSQL 14. I are using the 14-alpine tag.
I need to fallback to tag 14-alpine3.17 or 14.7-alpine with image id 9d94e6318ef2 to temporarily resolve the problem.

@thienandangthanh
Copy link

I understand that upgrading to alpine 3.18 or newer is vital. Because it mitigates the vulnerabilities.
Sticking with a version is not a good idea.

@tianon, do you have any thought about this issue?

@NorthBlue333
Copy link

NorthBlue333 commented May 12, 2023

I also have the same issue with Postgres 13-alpine3.18. 👍

@msand
Copy link

msand commented May 12, 2023

I wonder, would it be enough to replace

llvm-dev clang g++ \

With llvm15-dev clang15

@yosifkit
Copy link
Member

I'm working on a PR for a fix and should have something up shortly. I'm also trying to work out a test so that we can verify the fix as well.

@yosifkit
Copy link
Member

I have a simple test up in docker-library/official-images#14646 that should help prevent this in the future. Once I can get that merged, I'll open the PR for my branch with the fix (infosiftr@9768eb1) so that the tests will run on the fix PR.

@nekopsykose
Copy link

nekopsykose commented May 12, 2023

We have the same issue with PostgreSQL 15. We are using the 15-alpine tag that was just updated to 15.3 and now run into this same error.

are you sure? postgres 15.3 supports llvm16 when built against and at runtime fine, since it was ported to LLVMBuildGEP2, afaik

(edit: disregard, i'm wrong)

@kevinm416
Copy link

I also had this issue with postgresql:15-alpine. I pinned the version postgresql:15-alpine3.17 while this gets sorted out.

@ImreSamu
Copy link
Contributor

@yosifkit :

I'll open the PR for my branch with the fix (infosiftr@9768eb1) so that the tests will run on the fix PR.

Thank you!

comment:

As I understand that for the downstream ( ~ Postgis ) build script ( https://github.com/postgis/docker-postgis/blob/b50183f2244f42904d95d2bac3a12d1f16b4e59a/Dockerfile.alpine.template#L85
) , it's necessary to install the exact same LLVM version.
and currently, identifying the linked LLVM version via the command line can be a bit challenging.

I don't know what the recommended method for determining the linked LLVM version is, but if there is a recommendation,
it would be advisable to include it in the documentation.

  • apk list | grep llvm | cut -d '-' -f1 ( my current solution )
  • ldd ?
  • or could we consider creating an environment variable for the LLVM version? (e.g., ENV PG_LLVM 15 )
  • The pg_config --configure is not working.

@yosifkit
Copy link
Member

or could we consider creating an environment variable for the LLVM version? (e.g., ENV PG_LLVM 15 )

I hadn't considered that postgis and other extensions would need to install the same llvm-dev/clang versions. 🤔 I think an ENV could make sense. Do they need other values like LLVM_CONFIG and CLANG too?

@yosifkit
Copy link
Member

Would a package list in the env var work to lower duplication that extensions would have to do? Like we have for php: https://github.com/docker-library/php/blob/0a68eaa2d3a269079c687e55abc960c77d3a134e/8.2/alpine3.18/cli/Dockerfile#L11-L20.

azhavoro added a commit to cvat-ai/cvat that referenced this issue May 16, 2023
This reverts commit 2754504.

<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
Resolved in docker-library/postgres#1076

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
~~- [ ] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file~~
~~- [ ] I have updated the documentation accordingly~~
~~- [ ] I have added tests to cover my changes~~
~~- [ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~
~~- [ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.

Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
mikhail-treskin pushed a commit to retailnext/cvat that referenced this issue Jul 1, 2023
This reverts commit 2754504.

<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
Resolved in docker-library/postgres#1076

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
~~- [ ] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file~~
~~- [ ] I have updated the documentation accordingly~~
~~- [ ] I have added tests to cover my changes~~
~~- [ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))~~
~~- [ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.

Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants