Description of problem: postgresql-server和libpq版本对不上,前者是15.3,后者是15.2,导致编译PostGIS插件时提示Segmentation Fault,使用PostgreSQL官方15.3源码编译没问题 Version-Release number of selected component (if applicable): postgresql-server-15.3-1.an23.x86_64.rpm postgresql-server-devel-15.3-1.an23.x86_64.rpm libpq-15.2-3.an23.x86_64.rpm libpq-devel-15.2-3.an23.x86_64.rpm How reproducible: ,尝试复现configure中PQserverVersion方法,编译通过后运行提示Segmentation Fault Steps to Reproduce: 1.下载PostGIS 3.3.3源码包进行编译,configure过程中报错 2.尝试复现configure中PQserverVersion方法,编译通过后运行提示Segmentation Fault 3.怀疑是libpq包与postgresql-server不是同一次编译的产物导致 Actual results: Segmentation Fault Expected results: 正确输出版本 Additional info: 建议将libpq版本对齐到15.3-1
https://abs.openanolis.cn/all_project/1001?tab=packages&package_id=44672 可以先测试一下新版的 libpq。按理说 postgis 是不需要 libpq 的
https://fedora.pkgs.org/rawhide/fedora-x86_64/postgis-gui-3.3.3-1.fc39.x86_64.rpm.html 从这里可以看出,postgis-gui 编译依赖的是 postgresql-server-devel,它的符号来自于 libpq.so.private15-5,与 libpq 没有关系。
Created attachment 849 [details] 检查代码
Created attachment 850 [details] libpq-devel core dump
Created attachment 851 [details] postgresql-server-devel core dump
我试了一下,新的libpq确实也不行,用postgresql-server-devel也不行,不知道问题在哪里,我把PostGIS的检查代码和对应的core文件都上传了,麻烦帮忙看看,另外,用官方的PostgreSQL 15.3编译就一点问题没有
https://src.fedoraproject.org/rpms/postgis/blob/rawhide/f/postgis.spec 你有没有加这个开关: ./configure --with-gui --with-pgconfig=/usr/bin/pg_server_config
试了下,效果一样
我今天仔细排查了这个问题,查到原因了,主要是因为/usr/bin/pg_config --cflags命令返回的-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection中,/usr/lib/rpm/anolis/anolis-hardened-cc1和/usr/lib/rpm/anolis/anolis-annobin-cc1两个文件不存在导致的,可以考虑把这两个文件放到postgresql-server-devel包中,可以解决该问题
我觉得segfault可能来源于某些编译的开关。你试试这个: https://abs.openanolis.cn/all_project/1?build_id=31156&tab=packages&package_id=45092