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 627700 - go_plugins_init fails with memory corruption when using glib_mem_profiler_table
go_plugins_init fails with memory corruption when using glib_mem_profiler_table
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-08-23 09:46 UTC by Jon Nordby
Modified: 2010-08-24 08:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (831 bytes, application/download)
2010-08-23 09:46 UTC, Jon Nordby
Details

Description Jon Nordby 2010-08-23 09:46:46 UTC
Created attachment 168547 [details]
testcase

Attached is a small testcase demonstrating the issue. This is on Fedora 13 x86_64 with glib2 2.24.1 and goffice 0.8.8

[jonn@jon-workstation massifg]$ gcc -g goffice-corrupt-mem.c `pkg-config --libs --cflags libgoffice-0.8 glib-2.0`
[jonn@jon-workstation massifg]$ ./a.out 
** Message: Testing glib functions
** Message: Malloc works
*** glibc detected *** ./a.out: malloc(): memory corruption: 0x0000000001abee50 ***

Expected behaviour would be for this to work in the same way as when using the standard mem_table. 

GDB backtrace:
[jonn@jon-workstation massifg]$ gdb ./a.out 
GNU gdb (GDB) Fedora (7.1-32.fc13)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jonn/work/c/massifg/a.out...done.
(gdb) run
Starting program: /home/jonn/work/c/massifg/a.out 
[Thread debugging using libthread_db enabled]
** Message: Testing glib functions
** Message: Malloc works
*** glibc detected *** /home/jonn/work/c/massifg/a.out: malloc(): memory corruption: 0x0000000000655e50 ***
^C
Program received signal SIGINT, Interrupt.
__lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:97
97	2:	movl	%edx, %eax
(gdb) bt
  • #0 __lll_lock_wait_private
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 97
  • #1 _L_lock_9162
    at malloc.c line 3503
  • #2 __libc_malloc
    at malloc.c line 3657
  • #3 __libc_message
    at ../sysdeps/unix/sysv/linux/libc_fatal.c line 137
  • #4 malloc_printerr
  • #5 _int_malloc
    at malloc.c line 4396
  • #6 __libc_calloc
    at malloc.c line 4065
  • #7 profiler_calloc
    at gmem.c line 569
  • #8 IA__g_malloc0
    at gmem.c line 152
  • #9 type_node_any_new_W
    at gtype.c line 418
  • #10 IA__g_type_register_static
    at gtype.c line 2726
  • #11 go_plugin_service_get_type
    at go-plugin-service.c line 91
  • #12 go_plugin_service_simple_get_type
    at go-plugin-service.c line 949
  • #13 go_plugin_service_gobject_loader_get_type
    at go-plugin-service.c line 920
  • #14 gog_plot_engine_service_get_type
    at gog-plot-engine.c line 70
  • #15 go_plugin_service_new
    at go-plugin-service.c line 1016
  • #16 go_plugin_read_service_list
    at go-plugin.c line 655
  • #17 go_plugin_read
    at go-plugin.c line 835
  • #18 go_plugin_new_from_xml
    at go-plugin.c line 215
  • #19 go_plugin_read_for_dir
    at go-plugin.c line 1319
  • #20 go_plugin_list_read_for_subdirs_of_dir
    at go-plugin.c line 1378
  • #21 go_plugin_list_read_for_subdirs_of_dir_list
    at go-plugin.c line 1413
  • #22 go_plugin_list_read_for_all_dirs
    at go-plugin.c line 1435
  • #23 go_plugins_init
    at go-plugin.c line 1778
  • #24 main
    at goffice-corrupt-mem.c line 29

Comment 1 Jean Bréfort 2010-08-24 07:27:52 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 2 Jon Nordby 2010-08-24 08:54:40 UTC
Thanks for the excellent response time. 

For reference, the problem is solved by:
http://git.gnome.org/browse/goffice/commit/?id=c8a2a6d7586284c63f38fed3d80d4e2ba1ee62c2