Bug 486334 - Endless recursive loop in egg_markdown_to_text_line_formatter()
Endless recursive loop in egg_markdown_to_text_line_formatter()
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gnome-packagekit (Show other bugs)
rawhide
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-19 07:59 EST by Tomáš Bžatek
Modified: 2015-03-03 17:34 EST (History)
3 users (show)

See Also:
Fixed In Version: gnome-packagekit-0.4.4-2.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-02 05:55:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomáš Bžatek 2009-02-19 07:59:16 EST
Description of problem:
gpk-application recursively calls egg_markdown_to_text_line_formatter() which makes the string longer and longer and never ends...

Version-Release number of selected component (if applicable):
  gnome-packagekit-0.4.3-1.fc11.x86_64
  PackageKit-0.4.3-1.fc11.x86_64
  gcc-4.4.0-0.20.x86_64

Steps to Reproduce:
1. run gpk-application
2. search for 'geeqie' or any other package
3. tick the checkbox like you want to install that package
4. UI freezes, memory usage increases, ends with kill from OOM killer

Additional info:
- might be related to gcc-4.4.0, try to lower optimizations (-O0)


gnome-packagekit-0.4.3/src/egg-markdown.c

...
#3201 0x000000000041481d in egg_markdown_to_text_line_formatter (
    line=0x8ce020 "* This software is currently in alpha state * This software is currently in alpha state * This software is currently in alpha state * This software is currently in alpha state * This software is curre"..., 
    formatter=0x42ac4f "**", left=0x432032 "", right=0x432032 "") at egg-markdown.c:318
#3202 0x000000000041481d in egg_markdown_to_text_line_formatter (
    line=0x8cddf0 "* This software is currently in alpha state * This software is currently in alpha state * This software is currently in alpha state * This software is currently in alpha state *** This software is cur"..., 
    formatter=0x42ac4f "**", left=0x432032 "", right=0x432032 "") at egg-markdown.c:318
#3203 0x000000000041481d in egg_markdown_to_text_line_formatter (
    line=0x8cdc00 "* This software is currently in alpha state * This software is currently in alpha state * This software is currently in alpha state *** This software is currently in alpha state ***", formatter=0x42ac4f "**", 
    left=0x432032 "", right=0x432032 "") at egg-markdown.c:318
#3204 0x000000000041481d in egg_markdown_to_text_line_formatter (line=0x7c9650 "* This software is currently in alpha state * This software is currently in alpha state *** This software is currently in alpha state ***", 
    formatter=0x42ac4f "**", left=0x432032 "", right=0x432032 "") at egg-markdown.c:318
#3205 0x000000000041481d in egg_markdown_to_text_line_formatter (line=0x7c9530 "* This software is currently in alpha state *** This software is currently in alpha state ***", formatter=0x42ac4f "**", left=0x432032 "", 
    right=0x432032 "") at egg-markdown.c:318
#3206 0x000000000041481d in egg_markdown_to_text_line_formatter (line=0x8bc900 "*** This software is currently in alpha state ***", formatter=0x42ac4f "**", left=0x432032 "", right=0x432032 "") at egg-markdown.c:318
#3207 0x00000000004148da in egg_markdown_to_text_line_format (line=<value optimized out>, self=<value optimized out>) at egg-markdown.c:340
#3208 egg_markdown_flush_pending (self=0x6c4000) at egg-markdown.c:454
#3209 0x0000000000414ea6 in egg_markdown_to_text_line_process (line=<value optimized out>, self=<value optimized out>) at egg-markdown.c:487
#3210 egg_markdown_parse (self=0x6c4000, markdown=<value optimized out>) at egg-markdown.c:698
#3211 0x0000000000412298 in gpk_application_text_format_display (ascii=<value optimized out>, application=<value optimized out>) at gpk-application.c:940
#3212 gpk_application_details_cb (client=<value optimized out>, details=0x8e0cd0, application=0x6bf050) at gpk-application.c:1019
#3213 0x00007ffff69d18fe in IA__g_closure_invoke (closure=0x71afd0, return_value=0x0, n_param_values=2, param_values=0x8cd790, invocation_hint=0x7fffffffd6c0) at gclosure.c:767

#3214 0x00007ffff69e7f08 in signal_emit_unlocked_R (node=0x70e0c0, detail=<value optimized out>, instance=<value optimized out>, emission_return=<value optimized out>, instance_and_params=<value optimized out>) at gsignal.c:3244
#3215 0x00007ffff69e92ee in IA__g_signal_emit_valist (instance=0x6bf650, signal_id=<value optimized out>, detail=0, var_args=0x7fffffffd8b0) at gsignal.c:2977
Comment 1 Richard Hughes 2009-02-19 08:58:10 EST
I've committed this to git:

commit 68be403108adee13ece04140371a559c83c33a61
Author: Richard Hughes <hughsie@localhost.localdomain>
Date:   Thu Feb 19 13:57:28 2009 +0000

    bugfix: fix infinite recursion when we try to format invalid markdown. Fixes rh#486334

diff --git a/src/egg-markdown.c b/src/egg-markdown.c
index 75b4359..fcc0519 100644
--- a/src/egg-markdown.c
+++ b/src/egg-markdown.c
@@ -302,7 +302,7 @@ egg_markdown_to_text_line_formatter (const gchar *line, const gchar *formatter,
        str1 = egg_markdown_strstr_spaces (copy, formatter);
        if (str1 != NULL) {
                *str1 = '\0';
-               str2 = egg_markdown_strstr_spaces (str1+1, formatter);
+               str2 = egg_markdown_strstr_spaces (str1+len, formatter);
                if (str2 != NULL) {
                        *str2 = '\0';
                        middle = str1 + len;
Comment 2 Richard Hughes 2009-02-19 09:11:45 EST
commit cf7531d78af4d754a9705b6df9f22769bff77cb2
Author: Richard Hughes <hughsie@localhost.localdomain>
Date:   Thu Feb 19 14:11:28 2009 +0000

    trivial: add some unit tests to EggMarkup
Comment 3 Richard Hughes 2009-02-19 09:12:43 EST
I'm doing a new upstream release on Monday and will update rawhide then. Thanks for reporting this bug, and doing the debugging -- appreciated.
Comment 4 Tomáš Bžatek 2009-03-02 05:55:05 EST
Looks to be fixed in gnome-packagekit-0.4.4-2.fc11.x86_64
Closing.

Note You need to log in before you can comment on or make changes to this bug.