Bug 621 - libglib-2.0: g_mem_profle() return a error result
Summary: libglib-2.0: g_mem_profle() return a error result
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.0 M3
Assignee: Dongxiao Xu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2010-12-28 21:36 UTC by Xiaofeng Yan
Modified: 2010-12-28 23:41 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaofeng Yan 2010-12-28 21:36:15 UTC
During Desktop-T2C test from lsb test suite I get a error from libglib-2.0. 

The detailed information is belows:

/glib-t2c/tests/glib_memory/glib_memory	
Message from the test:

Target interface(s):
 g_mem_profile
--------
g_mem_profile: no summary was produced by this call.
 
Requirement failed:
{g_mem_profile.01}
Outputs a summary of memory usage. 
================================================================================
The next c program is an example to apply function g_mem_progfile()

Host: ubuntu 10.04 x86_32
Compile environment:i586-poky-linux-gcc, pkg-config point to poky sysroot
Target Platform: qemux86  
PC$:Operation on Host
Target# Operation on qemux86
================================================================================

PC$ vim g_mem.c
#include <stdlib.h> /* atexit() */
#include <glib.h>

int main() {
    GList *list;

    atexit(g_mem_profile);
    g_mem_set_vtable(glib_mem_profiler_table);

    list = 0;
    list = g_list_append(list,0);
    g_list_free(list);

    return 0;
}
===============================================================================
PC$i586-poky-linux-gcc `pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0` g_mem.c -o g_mem 
PC$./g_mem
GLib Memory statistics (successful operations):
 blocks of | allocated  | freed      | allocated  | freed      | n_bytes   
  n_bytes  | n_times by | n_times by | n_times by | n_times by | remaining 
           | malloc()   | free()     | realloc()  | realloc()  |           
===========|============|============|============|============|===========
       508 |          3 |          0 |          0 |          0 |      +1524
      2040 |          1 |          0 |          0 |          0 |      +2040
GLib Memory statistics (failing operations):
 --- none ---
Total bytes: allocated=3564, zero-initialized=3564 (100.00%), freed=0 (0.00%), remaining=3564
===============================================================================
I copy this binary program to qemux86

Target#./g_mem
Target#

So It's nothing when running "./g_mem" on qemux86 platform.
Comment 1 Jingdong Lu 2010-12-28 23:31:54 UTC
Source code:
glib-2.27.3/glib/gmem.c
/* notes on macros:
 * having G_DISABLE_CHECKS defined disables use of glib_mem_profiler_table and
 * g_mem_profile().

glib-2.0_2.27.3.bb
|-- glib.inc
    |-- EXTRA_OECONF = "--disable-debug --enable-included-printf=no"

So, remove "--disable-debug", this will be fixed.
Comment 2 Xiaofeng Yan 2010-12-28 23:41:54 UTC
Thanks Jingdong Lu. perhaps We should add this modification to libglib bb file.