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 » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl: GPF when thread Add(), PopUpEx, and Scroll collide
ArrayCtrl: GPF when thread Add(), PopUpEx, and Scroll collide [message #28556] Tue, 07 September 2010 05:07 Go to previous message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
Hi,

I finally tracked down a bug that has been enbedded in my code since I converted from Windows 7 to Ubuntu 9.10, now Ubuntu 10.04 LTS 64-bit.

The error is intermittent but easy for me to reproduce.

In debug mode, from the log file.
Assertion failed in /home/jeff/upp/uppsrc/CtrlCore/X11Wnd.cpp, line 473
!IsChild() && !IsOpen()

Resource temporarily unavailable

A blank white popup label box remains on the screen, no text, until the program is terminated.

The code is from CtrlCore::X11Wnd.cpp::Ctrl::Create0(Ctrl *owner, bool redirect, bool savebits)

At the assertion around line 470.
ASSERT(!IsChild() && !IsOpen());

I determined that the IsOpen() test is failing.

I was able to fix it, but not sure if its the greatest solution.

The steps to reproduce:
1) Create multithreaded app. An ArrayCtrl is built in the main thread with 14 columns. The number of columns may load the system enough to cause it. A thread is spawned to Add rows and populate in background. GuiLock __ is used.
2) In main, call PopUpEx() to enable popup info.
3) Load enough data to enable scrolling.
4) Begin scrolling rapidly down with the mouse wheel and hovering over cells. Sometimes shifting between columns causes the failure to happen sooner.

Using LLOG, I determined its during the Add() call to ArrayCtrl.

Here's where the popup creation happens successfully:
POPUP: N3Upp12DisplayPopupE : 0x7fffeb7377c0(window 0x0)
Create N3Upp12DisplayPopupE : 0x7fffeb7377c0(window 0x0) [1045, 384] - [1087, 403] : (42, 19)

Note that the POPUP: statement precedes the create command.

Here's where the failure happens:
Invalidate N3Upp12DisplayPopupE : 0x7fffeb7377c0(window 0x66014d5) [0, 0] - [152, 19] : (152, 19)
Create N3Upp12DisplayPopupE : 0x7fffeb7377c0(window 0x66014d5) [667, 579] - [819, 598] : (152, 19)

The window exists already since it is invalidated, and the the Create statement crashes because it already exists.

My solution was to add a Close() call if it was Open:
void Ctrl::Create0(Ctrl *owner, bool redirect, bool savebits)
{
	GuiLock __;
	ASSERT(IsMainThread());
	LLOG("Create " << Name() << " " << GetRect());
	if (IsChild()) 
	    LLOG("Ctrl::Create0 IsChild = True");
	if (IsOpen()) {
		LLOG("Ctrl::Create0 IsOpen = True");
		Close(); // HACK
	}
	ASSERT(!IsChild() && !IsOpen());



Ubuntu: 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
U++: 2667-lucid-amd64-nogtk (64 bit)
gcc: (Ubuntu 4.4.3-4ubuntu5) 4.4.3

I will try to dummy up a sample. Hopefully I can get a fix applied to the code since I get automatic upgrades.

Note: Fails on GTK version, too.


cd7651feeb698f6ac6cec1f6deda5e5b

[Updated on: Tue, 07 September 2010 05:15]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl: set column to be insentive to any action
Next Topic: Copy and paste for ArrayCtrl
Goto Forum:
  


Current Time: Thu Apr 25 15:03:05 CEST 2024

Total time taken to generate the page: 0.02857 seconds