[Bug 688798] New: gcc with GNOME: Restore space with the order 'free()' fails in gcc in GNOME
https://bugzilla.novell.com/show_bug.cgi?id=688798 https://bugzilla.novell.com/show_bug.cgi?id=688798#c0 Summary: gcc with GNOME: Restore space with the order 'free()' fails in gcc in GNOME Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: x86-64 OS/Version: openSUSE 11.3 Status: NEW Severity: Normal Priority: P5 - None Component: GNOME AssignedTo: bnc-team-gnome@forge.provo.novell.com ReportedBy: esddss@t-online.de QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.16) Gecko/20110319 SUSE/3.6.16-0.2.1 Firefox/3.6.16 gcc with GNOME: Restore space with the order 'free()' fails in gcc in GNOME (Version by Suse Novell LINUX 11.3) After using the order 'malloc()' with some operations the 'free'-order fails; that means, that program which uses 'free()' freezes with all windows and must be killed for ending this program. That's a special GNOME problem, in KDE with (IDE) Qt4 it works properly without problems. Here an abstract of the orders of a program for input data as database: #define MAXI 50 struct daten { gchar D_FELD1[52]; // alternative: char D_FELD1[52]; gchar D_FELD2[52]; gchar D_FELD3[52]; }tabelle[MAXI]; // building a form with a button dlg_ein_vor().... ..... void dlg_ein_vor(void) { const gchar *textfeld; if((struct daten *)malloc(sizeof(struct daten))) { textfeld = gtk_entry_get_text(GTK_ENTRY(dfeld1)); strcpy(tabelle[anzahl].D_FELD1,textfeld); // some further operations } ..... } /* This orders will be accept by gcc and IDE's, but all fails, the program freezes with all windows: */ free(tabelle); free((gchar *)tabelle); // alternative: (char *) g_free(tabelle); g_free((struct daten *)tabelle); The order 'free()' or 'g_free()' is a requisite part of 'malloc()' as convention of the program language C, it destroys an existing table from heap (in contrast to stack). Otherwise you get too large dates (perhaps with overflow)! Reproducible: Always Steps to Reproduce: 1.C-programming with using the order 'malloc()' and 'free()' 2. 3. Actual Results: That program which uses 'free()' freezes with all windows and must be killed for ending this program. Expected Results: The order 'free()' or 'g_free()' is a requisite part of 'malloc()' as convention of the program language C, it must destroy an existing table from heap (in contrast to stack). Otherwise you get too large dates (perhaps with overflow)! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=688798 https://bugzilla.novell.com/show_bug.cgi?id=688798#c1 Vincent Untz <vuntz@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #1 from Vincent Untz <vuntz@suse.com> 2012-05-15 21:54:08 UTC --- There's nothing to free() in the code above, since no memory is dynamically allocated. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com