I am using the latest version1.6.1.
To reproduce:
1) launch xnedit in a Linux terminal and open a file;
2) highlight some lines and press "ctrl+h" to find the selected text, and close the popup window;
3) click left mouse button to de-highight the selected lines.
4) move the cursor to the terminal and select any text;
5) move cursor back to the xnedit window and press "ctrl+h" again.
Then xnedit crashed with error:
X Error of failed request: BadAtom (invalid Atom parameter)
Major opcode of failed request: 24 (X_ConvertSelection)
Atom id in failed request: 0x252
Serial number of failed request: 8994
Current serial number in output stream: 8994
Please let me know if you cannot reproduce it or need any information.
Thank you.
I'm not sure how to reproduce this. Step 2) is unclear, because ctrl+h has no popup.
And maybe a whole example with a specific test file would be useful.
I am sorry I didn't say it clear. The popup in step 2 is caused by my setting about "Search Wrap" and this has nothing to do with the reported crush.
Now let me start again with xnedit's default settings:
1) I have a text file named "xx" and its content is as follows:
0.0000 -0.0324 -0.0324
5.0000 -0.0326 -0.0321
10.0000 -0.0333 -0.0314
15.0000 -0.0345 -0.0302
20.0000 -0.0363 -0.0284
25.0000 -0.0389 -0.0258
30.0000 -0.0423 -0.0224
35.0000 -0.0468 -0.0179
40.0000 -0.0529 -0.0119
45.0000 -0.0610 -0.0037
50.0000 -0.0721 0.0074
2) in a Linux terminal, type "xnedit xx" and press return;
3) in the launched xnedit, select the first three lines (and then these three line is highlighted);
4) press "ctrl+h";
5) move cursor out of the xnedit window and click anywhere in the terminal in which xnedit is launched), and the selection in xnedit is off;
6) select the text "xnedit xx" in the terminal and move cursor back to the xnedit window and click once to make sure xnedit window is active;
7) press "ctrl+h" again and xnedit crush with errors:
X Error of failed request: BadAtom (invalid Atom parameter)
Major opcode of failed request: 24 (X_ConvertSelection)
Atom id in failed request: 0x252
Serial number of failed request: 8317
Current serial number in output stream: 8317
I can only reproduce it when I compile the source code with option "O3" in Makefile.linux
C_OPT_FLAGS?=-O3
Déjà vu.
Could you try https://sourceforge.net/p/nedit/patches/124/ ? ThanX11
With that patch I got:
X Error: BadAtom (invalid Atom parameter)
resource id 00000252 serial number 9938 op-code 24.0 X_ConvertSelection
and a popup saying "Wrong Selection Selection not appropriate for searching"
with optimization "-O3". However, xnedit didn't crash this time.
If with "-O" then there is no such errors and everything function normally.
Last edit: SweetTyler 2025-01-09
Interesting. Will try to dig deeper by the EoW.
The newest commit should fix this issue.
Btw, this patch looks nice and it is probably much better than calling exit(), I wonder why it wasn't merged back then.
I was struggling w/ Xft back in time_t - 20 years a lot. But frankly, I do not know why it was not even considered for merge. Nevermind, glad that it still works after two decades of devolution.
I have now integrated the X Error patch into xnedit
Nice patch, Peter, I am stealing it for use in my code.
One small improvement possibility:
instead of
static const char request_code[256]
use
static const char request_code[]
and then on usage do
request_code[min(128,number)]
it is not time critical and saves a couple of bytes.
Hvala Dušan.
Happy WE!
@pyrphoros Thank you for the fix. Now everything works as expected.