Menu

#1600 'Enter' on a specific line crashes desktop environment

Undefined
fixed
Christo
Bug_Report
2026-07-04
2026-05-07
---
No

Ubuntu 25.04
Code::Blocks 25.03

I have a cursed .cpp file. If you press enter to make a newline

    void resize((size_t w, size_t h){ <- here
    }

It crashes the desktop environment!

(file attached)

1 Attachments

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 2026-05-07

    It fails also on Windows with the current trunk, but here it is recoverable just clicking on the editor.

    The legacy code completion plugin is the culprit, it works if I remove this code:

                    iterator& operator++(){
                        ptr += step;
                        return *this;
                    }
    
                    iterator  operator++(int){
                        iterator old = *this;
                        ptr += step;
                        return old;
                    }
    
     
  • Miguel Gimenez

    Miguel Gimenez - 2026-05-07
    • labels: --> CodeCompletion
    • Type: Undefined --> Bug_Report
     
  • Christo

    Christo - 2026-07-03

    Since resize(( has two open parentheses, argument is computed to be until EOF and this causes the size not to be supported by x server and hence the crash. I've uploaded a patch to ignore if closing parantheses is not found.
    @wh11204
    @ollydbg
    Could you please review if this patch is ok as I'm not familiar with codecompletion plugin?
    Also do you think we add some limits checks somewhere to avoid this kind of crashes due to unexpected size?

     

    Last edit: Christo 2026-07-03
  • Miguel Gimenez

    Miguel Gimenez - 2026-07-03

    I missed completely the duplicated parentheses, good catch.

    The patch looks good to me, except I would use TRACE() instead of fprintf().

     
    👍
    1
  • Christo

    Christo - 2026-07-04
    • status: open --> fixed
    • assigned_to: Christo
     
  • Christo

    Christo - 2026-07-04

    Fixed in [r13883]

     

    Related

    Commit: [r13883]


Log in to post a comment.

Auth0 Logo