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

Error and segmentation fault adding new columns to PostGIS layers #20243

Closed
qgib opened this issue Jan 22, 2015 · 1 comment
Closed

Error and segmentation fault adding new columns to PostGIS layers #20243

qgib opened this issue Jan 22, 2015 · 1 comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Jan 22, 2015

Author Name: Pedro Venâncio (Pedro Venâncio)
Original Redmine Issue: 12040
Affected QGIS version: master
Redmine category:attribute_table


  • If you create one new column in the attribute table of a layer PostGIS, and save, everything is fine.

  • If you create two new columns, and saves only after the two columns have been created, QGIS throws an error:

Could not commit changes to layer pedreiras

Errors: SUCCESS: 2 attribute(s) added.
  ERROR: 37 attribute value change(s) not applied.
 
  Provider errors:
      PostGIS error while changing attributes: ERROR:  syntax error at or near "WHERE"
    LINE 1: UPDATE "ocorrencias_minerais"."pedreiras" SET  WHERE "id"=0

Despite this error, the columns are created in the database, but apparently, after adding the columns, QGIS tries to do some more update.

It happens to me both creating the new columns with "New column" and with the "Field Calculator".

I've tested it with layers of points and polygons, and with columns of different types. The result is the same. I've also tested on Windows (OSGeo4W) and Linux.

After the error, QGIS crashes with a segmentation fault:

pedro@tsunami:~$ gdb /usr/bin/qgis.bin
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/bin/qgis.bin...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/qgis.bin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_US]
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0xb5380b40 (LWP 19066)]
[New Thread 0xb4a7fb40 (LWP 19067)]
Debugger not enabled
Warning: Object::disconnect: Unexpected null parameter
[New Thread 0xae88db40 (LWP 19125)]
Warning: QGraphicsScene::addItem: item has already been added to this scene
[New Thread 0xad02cb40 (LWP 19171)]
[New Thread 0xac62bb40 (LWP 19172)]
[New Thread 0xabe2ab40 (LWP 19173)]

Program received signal SIGSEGV, Segmentation fault.
0x03439ada in QVariant::QVariant(QVariant const&) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
(gdb) continue
Continuing.
QGIS died on signal 11[Thread 0xac62bb40 (LWP 19172) exited]
[Thread 0xad02cb40 (LWP 19171) exited]
[Thread 0xae88db40 (LWP 19125) exited]
[Thread 0xabe2ab40 (LWP 19173) exited]
Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operação não permitida.
No thread selected
No stack.
gdb returned 0

Program received signal SIGABRT, Aborted.
0x00132416 in __kernel_vsyscall ()
(gdb) continue
Continuing.
[Thread 0xb4a7fb40 (LWP 19067) exited]
[Thread 0xb5380b40 (LWP 19066) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
(gdb)

This only happens to me with QGIS master. Tested in QGIS 2.4, 2.6.0 and 2.6.1 without problems, so it is a regression.

To reproduce:

  1. Open QGIS
  2. Load a PostGIS layer
  3. Open the attribute table
  4. Start editing
  5. "New column (Ctrl+W)" and give a name to the new field
  6. "New column (Ctrl+W)" again and give a name to the second new field
  7. Save edits
@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2015

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "843cf04920f6825bee451a4c5005e88711ce5b6d".


  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Attribute Table Crash/Data Corruption labels May 25, 2019
@qgib qgib added this to the Version 2.8 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table 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