GNOME Bugzilla – Bug 625510
When copying from a Tomboy and pasting anywhere else, Tomboy crashes
Last modified: 2010-08-10 13:36:21 UTC
When I copy the text from Tom Boy using either "ctrl c" or right clicking and saying copy/paste, Tom Boy closes. It happens every single time. I am running Windows 7 Pro with Gtk 2.12
Please do the following: Hit Win+R ("Run") and start "cmd.exe". Execute the commands below, after (and excluding) the "->" Change to the right directory: -> cd %PROGRAMFILES%\Tomboy Run Tomboy with --debug from the right folder -> Tomboy.exe --debug Afterwards you can select the text in the cmd.exe window. Depending on your settings that might just work or need you to click on the upper left black icon, choosing "Edit" -> "Mark". After selecting the text press enter once (unfortunate, but that's the way to copy it to the clipboard) and paste the text into notepad or this issue (if it's long, better save a file and attach that probably).
Created attachment 167025 [details] Tomboy exe run with debug Tomboy exe run with debug as requested.
Created attachment 167039 [details] Tomboy.exe resources according to Reflector Just confirmed that both the stable (1.2) and unstable (1.3) version of Tomboy seem to lack the resource "C:\Projects\Private\Tomboy\Tomboy\". It seems the resource is included in the Makefiles (Tomboy/Makefile.am:155), but the paths in the debug log suggest that Sandy is creating the windows releases on a Windows Vista/Windows 7 machine, using Visual Studio to create the WiX based MSI. The Visual Studio solution doesn't seem to contain a reference to the xsl resource and handles the resources in a strange way (with a prebuild event). I'll prepare a patch for the Tomboy.csproj right away.
Yeah, unable to copy a simple name.. The missing resource is of course "tomboy-note-clipboard-html.xsl". Sorry for the noise.
Created attachment 167042 [details] [review] Simple patch adding the missing xsl resource to the msbuild process This is the trivial patch to include the missing file into the existing build script. Another (imho preferable) alternative is coming up in a minute, changing some more .csproj related oddities.
Created attachment 167043 [details] [review] Patch to add the missing resource and clean up the msbuild process More elaborate patch that obviously first of all includes the missing file as well. It goes beyond though and changes the way the resources are referenced: For now, every resource is pointing to $(ProjectDir)/Somefile, but those files don't exist. That leads to nasty looking yellow warnings (missing resources) in Visual Studio when the project is opened the first time. A (magical..) pre-build script copies these files in place just before the compiler would complain. Happens only once per clone, but an awkward first impression and unncessary. The new proposed way includes the files from the right place. This adds the containing folders to Visual Studio's Solution Explorer, but that could be disabled as well (Visible="false" for the EmbeddedResource entries). In addition the invocations of mkdir and copy to deploy necessary binaries like Mono.PosixHelper and the theme icons are replaced with msbuild internal tasks. This way the .csproj could be build elsewhere (Hi, xbuild) as well, without relying on "copy" being a valid command. Icons, previously copied one by one, are now harvested by name and distributed to the right target directory automatically.
Benjamin, these fixes look great. I just need a chance to test on my windows VM before pushing. Thanks for the love!
Great, looking forward to it. As far as I understand this bug, this basically crashes both stable and unstable Tomboy on every note serialization (like, copy and paste), if Gtk >= 2.12 is installed (due to the guard in NoteBuffer.cs:60 it should be fine with previous versions, albeit without supporting formatted copy&paste). So I guess this is a critical thing for the Windows builds. Any plans to create an interim fixed build for the original poster? Ping me if I can help you with that.
(In reply to comment #8) > Great, looking forward to it. > > As far as I understand this bug, this basically crashes both stable and > unstable Tomboy on every note serialization (like, copy and paste), if Gtk >= > 2.12 is installed (due to the guard in NoteBuffer.cs:60 it should be fine with > previous versions, albeit without supporting formatted copy&paste). The guard you mention shouldn't care what version of gtk you have *on Windows*, because that DEFINE is only set in the makefiles for Linux builds. > So I guess this is a critical thing for the Windows builds. Any plans to create > an interim fixed build for the original poster? > > Ping me if I can help you with that. Nope, go for it. More testers is always great.
(In reply to comment #9) > (In reply to comment #8) > > Great, looking forward to it. > > > > As far as I understand this bug, this basically crashes both stable and > > unstable Tomboy on every note serialization (like, copy and paste), if Gtk >= > > 2.12 is installed (due to the guard in NoteBuffer.cs:60 it should be fine with > > previous versions, albeit without supporting formatted copy&paste). > > The guard you mention shouldn't care what version of gtk you have *on Windows*, > because that DEFINE is only set in the makefiles for Linux builds. I don't get it: NoteBuffer.cs:54 is always defined and only relies on reflection: private static bool text_buffer_serialize_func_fixed = typeof(Gtk.TextBufferSerializeFunc).GetMethod ("Invoke").ReturnType == typeof(byte[]); NoteBuffer.cs:59ff and the constructor seems to always use this method to determine if the html support should be registered: // Ensure Gtk# has the fix for BNC #555495 if (text_buffer_serialize_func_fixed) { RegisterSerializeFormat ("text/html", (Gtk.TextBufferSerializeFunc) Delegate.CreateDelegate (typeof(Gtk.TextBufferSerializeFunc), this, "SerializeToHtml")); } SerializeToHtml later references the xsl based transformation and dies if the resource is missing. > > So I guess this is a critical thing for the Windows builds. Any plans to create > > an interim fixed build for the original poster? > > > > Ping me if I can help you with that. > > Nope, go for it. More testers is always great. Maybe this is a misunderstanding: I meant, do you plan a new release soon(ish) for people like the OP? And if you do, do you need help there? Not sure about the testers reference, I tested this one before (although only on one machine, this work laptop). Or did you mean "Go ahead and create an unofficial build for the OP"?
(In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #8) > > > Great, looking forward to it. > > > > > > As far as I understand this bug, this basically crashes both stable and > > > unstable Tomboy on every note serialization (like, copy and paste), if Gtk >= > > > 2.12 is installed (due to the guard in NoteBuffer.cs:60 it should be fine with > > > previous versions, albeit without supporting formatted copy&paste). > > > > The guard you mention shouldn't care what version of gtk you have *on Windows*, > > because that DEFINE is only set in the makefiles for Linux builds. > > I don't get it: > > NoteBuffer.cs:54 is always defined and only relies on reflection: You're right. Next time i'll actually look at the code before opening my mouth. :-P That being said, I have no idea if any of that stuff actually works in Windows. > Maybe this is a misunderstanding: I meant, do you plan a new release soon(ish) > for people like the OP? And if you do, do you need help there? According to the GNOME release schedule, our latest unstable release was due yesterday. But I was too busy to do a release. Yes, I could use all sorts of help with releases. It would be great to have a few people who knew how to release Tomboy so that if I am busy, I can send an email out asking somebody else to handle this one. Failing that, it would be great to have somebody do the windows installers for each release, or the Mac packages, or update the website, etc. The next scheduled release is August 16th. See http://live.gnome.org/TwoPointThirtyone > Not sure about the testers reference, I tested this one before (although only > on one machine, this work laptop). Or did you mean "Go ahead and create an > unofficial build for the OP"? That's what I meant. And if he said "yay it works now" it would make it an easier decision to push even if I don't get time to test it myself soon.
Comment on attachment 167043 [details] [review] Patch to add the missing resource and clean up the msbuild process Nice idea, bad implementation: This build script creates wrong icon names in the theme folders. A fixed version is on my machine, after some more (..) tests this time I'll prepare a MSI (probably tonight). Shane, I'd appreciated your feedback afterwards, if possible.
Looking forward to it!
Depending on you feeling like experimenting: http://ben.sh/Tomboy.msi Disclaimer: I tested the build on my machine. It works without crashing and burning. I didn't test the MSI yet (but it's unchanged, so I guess it should work), heading out for some hours and just wanted to share if you are interested. In other words: I'll do more exhaustive tests later today. You can wait or grab the MSI from above. Changes: Not much, really. I didn't backport the fix to the 1.3.2 point of release, because all changes afterwards are imo uncritical (or translations). Your bug should be solved by including the missing resource (but maybe you'll run into problems afterwards, see Sandy above: It seems the formatted copy/paste stuff is not tested much on Windows). Bottomline: It didn't eat my notes and didn't crash for me. Hope it doesn't any of that for you. If you're a careful person, backup/sync your notes first and then uninstall the old version/install the version above. Will continue with tests or look at feedback later.
Created attachment 167112 [details] [review] Patch to add the missing resource and clean up the msbuild process This patch adds the resource and cleans up the build process as described previously (except for the improvement to icon handling, that didn't work out). The resulting version works fine for me, I'm running the MSI linked in the note yesterday. The problem? I couldn't reproduce the error even with the resource missing. The serialization handler is registered on my machine but I never experienced a crash with older versions and break points in the code are never reached. For now I guess that maybe a) I run a different version of gtk(-sharp) than the OP? b) UAC on Windows7 might interfere and the OP runs a different level/turned it off? Shane, would be glad if you could give the MSI a try on your machine and update this bug.
Tested it several times, cutting and pasting into various other apps. Works great! Thanks so much. I do not use Windows a lot, but when I do it's nice to have the stuff I am used to in Gnome. Tomboy is in my top 5 must have's. Thanks for the response and working so quickly on the fix. Much appreciated. Slipping in a subliminal request for Tomboy on Android. :-)
Great, thanks for testing it. So I just need Sandy's approval to send this to git.. :) Tomboy, Android -> https://launchpad.net/tomdroid
Shane, since you probably still follow this: Can you tell me - if you disabled UAC (or have any non-standard Windows settings)? - if you are able to copy and paste _formatted_ content (i.e. are lists preserved, are fontstyles like bold/italic kept)? Since this doesn't work on my machine and I'm trying to look into bug 624002 as well (seems to not work for that reporter either). Thanks for your help.
Hi, I have not disable UAC, this is a pretty vanilla install of Win7. I thought about mentioning that formatted text did not work, in fact in gmail the text gets really messed up. My company uses gmail as our email provider so I often send updates to the dev team that I keep in Tomboy Notes. No bueno on the formatting. I did not mention it because the copy/paste no longer crashed the windows and that was the purpose of opening the bug. I have attached what things look like on my end when pasting into a gmail, which could be just Google and their rich text. Let me know if there is anything else I can do. -Shane
Created attachment 167261 [details] Screen capture of copy paste into gmail Screen capture of copy paste into Gmail.
Err.. Interesting. I understand you correct: The asian characters in the mail are the paste output of your small (selected) note on the right? The point is, for you the format is indeed different (albeit garbled). For everyone else it seems to be just plain. The other bug complains about people seeing the note as is. Creating the same note here and pasting it results in this: --- 10.1.6.20 gibson 10.1.6.21 larrivee 10.1.6.22 taylor svnlog verbose ProxyPass & SSL svnadmin verify --- which would be an improvement for you but sucks for people that added a bullet list, made text bold etc. And for me, because I cannot figure out - why the serialization to a rich format (text/html) isn't triggered for some/most people - why, if the serialization kicks in, the result is crap (for you) Would be great if you could head over to bug 624002 and help me find out what's different on your system. Can you share the %PATH% (cmd.exe, echo %PATH%) over there? Anything special that you installed? Another Gtk/Gtk# app maybe? Again, help in that other bug would be greatly appreciated, since you're one step ahead of me.
Created attachment 167324 [details] [review] Patch to add the missing resource and clean up the msbuild process Cleaned up the patch to remove trailing whitespace errors (improving my git foo). Changed the Setup project to included three missing files (worked before, because I built it once before and the pre-build task copied some files in place). This now works on a pristine master. On a sidenote: I was able to reproduce the issue with the asian (chinese?) characters in GMail, so I hope I can investigate that.
Created attachment 167325 [details] [review] Supports text/html copy and paste on Windows Changing the encoding to Unicode lets Windows happily use the correct content. The problem is: Does this work on Linux (and maybe OS X? Did anyone test it there?) as well? Adding the tiny, tiny patch here, since Shane documented the problem in a screenshot already.
Created attachment 167326 [details] Mandatory screenshot Shane, guess that's what you want. I hope we can find a way to sneak this in for the next release, either by changing everything to Unicode (if it works for Linux as well) or by using a conditional. Sandy?
That is what I was looking for, thank you. I will add to bug 624002 when I get into work tomorrow and update with system info.
Comment on attachment 167324 [details] [review] Patch to add the missing resource and clean up the msbuild process Pushed