Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

badmatch while create an xmText

9 views
Skip to first unread message

ccc

unread,
Sep 29, 2018, 11:14:42 PM9/29/18
to
Looks like the group is dead, I guess this is what I get for not posting
here for the last 20 years to help keep it going. (LoL :) Still, just in
case...

I'm on Ubuntu 18.04 with Motif 2.3.8 and when I create an XmText widget,
not matter how, I always get:

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 18 (X_ChangeProperty)
Serial number of failed request: 190
Current serial number in output stream: 200

The last 2 lines can vary, but the first 2 (and the important ones)
don't. Going into gdb, I can force it to reveal:

Breakpoint 2, 0x00007ffff6b967a0 in _XError () from /usr/lib/x86_64-linux-
gnu/libX11.so.6
(gdb) bt
#0 0x00007ffff6b967a0 in _XError () from /usr/lib/x86_64-linux-gnu/
libX11.so.6
#1 0x00007ffff6b937eb in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffff6b93895 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#3 0x00007ffff6b947f0 in _XReply () from /usr/lib/x86_64-linux-gnu/
libX11.so.6
#4 0x00007ffff6b7f374 in XInternAtoms () from /usr/lib/x86_64-linux-gnu/
libX11.so.6
#5 0x00007ffff7a23e32 in _XmTextInputCreate () from /usr/lib/x86_64-
linux-gnu/libXm.so.4
#6 0x00007ffff7a17c87 in ?? () from /usr/lib/x86_64-linux-gnu/libXm.so.4
#7 0x00007ffff76c5e27 in ?? () from /usr/lib/x86_64-linux-gnu/libXt.so.6
#8 0x00007ffff76c6798 in ?? () from /usr/lib/x86_64-linux-gnu/libXt.so.6
#9 0x00007ffff76c6be8 in _XtCreateWidget () from /usr/lib/x86_64-linux-
gnu/libXt.so.6
#10 0x00007ffff76c6ecd in XtCreateWidget () from /usr/lib/x86_64-linux-
gnu/libXt.so.6
#11 0x0000555555554a1f in main (argc=1, argv=0x7fffffffe398) at k.c:19

This is with the super simple program of:

#include <stdlib.h>
#include <stdio.h>
#include <Xm/Form.h>
#include <Xm/Text.h>

static String fallback[] = { NULL };

int main(int argc, char *argv[])
{
Widget toplevel, form, t;
XtAppContext app;

toplevel = XtVaAppInitialize(&app, "Test", NULL, 0, &argc, argv,
fallback, NULL);
form = XtVaCreateManagedWidget("form", xmFormWidgetClass, toplevel,
NULL);
mw = XtVaCreateManagedWidget("t", xmTextWidgetClass, form, NULL);

XtRealizeWidget(toplevel);
XtAppMainLoop(app);
}

Before I go chase down the source code to Motif and compile with debug
symbols to see what's getting handed off to XInternAtoms(), has anyone
else seen this or have any ideas on what could be happening?

FWIW, if I change the Text to a TextField, it all works very nicely.

Thanks,
Kevin

ccc

unread,
Sep 30, 2018, 11:48:27 PM9/30/18
to
On Sun, 30 Sep 2018 09:17:32 +0000, Tilmann Hentze wrote:

> ccc <c...@pwhome.com> schrieb:
>> This is with the super simple program of:
>> [...]
>> mw = XtVaCreateManagedWidget("t", xmTextWidgetClass, form, NULL);
> This should probably be t = XtVaCreateWidget [...], since mw is not
> declared beforehand.
>
>> Before I go chase down the source code to Motif and compile with debug
>> symbols to see what's getting handed off to XInternAtoms(), has anyone
>> else seen this or have any ideas on what could be happening?
> It works for me when I compile it with the command line below the next
> line.
> I can reproduce the error when I swap the order of the -l flags.
> cc -lXm -lXt xmtest.c -o xmtest
>
> HTH!

Thanks for replying! :) Yep, sorry about the typo! It was a bad paste.

Yeah, I could certainly see "-lXt -lXm" failing, in fact I don't think it
should even link. However, that wasn't I was/am doing. But to be really
sure, I've simplified the compile:

$ make k
gcc -g -Wall -c k.c
gcc -g -Wall -o k k.o -lXm -lXt -lX11
$ ./k
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 18 (X_ChangeProperty)
Serial number of failed request: 171
Current serial number in output stream: 181

So I've grabbed the source to Motif 2.3.8 and compiled with -g and with a
symlink in /usr/lib/x86_64-linux-gnu/ using that now. It seems to be
dying in lib/Xm/TextIn.c in RegisterDropSite(). There is an #ifdef for
UTF8_SUPPORTED which is true, and that tries to retrieve/create the atom
for XmSUTF8_STRING which is equal to "UTF8_STRING". If if do "xlsatoms |
grep UTF" that atom is there.

I can undef UTF8_SUPPORTED and recompile libXm, which will then let it
get past the XInternAtoms() call, then then it dies a couple of lines
later anyway, also failing because of atoms.

#4 0x00007ffff6b7511f in XInternAtom () from /usr/lib/x86_64-linux-gnu/
libX11.so.6
#5 0x00007ffff6ba0a59 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#6 0x00007ffff6ba0c1b in _XmbTextListToTextProperty () from /usr/lib/
x86_64-linux-gnu/libX11.so.6
#7 0x00007ffff7a986c4 in XmeGetEncodingAtom (w=w@entry=0x5555557aa6c0)
at Transfer.c:2244
#8 0x00007ffff7a237ca in RegisterDropSite (w=0x5555557aa6c0) at TextIn.c:
6000

This all really makes me go "What the heck?!" I'm starting to believe
there's an issue with Ubuntu's release of X11 or else the X-Server (Xorg).

You didn't say, but what distro & release are you using?

I can go get the source for Xt and X11, compile those with debug symbols
too and then really see everything that's going on in the client, but I
really don't think I should have to do that and I'm also not sure it
would really help me, but I may have to do that anyway just to prove
where the error is (or more likely where it isn't) then submit this to
Ubuntu.

I have Centos at work so maybe I'll try this test there during lunch
tomorrow to have another data point on works or not works.

Sigh...

Kevin
0 new messages