Bug with GMemChunk
- From: Soeren Sandmann <sandmann daimi au dk>
- To: gtk-list redhat com
- Subject: Bug with GMemChunk
- Date: 13 Aug 1999 14:43:40 +0200
This piece of code fails with a segmentation fault on
Solaris 2.7/Sparc. I am using GLib 1.3.1.
#include <glib.h>
#define SIZE 4096
static GMemChunk *test = NULL;
int
main ()
{
  guint8 *test1, *test2, *test3;
  gint i;
  test = g_mem_chunk_new ("test mem chunk",
			  SIZE,
			  16, G_ALLOC_AND_FREE);
  
  test1 = g_chunk_new (guint8, test);
  test2 = g_chunk_new (guint8, test);
  for (i=0; i<SIZE; i++)
    test2[i] = 'b';
  test3 = g_chunk_new (guint8, test);
  return 0;
}
Here is the stack trace:
#0  0xff2c5518 in _malloc_unlocked ()
#1  0xff2c5314 in malloc ()
#2  0xff35a5cc in g_malloc (size=4096) at gmem.c:177
#3  0xff35ac08 in g_mem_chunk_alloc (mem_chunk=0x21a20) at gmem.c:663
#4  0x10b60 in main () at mcbirnan.c:23
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]