GtkTextWidget hangs




Hi

I just found a way to make GtkTextWidget hang. To
reproduce the bug you can use the testgtk program:

1. Start the GtkTextWidget-Demo in testgtk.

2. Switch word-wrap on.

3. Move the cursor to the begin of the first line.

4. Hit the return-key 3 times to insert 3 empty lines.

5. Move the cursor to the first line again.

6. Type 3 lines of "O" without return:

   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

7. Hit return (important!)

8. Move the cursor to the first line (1x cursor-up) and
   then 3 steps to the right.

9. Hit the space key. Should now look like:

   OOO
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

10. Move the cursor 5 steps to the right and press
    space again:

   OOO
   OOOOO
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO<
   OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

11. Repeat step 10. -> endless loop.



In the debugger I found that the endless loop is in
the function correct_cache_insert(). 
 After step 10 there is a bad node in the cache-list,
the ->next and ->prev fields of that node are pointing
the node itself. This bad node is probably created 
while inserting the second space (probably in the 
function swap_lines()).


Sometimes I even get a segfault while using the 
TextWidget, but I can't reproduce that yet.


ciao Matthias



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]