After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699137 - g_list_append /g_slice_alloc yields segmentation fault
g_list_append /g_slice_alloc yields segmentation fault
Status: RESOLVED INCOMPLETE
Product: glib
Classification: Platform
Component: general
2.32.x
Other Linux
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-04-28 13:56 UTC by Paul Eggert
Modified: 2013-11-24 01:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Eggert 2013-04-28 13:56:36 UTC
I hope I filed this bug in the correct category, but Your 'components' don't make any sense to me. Your manual doesn't state which component GList is part of.

Anyways...

Using this snippet of code:

void blah() {
	static int j = 0;
	printf( "call no. %i\n", ++ j );

	GList* abc = NULL;

	for( int i = 0; i < 100; i ++ ) {
		printf( "---> step %i\n", i + 1 );
		abc = g_list_append( abc, GINT_TO_POINTER( i ) );
	}

	g_list_free( abc );
}

int main() {
	while( 1 ) blah();
}

causes a segementation fault in call no. 1 step 48. The debugger says, g_slice_alloc causes it. Version is from ubuntu repository.
Comment 1 Colomban Wendling 2013-04-28 15:04:07 UTC
Can't reproduce with either 2.32.4 from Debian nor with today's master;  And Valgrind is happy too.  Debian GNU/Linux x86-64.
Comment 2 Allison Karlitskaya (desrt) 2013-04-28 15:09:27 UTC
I can't get this to crash on Ubuntu Raring.

No crash on Fedora 18, either.

Did you include the proper headers in the above code: <stdio.h> and <glib.h>?

Is there anything else unusual about your system?
Comment 3 Matthias Clasen 2013-11-24 01:35:25 UTC
no information was provided