Bugs item #1440331, was opened at 2006-02-28 14:35
Message generated for change (Comment added) made by lebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1440331&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Motif
Group: None
Status: Closed
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Attempt to copy to unlocked clipboard

Initial Comment:
I have been using NEdit or many years now. Recently I
upgraded to new hardware (and Linux distribution)

I try to use NEdit on Ubuntu Dapper Drake Beta (AMX64
version). I cannot perform copy/paste operations due to
the following error message: 

"Attempt to copy to unlocked clipboard!"

Note: version of NEdit provides the following information:

NEdit 5.5
Sep 30, 2004

     Built on: Linux, x86-64, GNU C
     Built at: Oct  8 2005, 20:15:23
   With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1
Release 0.93.94] (UNTESTED)
Running Motif: 2.1 [unknown]
       Server: The X.Org Foundation 70000000
       Visual: 24-bit TrueColor (ID 0x21, Default)
       Locale: en_US.UTF-8


Any valuable suggestions?

Bas Leeflang 

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2007-12-03 18:58

Message:
Logged In: YES 
user_id=122956
Originator: NO

Thank you very much for your valuable input.

You can try to find someone do you can pay to fix this bug. At least you
have payed M$ to get a functional system.

Regards

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2007-12-03 16:42

Message:
Logged In: NO 

Did even anyone of you guys consider the fact that free software MAY suck
and this MAY be a proof for it?

OMG I have to use this Linux bullshit at work... ok, Windows has problems,
of course... but Microsoft is DEFINETLY not too stupid to implement
Copy&Paste... 

----------------------------------------------------------------------

Comment By: Joerg Fischer (jf505)
Date: 2007-09-05 22:28

Message:
Logged In: YES 
user_id=918104
Originator: NO

Sorry, forgot to login last time.

> does nedit configure do a check and complain,

Yes, sort of.  There is a short routine in the file check_lin_tif.c
checking the Motif version and warning if things won't work out (although
compiling would show no warnings or problems whatsoever - the problems come
while running).


----------------------------------------------------------------------

Comment By: Hans de Goede (jwrdegoede)
Date: 2007-09-05 20:14

Message:
Logged In: YES 
user_id=922849
Originator: NO

> Anyway, what we really would need is a new Lesstif release fixing all
the
> nasty bugs in there.  Is Danny, the Lesstif maintainer informed about
your
> fixes, Hans?

He wasn't, because I'm very busy with other stuff, but I just mailed him
suggesting to start working on a new 0.95.1 release.

> If we would have a 0.96.0 release with your fixes we could test it
(nedit
> is a good test suite for Motif) and add it to the known good list of
> nedit's Motif checker - so far, I think folks almost have to go back to
> something like 0.93.18 or so to compile w/o warnings ...

What dou you mean without warnings, does nedit configure do a check and
complain, or do you mean compiler warnings? Also are there any other nedit
issues with 0.95.0 ? I'm aware of the uppercase lowercase hotkey issue, and
have fixed that.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-05 17:24

Message:
Logged In: NO 

> It would be very helpful to Nedit fans who are making the transition to
x86_64 if a 64-bit executable, statically linked against OpenMotif 2.2

Sure, just create it and commit it.  AFAIK, the 2.2 libs and the 2.3 libs
are claimed to be binary compatible.  So, one can get the whole 2.2.4
sources, build them on one's system and replace the 2.3 installation with
it.  I've done so on SUSE 10.2 because of

http://www.nedit.org/pipermail/develop/2007-August/013455.html

and it works fine, but I still have only 32bit machine.

> (if such a thing is legal -- I don't speak License-talk).

It is absolutely legal.  For Linux the OpenMotif license is just equal to
the IBM Public license.  (But The Open Group restricts this license to
certain operating systems, which they call 'open source'.  This restriction
is against Freedom #0 making the OM license unacceptable.  What NEdit is
concerned, it allows linking to Motif libs, because it runs on many
operating systems - recall Freedom #0 -, and on many Unix systems there are
Motif libs pre-installed, so folks get the NEdit sources and compile.  IMO
things would be turned somehow upside down if we would be against this.  As
side-effect NEdit allows also to link with OpenMotif on Linux or wherever
one is allowed to use these libs.)

Anyway, what we really would need is a new Lesstif release fixing all the
nasty bugs in there.  Is Danny, the Lesstif maintainer informed about your
fixes, Hans?

If we would have a 0.96.0 release with your fixes we could test it (nedit
is a good test suite for Motif) and add it to the known good list of
nedit's Motif checker - so far, I think folks almost have to go back to
something like 0.93.18 or so to compile w/o warnings ...

----------------------------------------------------------------------

Comment By: Carlo Graziani (carlo_graziani)
Date: 2007-09-04 19:10

Message:
Logged In: YES 
user_id=1882865
Originator: NO

Note that a divergence is now opening.  Distributions that do ship with
OpenMotif are now starting to distribute v2.3, rather than 2.2, and while
2.2 compatibility libraries are available, the headers are only available
for 2.3.  So "Just compile with openmotif" is not really an option on (for
example) RHEL5/CentOS5.  I tried this (compile with the new headers), and
got a working executable, but copy/paste from/to other applications was
very flaky.

The OpenMotif/Lesstif License/BugHunt issues seem hard, and will probably
take a while to close out.  In the meantime, x86_64 is here, and overtaking
x386.  It would be very helpful to Nedit fans who are making the transition
to x86_64 if a 64-bit executable, statically linked against OpenMotif 2.2,
were made available at the binaries page (if such a thing is legal -- I
don't speak License-talk).

----------------------------------------------------------------------

Comment By: Hans de Goede (jwrdegoede)
Date: 2007-09-04 16:13

Message:
Logged In: YES 
user_id=922849
Originator: NO

Yes all lesstif versions published have this 64 bit bug, which my attached
patch fixed. Notice that I'm the Fedora maintainer of lesstif and I'm
sitting on a pile of patches fixing many lesstif issues, this patch is just
one of them. lesstif really needs to be resurrected by the distros which
truely care about freedom and thus have rejected openmotif (Fedora,
Debian).


----------------------------------------------------------------------

Comment By: Scott Tringali (tringali)
Date: 2007-09-04 16:00

Message:
Logged In: YES 
user_id=11321
Originator: NO

0.93.94 is marked known-bad for x86-64 in NEdit.  Is it the case that all
lessTif versions built for 64-bit have this bug?

----------------------------------------------------------------------

Comment By: Hans de Goede (jwrdegoede)
Date: 2007-08-31 00:52

Message:
Logged In: YES 
user_id=922849
Originator: NO

Hi,

Short intro I'm a Fedora developer and I have lately been working on
fixing some lesstif bugs, including this one. This actually isn't a generic
lesstif bug, but a nasty lesstif 64 bit cleanness bug. This patch fixes
(and hopefully explains) it, enjoy! :

diff -up lesstif-0.95.0/lib/Xm-2.1/CutPaste.c.cutpaste64
lesstif-0.95.0/lib/Xm-2.1/CutPaste.c
--- lesstif-0.95.0/lib/Xm-2.1/CutPaste.c.cutpaste64     2004-08-28
21:22:43.000000000 +0200
+++ lesstif-0.95.0/lib/Xm-2.1/CutPaste.c        2007-08-31 00:19:09.000000000
+0200
@@ -606,7 +606,16 @@ _XmClipboardGetWindowProperty(Display *d
 
        ret_buf = (unsigned *)XtRealloc((char *)ret_buf,
                                        alloc_size + alloc_incr + 1);
-       memcpy(&ret_buf[offset], prop, alloc_incr);
+        if (actual_format == 32 && sizeof(long) != 4)
+        {
+            int i;
+            unsigned long *in = (unsigned long *)prop;
+            
+            for (i = 0; i < nitems; i++)
+                ret_buf[offset + i] = in[i];
+        }
+        else
+           memcpy(&ret_buf[offset], prop, alloc_incr);
        alloc_size += alloc_incr;
 
        switch (actual_format)
@@ -1001,8 +1012,9 @@ _XmClipboardReplaceItem(Display *display
 {
     Window root;
     Atom item;
-    int nunits, tstart, tlen;
+    int i, nunits, tstart, tlen;
     long transferlen;
+    long *convert_buf = NULL;
 
     root = DefaultRootWindow(display);
     item = _XmClipboardGetAtomFromId(display, id);
@@ -1014,6 +1026,12 @@ _XmClipboardReplaceItem(Display *display
     case 32:
        len >>= 2;
        nunits = transferlen;
+       /* XChangeProperty expects a buffer of longs when receiving 32 bits
+          data, MEUHH */
+       if (sizeof(long) != 4)
+           convert_buf = XtMalloc(len * sizeof(long));
+        for (i = 0; i < len; i++)
+            convert_buf[i] = data[i];
        break;
 
     case 16:
@@ -1040,7 +1058,9 @@ _XmClipboardReplaceItem(Display *display
        }
 
        XChangeProperty(display, root, item, item, format, mode,
-                       (unsigned char *)&data[tstart], tlen);
+                       convert_buf? (unsigned char *)&convert_buf[tstart] :
+                                     (unsigned char *)&data[tstart],
+                        tlen);
 
        len -= tlen;
        mode = PropModeAppend;


----------------------------------------------------------------------

Comment By: Joerg Fischer (jf505)
Date: 2007-06-05 23:00

Message:
Logged In: YES 
user_id=918104
Originator: NO

>Is there any other way to get this to work. This is killing me, and
>just closing the bug with "oh...lesstif's problem" doesn't help.

We can't fix lesstif.  There are however ways to get a around the
problem:

- Try Motif (ok, this isn't open source, but nedit allows to link to it,
cf. the license)

- define your own extra clipboards inside nedit, see the ManyClipboards
macros on http://www.nedit.org/niki/index.php/Macro%20Collection


----------------------------------------------------------------------

Comment By: George T. Talbot (gtalbot)
Date: 2007-06-05 21:45

Message:
Logged In: YES 
user_id=1791035
Originator: NO

This bug is brutal for x86_64 systems, particularly Fedora Core 6, as
nedit.org doesn't have a pre-built binary that will run on FC6 x86_64.  Is
there any other way to get this to work.  This is killing me, and just
closing the bug with "oh...lesstif's problem" doesn't help.

----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2007-05-27 08:24

Message:
Logged In: YES 
user_id=119143
Originator: NO

Ok, this has reports of numerous problems in the messages, but the main
item seems to be a Lesstif bug.

So I'll close this, please report any new problems in new bug reports.

----------------------------------------------------------------------

Comment By: Jason Kraftcheck (kraftcheck)
Date: 2007-04-05 18:39

Message:
Logged In: YES 
user_id=665142
Originator: NO

I tried again to produce the copy/paste bug using OpenMotif with an AMD64
build and copy/paste seemed to work fine.  So I was mistaken (as mentioned
by lebert.)  This does appear to be a Lesstif bug.  The only thing that has
changed on my system since my previous comment is that I am now using Xfce
rather than KDE.  So perhaps there is also some kind of bug when
interacting with KDE.


----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2007-03-21 09:23

Message:
Logged In: YES 
user_id=122956
Originator: NO

I can definitely not confirm the statement from kraftcheck. I have build
booth OpenMotif 2.2.3 and NEdit from source on amd64 since nearly 3 years
without having these problems. And I just checked again with Licq and
gedit.

NEdit release of Jan 31, 2007

     Built on: Linux, x86-64, GNU C
     Built at: Feb  3 2007, 11:20:17
   With Motif: 2.2.3 [@(#)Motif Version 2.2.3]
Running Motif: 2.2 [unknown]
       Server: The XFree86 Project, Inc 40399902
       Visual: 24-bit TrueColor (ID 0x21, Default)
       Locale: en_US.UTF-8



----------------------------------------------------------------------

Comment By: Jason Kraftcheck (kraftcheck)
Date: 2007-03-20 18:48

Message:
Logged In: YES 
user_id=665142
Originator: NO

This does not appear to be (entirely) a Lesstif problem.  I build
OpenMotif 2.2.3 from source as AMD64 and then compiled nedit 5.5 as AMD64
using that OpenMotif library.  I no longer see the "Attempt to copy to
unlocked clipboard" message, but the copy/paste still fails.  I can
copy/paste between other applications (tried between Gnome- and KDE-based
text editors.)  However, copy from other apps to Nedit doesn't work (no
text inserted) and copy from Nedit doesn't seem to change the clipboard
(subsequent paste in Nedit does nothing and paste in other applications is
the text previously copied from a non-Nedit app.)

So Nedit and/or both Motif implementations are broken for AMD64.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2006-11-01 22:17

Message:
Logged In: NO 

I've worked around this on Fedora Core 6 (x86-64) by copying
files from my Fedora Core 5 installation.

In /usr/bin I copied nedit and nedit-client.

In /usr/lib64 I copied libXm.so.4 because the "older" (nedit
is v5.5 in both cases) executable from Fedora Core 5 didn't
like libXm.so.2 that is installed with Fedora Core 6.

HTH

----------------------------------------------------------------------

Comment By: Glen Stewart (glenstewart)
Date: 2006-09-04 16:32

Message:
Logged In: YES 
user_id=81772

> Does the pre-compiled binary on our website work any better?

Yes, it does not give the "Attempt to copy to unlocked
clipboard!" error.  However, it doesn't fix the other
problem I'm seeing on Kubuntu Dapper 6.06 with URL's copied
from Firefox not always pasting into Nedit.  I think there
may be an interaction problem between Firefox, Klipper, and
Nedit.

I am also on AMD64.

----------------------------------------------------------------------

Comment By: John Clarke (jrclarke)
Date: 2006-08-21 10:01

Message:
Logged In: YES 
user_id=859594

yooden: New bug raised as requested.  The bug id is 1543796.

nobody: Thanks, but I do know why "locale not supported" is
shown :-/

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2006-08-18 16:00

Message:
Logged In: NO 

The message "UTF8 locale not supported" is shown because
you've told NEdit you want to use UTF8 (e.g., by selecting
it in your login session) but it can't do that.  It's trying
to avoid a crash in Motif.

But, it looks like there's another one for us to fix!


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-08-18 08:10

Message:
Logged In: YES 
user_id=119143

I think that warrant a new bug report, NEDit should not
crash on something in the environment. (And probably
doesn't, but the tool kit shouldn't crush either.)

Would you mind entering that once again into a new bug report?

----------------------------------------------------------------------

Comment By: John Clarke (jrclarke)
Date: 2006-08-18 07:59

Message:
Logged In: YES 
user_id=859594

I didn't test that at the time, but I've just done so on
ubuntu dapper (using the binary from nedit.org), and yes, it
crashes with LANG=en_AU.UTF-8 when I press Ctrl-O.  If I
unset LANG, it works fine.

With the binary I built on dapper (using openmotif), it
doesn't crash but instead gives weird results.  Ctrl-O opens
the dialog, but any attempt to open a file gives the error
"Please select a file to open", and any attempt to change
directotry returns me to the directory from which nedit was
run, not the directory containing the file that's currently
open.  Unsetting LANG also fixes this.


----------------------------------------------------------------------

Comment By: Thorsten Haude (yooden)
Date: 2006-08-18 07:32

Message:
Logged In: YES 
user_id=119143

Sounds like this one could be closed.

One more question: You report of a crash in the other
tracker; was this crash avoided by unsetting $LANG? Normally
NEdit should be able to catch this.

----------------------------------------------------------------------

Comment By: John Clarke (jrclarke)
Date: 2006-08-18 05:51

Message:
Logged In: YES 
user_id=859594

I've had many problems with nedit & lesstif on ubuntu
(hoary, breezy and dapper), most of which disappear when
built with openmotif.

Here's the bug report:

https://launchpad.net/distros/ubuntu/+source/nedit/+bug/1027

The only remaining problem I'm having is "UTF8 locale not
supported", which is easily fixed by:

    alias nedit="unset LANG; nedit"

You can download the package I built from:

   
http://kirriwa.net/john/software/nedit/nedit-dmotif_5.5-1ubuntu1_i386.deb

----------------------------------------------------------------------

Comment By: Joerg Fischer (jf505)
Date: 2006-05-30 23:30

Message:
Logged In: YES 
user_id=918104

>I'm having the same problem here ...

Since you're running an nedit binary using lesstif, you
*must* have the same problem regardless of the operating
system you use. This is no news.

> what is really weird, ...

There is nothing weird, because the middle mouse button has
nothing to do with the X clipboard. And if the clipboard is
locked, ctrl+x will merely delete the selection, but won't
bring the selection into the clipboard.

The point is that nedit uses the functions provided by a
toolkit to access the clipboard. This toolkit is called
(Open) Motif. Lesstif is a Motif clone, and there is some
problem in the clipboard handling functions provided by
lesstif resulting in a locked clipboard. 

It is normal that the clipboard gets temporarily locked, if
the clipboard is accessed to avoid interferences when to
programs would try to access the clipboard simultaneously.
But the clipboard should be unlocked, once the program has
finished its clipboard access. For whatever reason, the
lesstif functions seem to leave the clipboard locked. 

If you believe I'm writing nonsense, you can download a
binary from nedit.org and test it. These binaries use the
(real) Motif functions.


----------------------------------------------------------------------

Comment By: seddah (zehavoc)
Date: 2006-05-30 18:24

Message:
Logged In: YES 
user_id=195489

I'm having the same problem here, running nedit -version
NEdit 5.5
Sep 30, 2004

     Built on: Linux, x86-64, GNU C
     Built at: Aug 17 2005, 04:46:31
   With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1 Release 0.93.94] 
(UNTESTED)
Running Motif: 2.1 [unknown]
       Server: The XFree86 Project, Inc 40300000
       Visual: 24-bit TrueColor (ID 0x22, Default)
       Locale: en_IE



what is really weird, is that ctrl+X works but not Crtrl+V
and the copy from the middle button mouse work from one windows instance 
to another, it's really weird...



----------------------------------------------------------------------

Comment By: Scott Tringali (tringali)
Date: 2006-05-08 16:05

Message:
Logged In: YES 
user_id=11321

I run the linux 32-bit binary on AMD64 systems all the time.

The errors you see are problably because you're running
under a locale that Motif doesn't support, and no binary
recompilation will fix that.

Try running "setenv LANG C" before running nedit and see if
it helps.



----------------------------------------------------------------------

Comment By: Joerg Fischer (jf505)
Date: 2006-05-08 10:42

Message:
Logged In: YES 
user_id=918104

> Same bug here. Both with Debian supplied binary, and with
> binary compiled from nedit.org source. Note the different
> versions of LessTif.

This is a bug in lesstif, and was never fixed, so it doesn't
matter what lesstif versions you try. There are some 
workarounds in nedit for lesstif bugs, but this one can't 
be worked around from inside nedit, afaik.

Since you can compile from sources, the only solution to get
a working binary is to use openmotif 2.2.3, which I guess is
provided by debian, too.  Simply install openmotif, compile
nedit with it, for example statically linked, then you can
uninstall openmotif again and be happy. (If you prefer a
dynamically linked binary, you need the openmotif libs 
later on, of course.) Oh, and make sure that lesstif and
openmotif libs and headers don't get mixed up.

----------------------------------------------------------------------

Comment By: paulberg (paulberg)
Date: 2006-05-07 22:01

Message:
Logged In: YES 
user_id=1454943

32-bit binaries don't run on amd64 natively. Debian provides
emulation libraries, but they don't always work.
A very short test with nedit-5.5-Linux-x86/nedit from
nedit.org gave these errors:

locale not supported by C library, locale unchanged
locale not supported by Xlib, locale set to C
X locale modifiers not supported, using default
Locale not supported for XmbTextListToTextProperty
Cannot convert XmString to compound text

If nedit wants to be available on all mayor unix and linux
systems, it should support linux-amd64.


----------------------------------------------------------------------

Comment By: TK Soh (tksoh)
Date: 2006-05-07 20:57

Message:
Logged In: YES 
user_id=411637

Do you really need the 64-bit binary? I thought linux-amd64
provide 32-bit compatibility to older apps. What happen if
you run the official [32-bit] binary on linux-amd64?

----------------------------------------------------------------------

Comment By: paulberg (paulberg)
Date: 2006-05-07 19:58

Message:
Logged In: YES 
user_id=1454943

> Once again, can you try the official binary 

nedit.org does not provide binaries for linux-amd64,
so I really can not try.

----------------------------------------------------------------------

Comment By: TK Soh (tksoh)
Date: 2006-05-07 16:58

Message:
Logged In: YES 
user_id=411637

Once again, can you try the official binary to see if you
still get the error. We would like to confirm if Lesstif may
be the cause of it. You can find the binaries here:

  http://www.nedit.org/ftp/v5_5/executables/

The Linux binaries are statically linked to OpenMotif, so
you shuold be able to run it right out the box.

----------------------------------------------------------------------

Comment By: paulberg (paulberg)
Date: 2006-05-06 21:49

Message:
Logged In: YES 
user_id=1454943

Same bug here. Both with Debian supplied binary, and with
binary compiled from nedit.org source. Note the different
versions of LessTif.

Debian:
     Built on: Linux, x86-64, GNU C
     Built at: Feb 20 2006, 05:03:59
   With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1 Release
0.94.4]
Running Motif: 2.1 [unknown]
       Server: The X.Org Foundation 60900000
       Visual: 24-bit TrueColor (ID 0x21, Default)
       Locale: en_US.UTF-8


own compilation:
     Built on: Linux, x86-64, GNU C
     Built at: May  6 2006, 20:58:14
   With Motif: 1.2.0 [@(#)GNU/LessTif Version 1.2 Release
0.93.94]
Running Motif: 1.2 [unknown]
       Server: The X.Org Foundation 60900000
       Visual: 24-bit TrueColor (ID 0x21, Default)
       Locale: en_US.UTF-8

Paul van den Berg

----------------------------------------------------------------------

Comment By: Eddy De Greef (edg)
Date: 2006-03-17 15:36

Message:
Logged In: YES 
user_id=73597

Most likely, this is a Lesstif problem.
Does the pre-compiled binary on our website work any better?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1440331&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to