-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
'bad_alloc' error at QGIS start #17837
Comments
Author Name: Luigi Pirelli (@luipir) append to me too... first we had experienced with this error on windows (32b) loading plugin containing a lot of data (300MB) and we solved separating plugin from test data. But I started to have this error since last week randomly (three times) and I'm on debian wheezy. I wasn't able to reproduce the error. |
Author Name: Giovanni Allegri (@giohappy) I confirm the same random problem, both on Ubuntu and Xubuntu 12.04 with QGIS 2.0.1 packages from UbuntuGis PPA |
Author Name: Luigi Pirelli (@luipir) Luigi Pirelli wrote:
|
Author Name: Ivan Mincik (Ivan Mincik) At least in my case, it seems that this problem appears more frequently when running Ubuntu in VirtualBox than on physical machine. |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Matthias Kuhn (@m-kuhn) Just got the same for the first time on my Fedora machine (using a freshly compiled master). The last time I have seen this was on a Windows machine using an early 1.9 dev build. At the same time I lost my whole local configuration. |
Author Name: Ivan Mincik (Ivan Mincik) Could it be some problem in counting extent and starting scale of map canvas from QGIS application window ? From debug messages it seems that the error is thrown just before setting scale. |
Author Name: Ivan Mincik (Ivan Mincik) I have found that if I run QGIS from command line this problem occurs less frequently than when running from applications menu. Any ideas ? |
Author Name: Ivan Mincik (Ivan Mincik) Tests with latest master has shown that QGIS will throw bad_alloc error when there is less than 880 MiB of virtual memory on 64bit system or 310 MiB on 32 bit system. Error is thrown from 'setEditText' from 'QgsScaleComboBox::setScaleString' in 'src/gui/qgsscalecombobox.cpp'. QGIS is allocating 64 MiB at start. I do not understand why it grows to 800 suddenly. Test was done by Ferdinand Majerech. |
Author Name: Ferdinand Majerech (Ferdinand Majerech) Memory usage doesn't really 'grow' to ~880 MiB; QGIS is simply unable to allocate if it doesn't have that much virtual memory I think that's not really a 'bug', but rather a performance problem - QGIS always crashes with It doesn't exactly match the behavior of this bug (randomly throws std::bad_alloc at startup regardless of memory size), which |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Ferdinand Majerech (Ferdinand Majerech) I've now reproduced the random std::bad_alloc at startup bug. I think it's unrelated to the It seems the std::bad_alloc is actually thrown before adjustExtentToSize() is called. The interesting part of the log (see the '//' comments)
|
Author Name: Ferdinand Majerech (Ferdinand Majerech) I found the source of the bug. The QgisApp class defined in src/app/qgisapp.h and src/app/qgisapp.cpp has a data member unsigned int mMousePrecisionDecimalPlaces, which is not initialized to any value by QgisApp constructor. Also, there is a mMousePrecisionAutomatic data member, which seems related, but is not used anywhere in QGIS. Also, I noticed that there is quite a lot of data members not initialized by the constructor of QgisApp (and likely in the rest of QGIS?). This should be avoided if possible; even if a variable is expected to be set right after the constructor by e.g. a method call, not every user of the class may know that and it may result in more similar bugs. It's better to find a workable default and use that in the constructor, or to set an absurd value that is guaranteed to blow up if not set before use to detect bugs immediately (rather than an uninitialized value that may or may not crash resulting in heisenbugs like this) |
Author Name: Ferdinand Majerech (Ferdinand Majerech) Pull request with the fix: |
Author Name: Martin Dobias (@wonder-sk) Fixed in changeset "ac9eed7e052428722cd66ce0e39aee933c8176e6".
|
Author Name: Ivan Mincik (Ivan Mincik)
Original Redmine Issue: 9213
Affected QGIS version: master
Redmine category:map_canvas
There is an error message 'std::bad_alloc' just after QGIS window is started (see qgis-bad-alloc.png). This problem is confirmed on QGIS-dev list [1] by one user.
This error appears very randomly. Sometimes I can start QGIS multiple times without this error, sometimes there are sequences where when it always appears. Error appears also in QGIS 2.0.1. In 2.0.1 it causes application crash after a few operations are done (for example after opening leayer and moving in map).
I have compiled QGIS master in my PPA [2] with debug messages and I am attaching output messages of QGIS start without error (qgis-bad-alloc-debug-messages-no-error.txt) and with error (qgis-bad-alloc-debug-messages-error.txt - output is finished on error). From my point of view there is no significant difference between those files other than 'no-error' file continues until successful application start.
Software versions:
OS: XUbuntu 12.04 32bit
QGIS version 2.1.0-Master
Compiled against Qt 4.8.1 - Running against Qt 4.8.1
Compiled against GDAL/OGR 1.10.0 - Running against GDAL/OGR 1.10.0
Compiled against GEOS 3.3.8-CAPI-1.7.8 - Running against GEOS 3.3.8-CAPI-1.7.8
PostgreSQL Client Version 9.1.11
SpatiaLite Version 4.1.0
QWT Version 5.2.2
PROJ.4 Version 480
--
1 - https://www.mail-archive.com/qgis-developer@lists.osgeo.org/msg19096.html
2 - https://launchpad.net/~imincik/+archive/qgis-master
The text was updated successfully, but these errors were encountered: