Skip to content

Fix ARM64 segfault on connect failure with libpq 506#33

Open
Dark-Athena wants to merge 1 commit intoHuaweiCloudDeveloper:masterfrom
Dark-Athena:fix-issue-30-arm64-segfault
Open

Fix ARM64 segfault on connect failure with libpq 506#33
Dark-Athena wants to merge 1 commit intoHuaweiCloudDeveloper:masterfrom
Dark-Athena:fix-issue-30-arm64-segfault

Conversation

@Dark-Athena
Copy link
Copy Markdown

@Dark-Athena Dark-Athena commented Apr 29, 2026

Summary

  • avoid broad failed-PGconn attribute introspection in finish_pgconn()
  • build a safe failed-connection snapshot from explicit fields
  • sanitize _connect() failure branches to pass conninfo-derived diagnostics
  • add a regression test ensuring finish_pgconn() doesn't read arbitrary PGconn attributes
  • document the fix in release notes

Validation

  • reproduced on ARM64 remote env:
    • libpq 505.2: expected connection error (no crash)
    • libpq 506.0: segfault before patch, normal OperationalError after patch
  • checked failed-connection diagnostics still expose pgconn.db and sane status values

Closes #30

@Dark-Athena Dark-Athena force-pushed the fix-issue-30-arm64-segfault branch from 97b72ee to 94043f7 Compare April 29, 2026 09:54
@Dark-Athena Dark-Athena force-pushed the fix-issue-30-arm64-segfault branch from 94043f7 to 46c4360 Compare April 29, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM64环境下,使用gaussdb 506.0SPC0100版本的libpq,在连接失败的时候python进程会coredump

1 participant