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 619991 - Access violation writing location
Access violation writing location
Status: RESOLVED OBSOLETE
Product: gdk-pixbuf
Classification: Platform
Component: GDI loader
git master
Other Windows
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-29 02:28 UTC by JesseStone
Modified: 2018-05-22 13:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Access violation in VC9 (116.82 KB, image/x-png)
2010-05-29 02:31 UTC, JesseStone
Details

Description JesseStone 2010-05-29 02:28:30 UTC
when

if (Ok != (status = GdipBitmapGetPixel (bitmap, x, y, &pixel)))
{...} 

will happen

First-chance exception at 0x4b03b280 in gtk-demo.exe: 0xC0000005: Access violation writing location 0x01c6000e.
Comment 1 JesseStone 2010-05-29 02:31:19 UTC
Created attachment 162252 [details]
Access violation in VC9
Comment 2 JesseStone 2010-05-29 02:34:36 UTC
in gtk-demo sample code
Comment 3 JesseStone 2010-05-29 06:28:28 UTC
(In reply to comment #2)
> in gtk-demo sample code

http://support.microsoft.com/?scid=kb;en-us;901026&x=20&y=13

its a microsoft Gdiplus.dll bug
Comment 4 Tor Lillqvist 2010-06-01 07:33:35 UTC
Hmm, huh? Is there a bug somewhere in GTK+ or not? Why is this bug report marked "fixed"? (If there is a bug elsewhere and no workaround is possible, "NOTGNOME" would be a better resolution. But ideally we should try to come up with a workaround.) What does "PrivateFontCollection" (mentioned in the link to support.microsoft.com above) has to do with this?
Comment 5 JesseStone 2010-06-01 08:31:54 UTC
The bug is from microsoft not GTK, i install hotfix then all done~(In reply to comment #4)
> Hmm, huh? Is there a bug somewhere in GTK+ or not? Why is this bug report
> marked "fixed"? (If there is a bug elsewhere and no workaround is possible,
> "NOTGNOME" would be a better resolution. But ideally we should try to come up
> with a workaround.) What does "PrivateFontCollection" (mentioned in the link to
> support.microsoft.com above) has to do with this?

The bug is from microsoft not GTK, i install hotfix then all done~
Comment 6 Tor Lillqvist 2010-06-01 09:35:04 UTC
But we can't really expect people to know about such hotfixes. It is not correct to require people to have non-mandatory fixes installed. Re-opening the bug. Is there no way to add a workaround to the GTK+ code? That needs to be figured out.

Anyway, do you have a complete but minimal sample program that causes the access violation (on a system without the gdipus hotfix)? Please attach it. (As a single source file, thanks. No binaries, no zip or other archives.)
Comment 7 JesseStone 2010-06-01 11:11:47 UTC
// GDItest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>

#define WINGDIPAPI		__stdcall

typedef struct _GpImage GpImage;
typedef struct _GpBitmap GpBitmap;
typedef struct _GpGraphics GpGraphics;

struct _GdiplusStartupInput
{
    unsigned int GdiplusVersion;
    void* DebugEventCallback;
    int SuppressBackgroundThread;
    int SuppressExternalCodecs;
};
typedef struct _GdiplusStartupInput GdiplusStartupInput;

enum _Status
{
    Ok                          = 0,
    GenericError                = 1,
    InvalidParameter            = 2,
    OutOfMemory                 = 3,
    ObjectBusy                  = 4,
    InsufficientBuffer          = 5,
    NotImplemented              = 6,
    Win32Error                  = 7,
    WrongState                  = 8,
    Aborted                     = 9,
    FileNotFound                = 10,
    ValueOverflow               = 11,
    AccessDenied                = 12,
    UnknownImageFormat          = 13,
    FontFamilyNotFound          = 14,
    FontStyleNotFound           = 15,
    NotTrueTypeFont             = 16,
    UnsupportedGdiplusVersion   = 17,
    GdiplusNotInitialized       = 18,
    PropertyNotFound            = 19,
    PropertyNotSupported        = 20,
    ProfileNotFound             = 21
};

typedef enum _Status GpStatus;
typedef void* gpointer;
typedef void* gconstpointer;

typedef unsigned long  ARGB;

typedef GpStatus (WINGDIPAPI* GdiplusStartupFunc) (gpointer, const gpointer, gpointer);
typedef GpStatus (WINGDIPAPI* GdiplusShutdownFunc) (gpointer);
typedef GpStatus (WINGDIPAPI* GdipCreateBitmapFromStreamFunc) (gpointer, GpBitmap**);
typedef GpStatus (WINGDIPAPI* GdipCreateBitmapFromFileFunc) (WCHAR*, GpBitmap**);
typedef GpStatus (WINGDIPAPI* GdipBitmapGetPixelFunc) (GpBitmap*, int x, int y, ARGB*);
typedef GpStatus (WINGDIPAPI* GdipGetImageWidthFunc) (GpImage*, unsigned int*);
typedef GpStatus (WINGDIPAPI* GdipGetImageHeightFunc) (GpImage*, unsigned int*);

GdiplusStartupFunc GdiplusStartup;
GdiplusShutdownFunc GdiplusShutdown;
GdipCreateBitmapFromStreamFunc GdipCreateBitmapFromStream;
GdipCreateBitmapFromFileFunc GdipCreateBitmapFromFile;
GdipBitmapGetPixelFunc	GdipBitmapGetPixel;
GdipGetImageWidthFunc	GdipGetImageWidth;
GdipGetImageHeightFunc	GdipGetImageHeight;

HINSTANCE gdipluslib = NULL;

int gdip_init(void)
{
  GdiplusStartupInput input;
  long gdiplusToken = 0;
  
  if (!gdipluslib)
    gdipluslib = LoadLibrary ("gdiplus.dll");
  else
    return TRUE; /* gdip_init() is idempotent */


  GdiplusStartup = (GdiplusStartupFunc)GetProcAddress(gdipluslib, "GdiplusStartup");
  GdiplusShutdown = (GdiplusShutdownFunc)GetProcAddress(gdipluslib, "GdiplusShutdown");
  GdipBitmapGetPixel = (GdipBitmapGetPixelFunc)GetProcAddress(gdipluslib, "GdipBitmapGetPixel");
  GdipCreateBitmapFromStream = (GdipCreateBitmapFromStreamFunc)GetProcAddress(gdipluslib, "GdipCreateBitmapFromStream");
  GdipCreateBitmapFromFile = (GdipCreateBitmapFromFileFunc)GetProcAddress(gdipluslib, "GdipCreateBitmapFromFile");

  input.GdiplusVersion = 1;
  input.DebugEventCallback = NULL;
  input.SuppressBackgroundThread = input.SuppressExternalCodecs = FALSE;
  
  return (GdiplusStartup (&gdiplusToken, &input, NULL) == 0 ? TRUE : FALSE);
}

int _tmain(int argc, _TCHAR* argv[])
{
	ARGB		pixel;
	unsigned __int64	size64;
	//ULARGE_INTEGER	size64;
	int			status;
	FILE*       gifp;
	HGLOBAL		hg	   = NULL;
	IStream*	stream = NULL;
	GpBitmap*	bitmap = NULL;
		
	status = gdip_init();
	
	status = fopen_s(&gifp,"rgb.gif","rb");
	
	hg = GlobalAlloc (GPTR, 6427);
	fread(hg,1,6427,gifp);
	
	size64 = 6427;
	//size64.QuadPart = 6427;
	CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream);
	stream->SetSize(*(ULARGE_INTEGER*)&size64);
		
	status = GdipCreateBitmapFromStream (stream, &bitmap);
	//status = GdipCreateBitmapFromFile(L"rgb.gif", &bitmap);
	
	pixel = 0;
	status = GdipBitmapGetPixel (bitmap, 0, 0, &pixel);
	
	fclose(gifp);

	GdiplusShutdown(gdipluslib);
	status = FreeLibrary( gdipluslib );

	return 0;
}

If gdiplus.dll have bug then status = GdipBitmapGetPixel (bitmap, 0, 0, &pixel);

will happend Access violation writing location in debug message windows in VC
Comment 8 JesseStone 2010-06-01 11:16:38 UTC
Please add my email & msn : fatalfeel@hotmail.com

If could please friend list in msn

(In reply to comment #6)
> But we can't really expect people to know about such hotfixes. It is not
> correct to require people to have non-mandatory fixes installed. Re-opening the
> bug. Is there no way to add a workaround to the GTK+ code? That needs to be
> figured out.
> Anyway, do you have a complete but minimal sample program that causes the
> access violation (on a system without the gdipus hotfix)? Please attach it. (As
> a single source file, thanks. No binaries, no zip or other archives.)
Comment 9 Tor Lillqvist 2010-06-01 11:31:48 UTC
I don't use msn, whatever it is, or any other "social media" either, if it's some such. I am basically anti-social;)
Comment 10 JesseStone 2010-06-01 11:50:26 UTC
(In reply to comment #9)
> I don't use msn, whatever it is, or any other "social media" either, if it's
> some such. I am basically anti-social;)

msn skype yahoo ... anyone?
Comment 11 Tor Lillqvist 2010-06-01 12:01:39 UTC
I doubt you will find anyone wanting to talk about this using some private person-to-person real-time media. bugzilla is used for a reason, to keep the dicsussion public and non-real-time.
Comment 12 JesseStone 2010-06-01 12:03:29 UTC
ha ha ha ha u are my bug in my body... thanks
Comment 13 Tor Lillqvist 2010-06-01 12:13:18 UTC
Please don't close the bug if it is obvious that there *is* a problem that we would need to come up with a workaround for. Especially don't claim it would have been "fixed". "wontfix" might be more appropriate in this case, but let's not be that pessimistic yet. (Having a bug open doesn't mean it will ever be fixed, of course.)
Comment 14 Tor Lillqvist 2010-11-16 21:26:01 UTC
I wonder if this has been fixed now in the GDI+-based gdk-pixbuf loaders, if that is what this somewhat strange bug is about. At least some GDI+ problem was fixed in them.
Comment 15 GNOME Infrastructure Team 2018-05-22 13:11:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/25.