Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cannot Copy Paste with Clipboard if Data Size greater 32768

 
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed
View previous topic :: View next topic  
Author Message
jaspras



Joined: 13 Sep 2007
Posts: 96
Location: Greece

PostPosted: Mon Jun 07, 2010 2:20 pm    Post subject: Cannot Copy Paste with Clipboard if Data Size greater 32768 Reply with quote

Hi Guys great work!

i am trying to Copy Paste Text Data With the clipboard but it seems that the application crashes if the Data size is greater than 32768 Bytes.

i tryied with AEdit , and Sourcery, Both react the same.. they halt!

Any ideas ?
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Mon Jun 07, 2010 2:31 pm    Post subject: Reply with quote

Thanks for the report. Please enter the details you found.
Back to top
View user's profile Send private message Visit poster's website
jaspras



Joined: 13 Sep 2007
Posts: 96
Location: Greece

PostPosted: Mon Jun 07, 2010 3:05 pm    Post subject: Reply with quote

When Trying to copy Text data from sourcery or AEdit or any other program that can handle Text data and uses the os::Clipboard for the data exchange, if the data size is greater than 32768 bytes then the program halts !

i have tried to see what is wrong and added some dbprintf in Message::GetData and it seems that this function cannot locate the next data chunk
Back to top
View user's profile Send private message
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Mon Jun 07, 2010 7:21 pm    Post subject: Reply with quote

This is a known problem, IIRC. (Though it mightn't be covered on the forums). Thanks for investigating. Does the app crash when you try to copy the large data, or when you try to paste it? Is there a stack trace in the kernel log? If you can pin the problem down to a particular method or line of code, please let us know.
Back to top
View user's profile Send private message Visit poster's website
jaspras



Joined: 13 Sep 2007
Posts: 96
Location: Greece

PostPosted: Tue Jun 08, 2010 1:33 am    Post subject: Reply with quote

The app crashed when you Paste the Data, there is no trace of any kind !
Back to top
View user's profile Send private message
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Tue Jun 08, 2010 4:22 am    Post subject: Reply with quote

Since it crashes when you paste data, it is probably occurring when the message is reassembled from the flattened data (Message::Unflatten()). I'd guess that the low-level message ports just discard any data past 32767 bytes, so the app only receives 32767 bytes when it is expecting more. When unflattening, Unflatten() works with the expected size of the data (read from the data stream itself), rather than with the actual data size (as returned by the read message port syscall). Since the expected size is larger than the actual data read, Unflatten() keeps reading past the end of the buffer and we get a segfault.

To fix the crash, Message::Unflatten() should take a size parameter in addition to the buffer pointer, and should fail with an error if the expected data size is smaller than the provided data. When a message is received from a port, we should pass the read data size to Unflatten().

This will fix the crash, but won't make messaging with large data work. To fix the sending of large messages, we should implement messaging via shared memory like we discussed in AltMe.

It's very strange that there is no stack trace at all...
Back to top
View user's profile Send private message Visit poster's website
jaspras



Joined: 13 Sep 2007
Posts: 96
Location: Greece

PostPosted: Tue Jun 08, 2010 4:54 am    Post subject: Reply with quote

[quote]It's very strange that there is no stack trace at all...[/quote]

if you mean to get something in kernel.log then no i dont get anything.
you could always try it .. maybe i am wrong

and yes you are right

Message::Unflatten() is where the bug occurs but did not have time to investigate more..

will do so tonight though... and get back to you..
Back to top
View user's profile Send private message
jaspras



Joined: 13 Sep 2007
Posts: 96
Location: Greece

PostPosted: Tue Jun 08, 2010 12:27 pm    Post subject: Reply with quote

Bahhh, got my syllable crashing from running tests before reading posts on altme by Anthony..!!!
Back to top
View user's profile Send private message
Morph
The Knights of Syllable


Joined: 18 Oct 2007
Posts: 316
Location: Australia

PostPosted: Sun Jun 27, 2010 8:15 pm    Post subject: Reply with quote

Fixed in CVS. Thanks Rui for the initial patch and everyone for the discussion.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Bugs - Fixed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group