After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625510 - When copying from a Tomboy and pasting anywhere else, Tomboy crashes
When copying from a Tomboy and pasting anywhere else, Tomboy crashes
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
1.2.x
Other Windows
: Normal critical
: ---
Assigned To: Benjamin Podszun
Tomboy Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-28 16:43 UTC by Shane Eckert
Modified: 2010-08-10 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tomboy exe run with debug (6.25 KB, text/plain)
2010-08-02 23:53 UTC, Shane Eckert
  Details
Tomboy.exe resources according to Reflector (10.20 KB, image/png)
2010-08-03 11:40 UTC, Benjamin Podszun
  Details
Simple patch adding the missing xsl resource to the msbuild process (1.42 KB, patch)
2010-08-03 12:49 UTC, Benjamin Podszun
none Details | Review
Patch to add the missing resource and clean up the msbuild process (17.05 KB, patch)
2010-08-03 13:01 UTC, Benjamin Podszun
needs-work Details | Review
Patch to add the missing resource and clean up the msbuild process (14.69 KB, patch)
2010-08-04 14:05 UTC, Benjamin Podszun
none Details | Review
Screen capture of copy paste into gmail (287.35 KB, image/jpeg)
2010-08-06 16:01 UTC, Shane Eckert
  Details
Patch to add the missing resource and clean up the msbuild process (16.02 KB, patch)
2010-08-07 15:46 UTC, Benjamin Podszun
committed Details | Review
Supports text/html copy and paste on Windows (949 bytes, patch)
2010-08-07 16:32 UTC, Benjamin Podszun
none Details | Review
Mandatory screenshot (82.54 KB, image/png)
2010-08-07 16:35 UTC, Benjamin Podszun
  Details

Description Shane Eckert 2010-07-28 16:43:55 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
Comment 1 André Klapper 2010-08-02 23:41:16 UTC
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).
Comment 2 Shane Eckert 2010-08-02 23:53:19 UTC
Created attachment 167025 [details]
Tomboy exe run with debug

Tomboy exe run with debug as requested.
Comment 3 Benjamin Podszun 2010-08-03 11:40:15 UTC
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.
Comment 4 Benjamin Podszun 2010-08-03 11:42:00 UTC
Yeah, unable to copy a simple name.. The missing resource is of course "tomboy-note-clipboard-html.xsl".

Sorry for the noise.
Comment 5 Benjamin Podszun 2010-08-03 12:49:22 UTC
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.
Comment 6 Benjamin Podszun 2010-08-03 13:01:12 UTC
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.
Comment 7 Sandy Armstrong 2010-08-03 13:20:08 UTC
Benjamin, these fixes look great.  I just need a chance to test on my windows VM before pushing.

Thanks for the love!
Comment 8 Benjamin Podszun 2010-08-03 13:31:51 UTC
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.
Comment 9 Sandy Armstrong 2010-08-03 13:48:43 UTC
(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.
Comment 10 Benjamin Podszun 2010-08-03 13:58:47 UTC
(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"?
Comment 11 Sandy Armstrong 2010-08-03 14:55:47 UTC
(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 12 Benjamin Podszun 2010-08-03 17:47:37 UTC
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.
Comment 13 Shane Eckert 2010-08-03 17:51:12 UTC
Looking forward to it!
Comment 14 Benjamin Podszun 2010-08-03 18:11:28 UTC
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.
Comment 15 Benjamin Podszun 2010-08-04 14:05:31 UTC
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.
Comment 16 Shane Eckert 2010-08-04 17:35:52 UTC
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. :-)
Comment 17 Benjamin Podszun 2010-08-04 17:40:27 UTC
Great, thanks for testing it.
So I just need Sandy's approval to send this to git.. :)

Tomboy, Android -> https://launchpad.net/tomdroid
Comment 18 Benjamin Podszun 2010-08-06 12:09:11 UTC
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.
Comment 19 Shane Eckert 2010-08-06 15:59:51 UTC
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
Comment 20 Shane Eckert 2010-08-06 16:01:39 UTC
Created attachment 167261 [details]
Screen capture of copy paste into gmail

Screen capture of copy paste into Gmail.
Comment 21 Benjamin Podszun 2010-08-06 16:11:02 UTC
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.
Comment 22 Benjamin Podszun 2010-08-07 15:46:15 UTC
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.
Comment 23 Benjamin Podszun 2010-08-07 16:32:31 UTC
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.
Comment 24 Benjamin Podszun 2010-08-07 16:35:42 UTC
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?
Comment 25 Shane Eckert 2010-08-09 06:15:08 UTC
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 26 Benjamin Podszun 2010-08-10 13:36:21 UTC
Comment on attachment 167324 [details] [review]
Patch to add the missing resource and clean up the msbuild process

Pushed