bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent drawing optimizations


From: Stefan Urbanek
Subject: Re: Recent drawing optimizations
Date: Tue, 01 Apr 2003 15:02:55 +0200

Hi,

Maybe this information should help ... (i have already posted it to Ludo):

It is too late, i need to sleep.  I was trying to investigate that GNUmail 
crash bug. I have not found the reason, but here are some pointers that may 
help:
- i have put in NSView.m:1569 this line:    NSLog(@"DPSgsave %p", ctxt) (it is 
in lockFocusInRect:) and i got following output:
  many lines with:        (date) GNUMail[842] DPSgsave 0x83b3f50
  and last line with:        (date) GNUMail[856] DPSgsave (null)
note the thread number. this is only place where it is. The update code is 
called in another thread than main thread.
_handleWindowNeedsDisplay: is added to runloop in NSWindow setViewsNeedDisplay:

In NSView:2123 i have added:
NSLog(@"HERE %@", self);
And the output was:
...
  2003-03-30 00:28:44.504 GNUMail[2551] HERE <NSButton: 86b4a08>
  2003-03-30 00:28:44.505 GNUMail[2551] HERE <GSWindowView: 881e4c8>
!!  2003-03-30 00:28:44.521 GNUMail[2562] HERE <NSTableView: 869d318>
!!  2003-03-30 00:28:44.521 GNUMail[2562] HERE <GSWindowView: 86b0970>
  2003-03-30 00:28:44.549 GNUMail[2551] HERE <GSWindowView: 88273b8>
  2003-03-30 00:28:44.610 GNUMail[2551] HERE <NSButton: 86b1f38>
  2003-03-30 00:28:44.611 GNUMail[2551] HERE <NSButton: 86b4a08>
  2003-03-30 00:28:44.612 GNUMail[2551] HERE <ExtendedOutlineView: 85dff90>
  Segmentation fault

After a while after other thread is doing something in NSView it crashes. I am 
not sure, but i think, that events are handled somewhere in another thread, 
where they should not be handled.

Well, this is all i have fonund. I do not have more time to look into it 
deeper, so i am posting it to you in the hope, that you know more about the 
issue.

Best regards,

stefan

On 2003-04-01 14:30:49 +0200 Benhur Stein <benhur@inf.ufsm.br> wrote:

On 2003-04-01 01:13:51 -0300 Adam Fedor <fedor@doc.com> wrote:

Ben,

Do you have an updated patch for this, along the lines of what Alexander 
suggested? Otherwise I can try to whip up something myself.

No, I didn't do a patch.
I'm not sure of what is happening, if it is a problem in GNUMail or in DO
(unearthed because of the latest changes in drawing code).
Here is the message I sent to Ludo, with the call trace of when the wrong 
thread executes setNeedsDisplay.
It is a distributed notification, but I didn't follow the code to see if it is 
the wrong
thread that is executing the notification or if it is the wrong thread that 
registered for the notification or if it is something else entirely.

Anyway, should setNeedsDisplay forward the call to a drawing thread, if called 
from
a non-drawing one?
Maybe as a temporary solution, but what if one day we support multithreaded 
drawing?

Benhur

------------------------forwarded message-----------------
Citando Ludovic Marcotte <ludovic@Sophos.ca>:

Hi Benhur,

Hi, Ludo.

I'm pretty sure I do not call -[NSView setNeedsDisplay] in the sub thread, 
there's _no_ gui related code running in that thread. Every -gui operation is 
sent to the main thread using a NSConnection object.
Here is the call trace of the culprit. :-)
Maybe you can shine a light on what is going on.

It solves the crash but it creates some drawing artifacts. For example, if you 
click on the get button, and you don't move the move, the Get's button icon and 
the rotating logo won't be updated unless you move the mouse when the thread is 
finished.

Yes, the idea was just to see if it was the same problem I was seeing.
I think you are in a better position than me to find out what is going on.
It seems to be a problem in DO or distributed notifications, if it is not
the sub thread that should be executing this code.

Benhur


#0  0x40287213 in break_here ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#1  0x402873c5 in _i_NSWindow__setViewsNeedDisplay_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#2  0x4027a05e in _i_NSView__setNeedsDisplayInRect_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#3  0x4027a02a in _i_NSView__setNeedsDisplayInRect_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#4  0x40279b2f in _i_NSView__setNeedsDisplay_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#5  0x401a2980 in _i_NSControl__updateCell_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#6  0x4014d937 in _i_NSActionCell__setStringValue_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#7  0x401a1e70 in _i_NSControl__setStringValue_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-gui.so.0
#8  0x080ad17b in _i_MailWindowController__updateStatusLabelWithMessage_ ()
#9  0x404b7bbf in _i_NSObject__performSelector_withObject_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#10 0x40492a4f in
_i_NSDistributedNotificationCenter_Private_postNotificationName_object_userInfo_selector_to_
()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#11 0x4053f5a7 in L10 ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#12 0x40510eff in GSFFCallInvokeWithTargetAndImp ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#13 0x40413c9c in callframe_do_call ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#14 0x4046d8d0 in _i_NSConnection_Private__service_forwardForProxy_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#15 0x4046cbdb in _i_NSConnection_Private_handlePortMessage_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#16 0x404bf3fa in _i_GSTcpPort__handlePortMessage_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#17 0x404bbd49 in _i_GSTcpHandle__dispatch ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#18 0x404bcc74 in _i_GSTcpHandle__receivedEvent_type_extra_forMode_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#19 0x404bf94d in _i_GSTcpPort__receivedEvent_type_extra_forMode_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#20 0x404d021e in _i_GSRunLoopCtxt__pollUntil_within_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#21 0x404d2cff in _i_NSRunLoop__acceptInputForMode_beforeDate_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#22 0x404d31d2 in _i_NSRunLoop__runMode_beforeDate_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#23 0x4046f12c in _i_NSConnection_Private__getReplyRmc_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#24 0x4046ac3f in retDecoder ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#25 0x404145b7 in callframe_build_return ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#26 0x4046bf16 in _i_NSConnection_GNUstepExtensions_forwardInvocation_forProxy_
    ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#27 0x4048e58c in _i_NSDistantObject__forwardInvocation_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#28 0x40511f9b in GSInvocationCallback ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#29 0x4053f1c9 in __vacall_r ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#30 0x080ebef8 in _i_TaskManager_Private__transferMessagesFromPOP3Folder_task_
    ()
#31 0x080e86fe in _i_TaskManager_Private__receiveUsingPOP3ForTask_ ()
#32 0x080e773e in _i_TaskManager_Private__nextTask ()
#33 0x404b7bbf in _i_NSObject__performSelector_withObject_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#34 0x404effc2 in _i_NSTimer ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#35 0x080e692c in _i_TaskManager ()
#36 0x4053f5a7 in L10 ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#37 0x40510eff in GSFFCallInvokeWithTargetAndImp ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#38 0x40413c9c in callframe_do_call ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#39 0x4046d8d0 in _i_NSConnection_Private__service_forwardForProxy_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#40 0x4046cbdb in _i_NSConnection_Private_handlePortMessage_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#41 0x404bf3fa in _i_GSTcpPort__handlePortMessage_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#42 0x404bbd49 in _i_GSTcpHandle__dispatch ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#43 0x404bcc74 in _i_GSTcpHandle__receivedEvent_type_extra_forMode_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#44 0x404bf94d in _i_GSTcpPort__receivedEvent_type_extra_forMode_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#45 0x404d021e in _i_GSRunLoopCtxt__pollUntil_within_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#46 0x404d2cff in _i_NSRunLoop__acceptInputForMode_beforeDate_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#47 0x404d31d2 in _i_NSRunLoop__runMode_beforeDate_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#48 0x404d344b in _i_NSRunLoop__runUntilDate_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#49 0x404d3392 in _i_NSRunLoop__run ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#50 0x080e6b79 in _i_TaskManager__run_ ()
#51 0x404b7bbf in _i_NSObject__performSelector_withObject_ ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#52 0x404ee772 in _i_NSThread___sendThreadMethod ()
   from
/usr/local/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-gnu/libgnustep-base.so.1
#53 0x405f2722 in __objc_thread_detach_function ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libobjc.so.1
#54 0x405fe0b0 in pthread_start_thread () from /lib/libpthread.so.0
#55 0x405fe1b2 in pthread_start_thread_event () from /lib/libpthread.so.0



_______________________________________________
Bug-gnustep mailing list
Bug-gnustep@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnustep



--
http://urbanek.host.sk

First they ignore you, then they laugh at you, then they fight you, then you 
win.
- Mahatma Gandhi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]