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

Crash releasing pooled PostgreSQL connection when layer table has column-restricted update privilege (?) #57809

Open
2 tasks
strk opened this issue Jun 20, 2024 · 0 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption

Comments

@strk
Copy link
Contributor

strk commented Jun 20, 2024

What is the bug or the crash?

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff30a9e8f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff305afb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff3045472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00005555555626df in qgisCrash(int) (signal=-1) at /usr/local/src/qgis/qgis/src/app/main.cpp:362
#5  0x0000555555562ed9 in myMessageOutput(QtMsgType, QMessageLogContext const&, QString const&) (type=QtFatalMsg, msg=...) at /usr/local/src/qgis/qgis/src/app/main.cpp:460
#6  0x00007ffff32c3b50 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff32c3c68 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff3290c60 in QMessageLogger::fatal(char const*, ...) const () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff3290024 in qt_assert_x(char const*, char const*, char const*, int) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007fffa60eb842 in QgsConnectionPool<QgsPostgresConn*, QgsPostgresConnPoolGroup>::releaseConnection(QgsPostgresConn*) (this=0x7fff94009940, conn=0x7fff5c001c00)
    at /usr/local/src/qgis/qgis/src/core/qgsconnectionpool.h:335
#11 0x00007fffa610bb93 in QgsPostgresFeatureIterator::close() (this=0x7fff5c0097f0) at /usr/local/src/qgis/qgis/src/providers/postgres/qgspostgresfeatureiterator.cpp:457

Steps to reproduce the issue

The way I've reproduced it was with a project file aimed at debugging GH-28835

The database was prepared like this:

CREATE TABLE qgis_issue_gh_28835 (
  id SERIAL PRIMARY KEY,
  restricted_column TEXT,
  geom GEOMETRY(Polygon, 4326)
);
GRANT USAGE
  ON qgis_issue_gh_28835_id_seq
  TO qgis_test_unprivileged_user;
GRANT SELECT, INSERT(geom), UPDATE(geom)
  ON qgis_issue_gh_28835
  TO qgis_test_unprivileged_user;

The project file is this: http://strk.kbt.io/tmp/qgis-infinite-crash-project.qgz

Taking out the UPDATE(geom) privilege fixes the crash.

Versions

ba1d45e

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

Relates to GH-28835

@strk strk added Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Jun 20, 2024
strk added a commit to strk/QGIS that referenced this issue Jun 20, 2024
strk added a commit to strk/QGIS that referenced this issue Jul 8, 2024
strk added a commit to strk/QGIS that referenced this issue Jul 15, 2024
strk added a commit to strk/QGIS that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption
Projects
None yet
Development

No branches or pull requests

1 participant