Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gst_init crash dr.memory #1749

Closed
thomas-roos opened this issue Aug 19, 2015 · 6 comments
Closed

gst_init crash dr.memory #1749

thomas-roos opened this issue Aug 19, 2015 · 6 comments

Comments

@thomas-roos
Copy link

Minimal gstreamer example will crash dr.memory on gst_init

// export PKG_CONFIG_PATH='/mingw/i686-w64-mingw32/lib/pkgconfig'
//gcc -Wall gstMinimal.c -o gstMinimal $(pkg-config --cflags --libs gstreamer-1.0)

#include <gst/gst.h>
#include <glib.h>

int main (int   argc, char *argv[])
{

  /* Initialisation */
  gst_init (&argc, &argv);

  return 0;
}
Dr. Memory version 1.8.0 build 8 built on Sep  9 2014 16:27:02
Dr. Memory results for pid 1020: "gstMinimal.exe"
Application cmdline: "gstMinimal.exe"
Recorded 108 suppression(s) from default c:\Program Files (x86)\Dr. Memory\bin\suppress-default.txt

Error #1: UNADDRESSABLE ACCESS: reading 0x0000000c-0x0000000d 1 byte
 0 libgobject-2.0-0.dll!g_type_create_instance [../../gobject/gtype.c:1856]
 1 libgobject-2.0-0.dll!g_param_spec_internal [../../gobject/gparam.c:435]
 2 libgobject-2.0-0.dll!g_param_spec_string   [../../gobject/gparamspecs.c:2231]
 3 libgstreamer-1.0-0.dll!gst_object_class_intern_init [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstobject.c:170]
 4 libgobject-2.0-0.dll!g_type_class_ref      [../../gobject/gtype.c:2236]
 5 libgobject-2.0-0.dll!g_type_class_ref      [../../gobject/gtype.c:2943]
 6 libgobject-2.0-0.dll!g_object_new          [../../gobject/gobject.c:1614]
 7 libgstreamer-1.0-0.dll!gst_init_check      [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:337]
 8 libgstreamer-1.0-0.dll!gst_init            [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:387]
 9 main          
Note: @0:00:00.501 in thread 2456
Note: instruction: movzx  0x0c(%ebx) -> %ebp
@derekbruening
Copy link
Contributor

You mean the application crashes due to the NULL (+0xc) de-reference reported by Dr. Memory, not that Dr. Memory itself crashes, right? And that doesn't happen w/o the tool?

@thomas-roos
Copy link
Author

yes, my minimal GSTREAMER App is crashing while running under dr. memory control. Without dr.memory it works perfect.

@derekbruening
Copy link
Contributor

I cannot reproduce any kind of crash. I built like this:

% PATH=/c/MinGW/bin:$PATH /c/MinGW/bin/gcc gstreamer.c -g -o gstreamer -Iz:/gstreamer-sdk/0.10/x86/include/glib-2.0 -Iz:/gstreamer-sdk/0.10/x86/include/gstreamer-0.10 -Iz:/gstreamer-sdk/0.10/x86/lib/glib-2.0/include -Iz:/gstreamer-sdk/0.10/x86/include/libxml2 -Lz:/gstreamer-sdk/0.10/x86/lib -lgstreamer-0.10 

I added a print of "success".
Natively:

% PATH=/z/gstreamer-sdk/0.10/x86/bin:$PATH ./gstreamer.exe
success

Under DrMem (turning off leaks b/c there is a lot of heap usage here and we report a lot of leaks and spend a while scanning memory looking for them):

% PATH=/z/gstreamer-sdk/0.10/x86/bin:$PATH ~/drmemory/releases/DrMemory-Windows-1.8.0-8/bin/drmemory.exe -no_count_leaks -- ./gstreamer.exe
~~Dr.M~~ Dr. Memory version 1.8.0
~~Dr.M~~ Running "./gstreamer.exe"
~~Dr.M~~ 
~~Dr.M~~ Error #1: UNINITIALIZED READ: reading 0x0028ff20-0x0028ff24 4 byte(s)
~~Dr.M~~ # 0 __mingw_glob                       [D:\derek\drmemory\bugs\i1749-gstreamer/gstreamer.c:21]
~~Dr.M~~ # 1 _setargv                           [D:\derek\drmemory\bugs\i1749-gstreamer/gstreamer.c:21]
~~Dr.M~~ # 2 __mingw_CRTStartup
~~Dr.M~~ # 3 mainCRTStartup
~~Dr.M~~ # 4 ntdll.dll!__RtlUserThreadStart
~~Dr.M~~ Note: @0:00:00.234 in thread 7624
~~Dr.M~~ Note: instruction: cmp    (%esi) $0x0040a11e
~~Dr.M~~ 
~~Dr.M~~ Error #2: UNINITIALIZED READ: reading register eax
~~Dr.M~~ # 0 libgstreamer-0.10-0.dll!gst_registry_scan_path_level [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gstregistry.c:1257]
~~Dr.M~~ # 1 libgstreamer-0.10-0.dll!gst_registry_scan_path_internal [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gstregistry.c:1304]
~~Dr.M~~ # 2 libgstreamer-0.10-0.dll!gst_update_registry   [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gstregistry.c:1585]
~~Dr.M~~ # 3 libgstreamer-0.10-0.dll!init_post             [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gst.c:793]
~~Dr.M~~ # 4 libgstreamer-0.10-0.dll!gst_init_check        [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gst.c:445]
~~Dr.M~~ # 5 libgstreamer-0.10-0.dll!gst_init              [C:\MinGW\msys\1.0\home\andoni\cerbero\sources\windows_x86\gstreamer-0.10.36\gst/gst.c:499]
~~Dr.M~~ # 6 main                                          [D:\derek\drmemory\bugs\i1749-gstreamer/gstreamer.c:16]
~~Dr.M~~ Note: @0:00:01.731 in thread 7624
~~Dr.M~~ Note: instruction: cmp    0x00000080(%ebp) %eax
success
~~Dr.M~~ 
~~Dr.M~~ ERRORS FOUND:
~~Dr.M~~       0 unique,     0 total unaddressable access(es)
~~Dr.M~~       2 unique,   145 total uninitialized access(es)
~~Dr.M~~       0 unique,     0 total invalid heap argument(s)
~~Dr.M~~       0 unique,     0 total GDI usage error(s)
~~Dr.M~~       0 unique,     0 total handle leak(s)
~~Dr.M~~       0 unique,     0 total warning(s)
~~Dr.M~~ ERRORS IGNORED:
~~Dr.M~~     131 potential error(s) (suspected false positives)
~~Dr.M~~          (details: D:\derek\drmemory\releases\DrMemory-Windows-1.8.0-8\drmemory\logs\DrMemory-gstreamer.exe.1000.000\potential_errors.txt)
~~Dr.M~~ Details: D:\derek\drmemory\releases\DrMemory-Windows-1.8.0-8\drmemory\logs\DrMemory-gstreamer.exe.1000.000\results.txt

The mingw_glob uninit: xref #1324. The gst_registry_scan_path_level uninit: someone will need to look at that and see if it's a real bug.

@derekbruening
Copy link
Contributor

mingw_glob deliberate uninit supp was generalized in 526576a

As for the unaddr and app crash, we need more information including precise compiler and library and OS versions. Providing the actual binary may be necessary.

@thomas-roos
Copy link
Author

thank you - build DrMemory-Windows-1.8.16675-0x3f74362-sfx.exe fixed the bug, you can close the issue

Dr. Memory version 1.8.16675 build 66536290 built on Aug 27 2015 17:57:31
Dr. Memory results for pid 3156: "gstMinimal.exe"
Application cmdline: "./gstMinimal.exe"
Recorded 110 suppression(s) from default c:\Users\roos\Downloads\dr\bin\suppress-default.txt

Error #1: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x026aa78e-0x026aa790 2 byte(s) within 0x026aa78c-0x026aa790
 0 libintl-8.dll!_nl_find_msg                    [../../../gettext-tools/../gettext-runtime/intl/dcigettext.c:1171]
 1 libintl-8.dll!libintl_dcigettext              [../../../gettext-tools/../gettext-runtime/intl/dcigettext.c:742]
 2 libintl-8.dll!libintl_dcgettext               [../../../gettext-tools/../gettext-runtime/intl/dcgettext.c:47]
 3 libintl-8.dll!libintl_dgettext                [../../../gettext-tools/../gettext-runtime/intl/dgettext.c:50]
 4 libgstreamer-1.0-0.dll!gst_registry_scan_path_level [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1229]
 5 libgstreamer-1.0-0.dll!gst_registry_scan_path_internal [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1364]
 6 libgstreamer-1.0-0.dll!gst_update_registry    [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1631]
 7 libgstreamer-1.0-0.dll!init_post              [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:705]
 8 libgstreamer-1.0-0.dll!gst_init_check         [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:337]
 9 libgstreamer-1.0-0.dll!gst_init               [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:387]
10 main          
Note: @0:00:04.571 in thread 844
Note: refers to 0 byte(s) beyond last valid byte in prior malloc
Note: prev lower malloc:  0x026aa788-0x026aa78e
Note: instruction: mov    (%ebx) -> %eax

Error #2: UNINITIALIZED READ: reading register eax
 0 libgstreamer-1.0-0.dll!gst_registry_scan_path_level [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1317]
 1 libgstreamer-1.0-0.dll!gst_registry_scan_path_internal [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1364]
 2 libgstreamer-1.0-0.dll!gst_update_registry    [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gstregistry.c:1652]
 3 libgstreamer-1.0-0.dll!init_post              [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:705]
 4 libgstreamer-1.0-0.dll!gst_init_check         [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:337]
 5 libgstreamer-1.0-0.dll!gst_init               [c:\users\roos\downloads\script\gstreamer-1.4.5\gst/gst.c:387]
 6 main          
Note: @0:00:04.645 in thread 844
Note: instruction: cmp    0x00000098(%ebp) %eax

===========================================================================
FINAL SUMMARY:

DUPLICATE ERROR COUNTS:
    Error #   2:    130

SUPPRESSIONS USED:

ERRORS FOUND:
      1 unique,     1 total unaddressable access(es)
      1 unique,   130 total uninitialized access(es)
      0 unique,     0 total invalid heap argument(s)
      0 unique,     0 total GDI usage error(s)
      0 unique,     0 total handle leak(s)
      0 unique,     0 total warning(s)
ERRORS IGNORED:
     66 potential error(s) (suspected false positives)
         (details: c:\Users\roos\Downloads\dr\drmemory\logs\DrMemory-gstMinimal.exe.3156.000\potential_errors.txt)
Details: c:\Users\roos\Downloads\dr\drmemory\logs\DrMemory-gstMinimal.exe.3156.000\results.txt

@derekbruening
Copy link
Contributor

Glad to hear it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants