#65 open

Bug: Malformed input causes hang

Reported by zachriggle | December 24th, 2010 @ 08:05 AM | in 0.1 — first usable version

What I did

  1. Open a Python file
  2. Type the text shown in the screenshot, x()()()()cc\\

What I expected to happen

Nothing special.

What actually happened

Program hang, 99% CPU usage.


I was unable to reproduce this exactly, although I did get it to hang one other time in the process of typing the same text.

The screenshot shows the last \` as not having highlighting applied, which leads me to believe the hang was caused by the syntax highlighting. The screenshot was taken *after* the application stopped responding.

Comments and changes to this ticket

  • rsms

    rsms December 26th, 2010 @ 09:16 PM

    • Milestone set to 0.1 — first usable version
    • State changed from “new” to “open”
    • Assigned user set to “rsms”
    • Tag set to bug, spin, syntaxhighlight
    • Milestone order changed from “47” to “0”

    This is a bug in the syntax parser I'm afraid. It's unfortunately very complex to debug something like this since it's hard to reproduce.

    I have seen this and would very much like to get to the bottom of this bug, so if you have the courage to dive in, please do so! Instruments (part of Apple's dev bundle/Xcode package) is a great tool for this.

    Two ideas for a debugging approach:

    1. Run Kod in a debugger and break when you manage to trigger the bug. Find the "kod.syntaxhighlight" thread and check the stack to undertand what is bugging.

    2. Use a "Time Profiler", have it launch and record Kod, trigger the bug and then analyze the aggregated stack symbol table.

  • Solaiman Sumon
  • Rakesh

    Rakesh May 18th, 2020 @ 07:23 AM

    How Can I explain about your post? Because here you have shared very important things. Thank you very much.
    By the way SSC Result Bangladesh Education Board available here. You may check the result by clicking the link. Thank you

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A text editor for Mac OS X

People watching this ticket