#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.

  • Hoa Dao

    Hoa Dao February 23rd, 2022 @ 08:10 PM

    Your article is very good and useful, thank you for sharing, mig8 hopes that next time you will have more good articles to send to all readers.

  • surin

    surin May 29th, 2022 @ 07:07 AM

    พีจีสล็อต เล่นเกมสล็อตบนมือถือ ดีอย่างไรบ้าง เราจะมาทราบไปพร้อมกันสล็อตออนไลน์ หรือ PG SLOT เกมออนไลน์สล็อต 3 มิติ แบบ pocket games สะดวกสบาย และยังทำเงินได้อีกด้วย

  • thiagogo

    thiagogo September 26th, 2022 @ 12:15 PM

    Your essay is well-written and engaging, with excellent substance. I've read a lot of posts, but yours is one of the most memorable; thank you for sharing it. driving directions mapquest

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