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 » Draw, Display, Images, Bitmaps, Icons » BufferPainter Clip Crash - Fatal error: Invalid memory access!
BufferPainter Clip Crash - Fatal error: Invalid memory access! [message #59548] Wed, 25 January 2023 17:02 Go to next message
devilsclaw is currently offline  devilsclaw
Messages: 15
Registered: August 2022
Promising Member
So I found a combination of actions that will cause clipping to return a invalid pointer in RenderPath of BufferPainter.

1) Use Clip and Draw out side of the clip region
2) Attach the object to follow the mouse
3) Repeatedly move the mouse in and out of the window frame at the bottom in random locations up to 30 seconds.

Attached is an example app in code of how to cause it.

Below is the offending code and the output of it getting a corrupted pointer

Y2 is the pointer getting corrupted. Also I am on linux

if(clip.GetCount()) {
  printf("DC: Y1 = %i\n", y);
  const ClippingLine& s = clip.Top()[y];
  printf("DC: Y2 = %p\n", &s);
  if(s.IsEmpty()) {
    goto empty;
  }
  printf("DC: Y3 = %i\n", y);
  if(!s.IsFull()) {
    mf.Set(rg, s);
    rf = &mf;
  }
}

Results:
DC: Y1 = 525
DC: Y2 = 0x7f82b80571e8
DC: Y1 = 526
DC: Y2 = 0x7f82b80571f0
DC: Y3 = 526
DC: Y1 = 525
DC: Y2 = 0x7f82b80571e8
DC: Y1 = 526
DC: Y2 = 0x7f82b80571f0
DC: Y3 = 526
DC: MouseMove: x 16620 : y 16906 : 00000000
DC: Y1 = 526
DC: Y2 = 0x1070

[Updated on: Wed, 25 January 2023 17:02]

Report message to a moderator

Re: BufferPainter Clip Crash - Fatal error: Invalid memory access! [message #59549 is a reply to message #59548] Wed, 25 January 2023 18:13 Go to previous messageGo to next message
devilsclaw is currently offline  devilsclaw
Messages: 15
Registered: August 2022
Promising Member
I also tested it in windows and it just straight crashes the program with out the crash handler like in linux.
Re: BufferPainter Clip Crash - Fatal error: Invalid memory access! [message #59551 is a reply to message #59548] Mon, 30 January 2023 17:49 Go to previous message
devilsclaw is currently offline  devilsclaw
Messages: 15
Registered: August 2022
Promising Member
So I am guessing no one has a clue how to fix it or could not confirm the bug ?

I am more of a C programmer and not sure how to handle a situation where the pointer should always be valid because of the object& return type and it not being valid.
Previous Topic: Crash when loading some jpeg files
Next Topic: BufferPainter Text Clips all text when partial off screen
Goto Forum:
  


Current Time: Fri Mar 24 09:39:35 CET 2023

Total time taken to generate the page: 0.02261 seconds