Bug report #4509

Crash on SPARC when opening vector layer

Added by Sam Gillingham over 12 years ago. Updated about 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:master Regression?:No
Operating System:Sparc Solaris Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:14431

Description

QGIS crashes with "signal BUS (invalid address alignment)" on Sparc Solaris when opening a shape file. I have tracked the problem down to src/core/symbology-ng/qgsrendererv2.cpp and I attach a proposed patch. As I understand it, Sparc and other RISC processors only allow memory access on certain memory boundaries so maybe memcpy is safer than pointer casting when dealing with WKBs. It seems other parts of QGIS already do this.

I think this will likely be a problem on ARM chips also as they have a similar limitation.

I am happy to do any other testing on Sparc that may be required.

qgsrendererv2.cpp.patch Magnifier - Patch to fix address alignment problem in qgsrendererv2.cpp (3.73 KB) Sam Gillingham, 2011-11-09 01:26 PM

qgsgeometry.cpp.patch Magnifier - Patch to fix address alignment problem in qgsgeometry.cpp (35.6 KB) Sam Gillingham, 2012-01-31 12:55 PM

qgslabel.cpp.patch Magnifier (4.23 KB) Sam Gillingham, 2012-04-11 04:29 PM

qgsgeometry.cpp.patch2 - Fixes omitted from original patch (37.5 KB) Sam Gillingham, 2012-04-18 05:15 PM

qgsdistancearea.cpp.patch Magnifier - Patch to address these issues for this file (2.33 KB) Sam Gillingham, 2012-04-18 05:15 PM

History

#1 Updated by Paolo Cavallini over 12 years ago

  • Category set to Vectors

#2 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 1.7.4

#3 Updated by Giovanni Manghi about 12 years ago

  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to Yes

#4 Updated by Sam Gillingham about 12 years ago

Found that qgsgeometry.cpp has a similar problem...

#5 Updated by Sam Gillingham almost 12 years ago

Also in qgslabel.cpp - see attached patch. Confirmed that these issues cause similar problems on Linux/ARM.

#6 Updated by Paolo Cavallini almost 12 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#7 Updated by Sam Gillingham almost 12 years ago

Found a couple of missed fixes in qgsgeometry.cpp - see new patch. Also found another file with the problem (qgsdistancearea.cpp).

#8 Updated by Paolo Cavallini over 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#9 Updated by Paolo Cavallini almost 11 years ago

Could you check that the problem is still there? If so, could Marco please revise the patch and apply it if appropriate?
Thanks

#10 Updated by Marco Bernasocchi over 10 years ago

this is also valid for android

#11 Updated by Marco Bernasocchi over 10 years ago

patches updated and partly applyed in https://github.com/mbernasocchi/QGIS/tree/androidFixByteAllign. I'll pull request and close this later this week.

#12 Updated by Paolo Cavallini about 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - High Priority

#13 Updated by Martin Dobias about 10 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed
  • Target version changed from Future Release - High Priority to Version 2.2

Some time ago the WKB handling has been updated to use memcpy, so it should be working now in master. Please reopen if there are any remaining issues.

Also available in: Atom PDF