Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » SERIOUS: Fatal error: invalid memory access
Re: SERIOUS: Fatal error: invalid memory access [message #42184 is a reply to message #42175] Wed, 26 February 2014 20:46 Go to previous messageGo to next message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
Attached you will NOT find the gzipped crash report dated 2014/2/24 21:14 because it exceeds maximum file size. It was uploaded by whoopsie to launchpad (or nowhereland?).
So I collected the begin of the report and a stack trace. Perhaps somebody can decode the text file attached.

Re: SERIOUS: Fatal error: invalid memory access [message #42200 is a reply to message #42030] Thu, 27 February 2014 16:56 Go to previous messageGo to next message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
Today it is a segmentation fault and I have a complete Stacktrace. It is within the appended text file.

When I noticed that there is a parameter version=-2147483648 I remembered the comment of uninitialized variable. And indeed, in ide.cpp function SetMain there is a call of LoadFromFile with two parameters only. In Stream.cpp the function LoadFromFile expects three parameters, the third of which is version.

The compiler does not complain because LoadFromFile is not in any header file.

I don't know whether this is the reason but it is worth to look at.
Re: SERIOUS: Fatal error: invalid memory access [message #42203 is a reply to message #42200] Thu, 27 February 2014 17:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12020
Registered: November 2005
Ultimate Member
ManfredHerr wrote on Thu, 27 February 2014 10:56

Today it is a segmentation fault and I have a complete Stacktrace. It is within the appended text file.

When I noticed that there is a parameter version=-2147483648 I remembered the comment of uninitialized variable. And indeed, in ide.cpp function SetMain there is a call of LoadFromFile with two parameters only. In Stream.cpp the function LoadFromFile expects three parameters, the third of which is version.

The compiler does not complain because LoadFromFile is not in any header file.



Third parameter has default Null, which is equal to -2147483648 -> this is OK.

However, stack trace leads to conclusion that the problem is in TabBar - and perhaps it only got visible by GTK.

Also, it is very consistent with report about out of memory (while allocating buffer for Image). And with the fact that I do not normally get the crash (I have tabs off).

Thanks a lot, now we are getting somewhere... Smile

Mirek
Re: SERIOUS: Fatal error: invalid memory access [message #42227 is a reply to message #42203] Fri, 28 February 2014 17:50 Go to previous messageGo to next message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
I can support the suspicion of tab bar being the bad. I have a project that reproduced that error when set as main package. As soon as I took away the check mark at persistent tabs the project loaded without problems.
Re: SERIOUS: Fatal error: invalid memory access [message #42230 is a reply to message #42227] Fri, 28 February 2014 19:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12020
Registered: November 2005
Ultimate Member
Well, I have found another issue, which is easily reproducible (and related GTK in a way that order of some operations, while correct, is different in GTK).

To reproduce:

* Load 'ide' project, go to TabBar.cpp, start searching (Ctrl+F) for "Repos", then click on FileTabs.h.

Basically, it is clicking on file with file dialog in bottom or top of screen (after succesful find).

This second issue is now fixed. I am still investigating TabBar. I think I can fix it easily, but I would like to understand the code more before doing hastily patch.

Mirek
Re: SERIOUS: Fatal error: invalid memory access [message #42231 is a reply to message #42230] Fri, 28 February 2014 20:27 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 627
Registered: September 2012
Location: Poland, Kraków
Contributor
Hello Mirek,

BTW, Mirek can you patch obvious GTK bug: #619.

Sincerely,
Klugier


Ultimate++ - one framework to rule them all.
Re: SERIOUS: Fatal error: invalid memory access [message #42239 is a reply to message #42200] Sat, 01 March 2014 11:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12020
Registered: November 2005
Ultimate Member
ManfredHerr wrote on Thu, 27 February 2014 10:56

Today it is a segmentation fault and I have a complete Stacktrace. It is within the appended text file.

When I noticed that there is a parameter version=-2147483648 I remembered the comment of uninitialized variable. And indeed, in ide.cpp function SetMain there is a call of LoadFromFile with two parameters only. In Stream.cpp the function LoadFromFile expects three parameters, the third of which is version.

The compiler does not complain because LoadFromFile is not in any header file.

I don't know whether this is the reason but it is worth to look at.


After further analysis of posted crashdump, I was finally able to deduce what went wrong....

Thing is that TabBar::Serialize (at theide start) left TabBar::Tab attributes like 'size' and 'pos' uninitialized.

So on theide start, these start unitialized, then it gets Paint called BEFORE having chance to initialize records by calling Repos.

I have fixed the issue by adding Repos at the end of Serialize, and also (just to be sure) by initializing them in the constructor.

So hopefully, both issues should be now fixed....

Mirek
Re: SERIOUS: Fatal error: invalid memory access [message #42240 is a reply to message #42239] Sat, 01 March 2014 11:34 Go to previous message
mirek is currently offline  mirek
Messages: 12020
Registered: November 2005
Ultimate Member
P.S.: The reason why it has started crashing with GTK is that in GTK the Paint call comes sooner that with other platforms - which is really legal by API contract, but different. That exposed the bug...
Previous Topic: GLCtrl problem in Linux after switching to GTK backend
Next Topic: Bug: problem with special characters on Button
Goto Forum:
  


Current Time: Fri Sep 20 03:31:33 CEST 2019

Total time taken to generate the page: 0.01350 seconds