Menu

#41 strange crash

1.4
closed
nobody
None
2025-01-13
2025-01-09
SweetTyler
No

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.

Discussion

  • Pyrphoros

    Pyrphoros - 2025-01-09

    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.

     
  • SweetTyler

    SweetTyler - 2025-01-09

    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

     
  • SweetTyler

    SweetTyler - 2025-01-09

    I can only reproduce it when I compile the source code with option "O3" in Makefile.linux

    C_OPT_FLAGS?=-O3

     
    • Peter Kovář

      Peter Kovář - 2025-01-09

      Déjà vu.

       
      • Peter Kovář

        Peter Kovář - 2025-01-09
         
        • SweetTyler

          SweetTyler - 2025-01-09

          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
          • Peter Kovář

            Peter Kovář - 2025-01-09

            Interesting. Will try to dig deeper by the EoW.

             
            • Pyrphoros

              Pyrphoros - 2025-01-10

              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.

               
              • Peter Kovář

                Peter Kovář - 2025-01-10

                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.

                Cheers!

                 
                • Pyrphoros

                  Pyrphoros - 2025-01-11

                  I have now integrated the X Error patch into xnedit

                   
                  🎉
                  2
        • Dusan Peterc

          Dusan Peterc - 2025-01-10

          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.

           
          👍
          1
          • Peter Kovář

            Peter Kovář - 2025-01-10

            Hvala Dušan.

            Happy WE!

             
  • SweetTyler

    SweetTyler - 2025-01-10

    @pyrphoros Thank you for the fix. Now everything works as expected.

     
  • Pyrphoros

    Pyrphoros - 2025-01-13
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB