PDA

View Full Version : exception at 0x65100c40 (QtGuid4.dll)



sabeesh
19th December 2007, 13:15
Hi,
I create a test program in Qt4.3 and compile it using Visual Studio 2005.
At the time of compiling, there has no errors. But when I run that program
, the program start running and after some 2 sec it display an error and crash. The error is like this. Any one know why this error?

First-chance exception at 0x65100c40 (QtGuid4.dll) in Test.exe: 0xC0000005: Access violation reading location 0x00000000


Please help me to find the reason of this error?

jacek
19th December 2007, 13:21
It looks like you have a null pointer somewhere. Post the backtrace and we will try to find where it is.

sabeesh
19th December 2007, 13:27
Hi,
When I run that program, V.S print these values at the output window



'Test.exe'': Loaded 'D:\svnserver\ccmanager\windows\debug\Test.exe'', Symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\Qt3Supportd4.dll', Symbols loaded.
'Test.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\comdlg32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtSqld4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtCored4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcp80d.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtXmld4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtGuid4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\winmm.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\winspool.drv', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtNetworkd4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\sqlite3.dll', Binary was not built with debug information.
'Test.exe'': Loaded 'C:\WINDOWS\system32\avicap32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msvfw32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\Syncor11.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\Program Files\Common Files\Logitech\LVMVFM\LVPrcInj.dll', No symbols loaded.
The thread 'Win32 Thread' (0xddc) has exited with code 12058624 (0xb80000).
'Test.exe'': Loaded 'C:\WINDOWS\system32\MSCTF.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\usp10.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\plugins\imageformats\qgifd4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\plugins\imageformats\qjpegd4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\plugins\imageformats\qmngd4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\plugins\imageformats\qsvgd4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\bin\QtSvgd4.dll', Symbols loaded.
'Test.exe'': Loaded 'C:\Qt\4.3.0\plugins\imageformats\qtiffd4.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\secur32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\userenv.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\xpsp2res.dll', Binary was not built with debug information.
'Test.exe'': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\wdmaud.drv', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\wintrust.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\crypt32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msasn1.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\imagehlp.dll', No symbols loaded.
'Test.exe'': Unloaded 'C:\WINDOWS\system32\setupapi.dll'
'Test.exe'': Unloaded 'C:\WINDOWS\system32\wdmaud.drv'
'Test.exe'': Loaded 'C:\WINDOWS\system32\wdmaud.drv', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.
'Test.exe'': Unloaded 'C:\WINDOWS\system32\setupapi.dll'
'Test.exe'': Loaded 'C:\WINDOWS\system32\msacm32.drv', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msacm32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\midimap.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\P1100bVf.dll', Binary was not built with debug information.
'Test.exe'': Loaded 'C:\WINDOWS\system32\cfgmgr32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\setupapi.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\vfwwdm32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ksuser.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\clbcatq.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\comres.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\devenum.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msdmo.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\ksproxy.ax', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\kswdmcap.ax', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\mfc42.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\P1100bDx.ax', Binary was not built with debug information.
'Test.exe'': Loaded 'C:\WINDOWS\system32\qcap.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\quartz.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\Program Files\Common Files\Logitech\LVMVFM\UMVPL.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\msvcr71.dll', Symbols loaded.
The thread 'Win32 Thread' (0x710) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x898) has exited with code -2147024637 (0x80070103).
The thread 'Win32 Thread' (0x830) has exited with code 0 (0x0).
'Test.exe'': Unloaded 'C:\WINDOWS\system32\vfwwdm32.dll'
'Test.exe'': Unloaded 'C:\WINDOWS\system32\P1100bVf.dll'
'Test.exe'': Unloaded 'C:\WINDOWS\system32\cfgmgr32.dll'
'Test.exe'': Unloaded 'C:\WINDOWS\system32\dciman32.dll'
'Test.exe'': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\P1100bVf.dll', Binary was not built with debug information.
'Test.exe'': Loaded 'C:\WINDOWS\system32\cfgmgr32.dll', No symbols loaded.
'Test.exe'': Loaded 'C:\WINDOWS\system32\vfwwdm32.dll', No symbols loaded.
CallbackStatus(500, "text")
CVideoDeviceWin32::DumpCaptureStatus(00000000)
Image width : 176
Image height : 144
Live window? : T
Overlay window? : F
Scaled? : F
Scroll : (0,0)
Using def. palette? : T
Audio hardware? : T
Capture file exists?: T
Current video frame : 0
Video frames dropped: 0
Current wave samples: 0
Time elapsed (ms) : 0
Capturing now : F
# video buffers : 0
# audio buffers : 0
Setting video mode
m_ImageSize.width() 176
m_ImageSize.height() 144
Call TryPalette
CallbackStatus: Reset
CVideoDeviceWin32::DumpCaptureStatus(00000000)
Image width : 176
Image height : 144
Live window? : T
Overlay window? : F
Scaled? : F
Scroll : (0,0)
Using def. palette? : T
Audio hardware? : T
Capture file exists?: T
Current video frame : 0
Video frames dropped: 0
Current wave samples: 0
Time elapsed (ms) : 0
Capturing now : F
# video buffers : 0
# audio buffers : 0
The thread 'Win32 Thread' (0x954) has exited with code 0 (0x0).
CallbackError(418, "text")
TryPalette(32) return F
CallbackError(0, "text")
TryPalette(24) return T
CVideoDeviceWin32::DumpCaptureParms()
uSeconds per frame : 66667
User must hit OK? : F
Percent drop error : 10%
Yield? : F
Index size : 34952
Chunk Granularity : 0
Using DOS memory? : F
Buffers requested : 5
Capture Audio? : T
Audio buffers : 4
Abort key :x1b
Abort left mouse? : T
Abort right mouse? : T
Limit enabled? : F
Time limit : 0
MCI Controlled? : F
Step MCI device? : F
MCI start time : 0
MCI stop time : 0
Double resolution? : F
Average capture step: 0
Audio buffer size : 0
Disable write cache?: F
Stream Master : 0
First-chance exception at 0x65100c40 (QtGuid4.dll) in Test.exe': 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x65100c40 (QtGuid4.dll) in Test.exe': 0xC0000005: Access violation reading location 0x00000000.
The program '[904] Test.exe': Native' has exited with code 0 (0x0).

Please help me...

jpn
19th December 2007, 13:31
What's the content of Debug->Windows->Call Stack?

sabeesh
19th December 2007, 13:42
Hi,
Please see the attachmenet file

jpn
19th December 2007, 14:16
In CCamPanel::paintEvent(), how is the image constructed you're attempting to paint?

sabeesh
21st December 2007, 04:51
Hi,
Yes, I create that image in another location and paste it in that location

sabeesh
21st December 2007, 07:38
Hi,
This is my code for capture the image from Web camera


m_Palette = 0;
// Open handle in an invisible window
m_CapHandle = capCreateCaptureWindow((LPTSTR)"Capture Window",
#if 1
0,
0, 0, 160, 120,
#else
WS_BORDER | WS_VISIBLE,
0, 0, 320, 240,
#endif
(HWND) 0, 0);



if (!m_CapHandle) {
qWarning("Could not create capwindow handle.");
}
else {
// Connect to capture device
if (capDriverConnect(m_CapHandle, m_CapIndex)) {

// Register; this will make sure we are being callbacked (if you will excuse the grammar...)
CVideoCollector::Instance((QWidget *) m_CapHandle)->RegisterDevice(m_CapHandle, this);

ret = true;

// Get the size of the video format structure & allocate memory
m_BMISize = capGetVideoFormatSize(m_CapHandle);
assert(m_BMISize > 0);
m_pBMIBuf = new uchar[m_BMISize];
m_pVideoInfo = (BITMAPINFO *)m_pBMIBuf;

// Get the actual format structure; It contains width, height, and
// 'compression' info
if (capGetVideoFormat(m_CapHandle, m_pBMIBuf, m_BMISize)) {
qDebug("Got VideoFormat, struct size = %d", m_BMISize);
DumpVideoFormat(m_pVideoInfo);
}
else
qDebug("capGetVideoFormat failed.");

// Get initial capture status
capGetStatus(m_CapHandle, &m_CaptureStatus, sizeof(m_CaptureStatus));
m_ImageSize.setWidth(m_CaptureStatus.uiImageWidth) ;
m_ImageSize.setHeight(m_CaptureStatus.uiImageHeigh t);
}
else {
qWarning("Failed to connect to capDriver %d", m_CapIndex);
DestroyWindow(m_CapHandle);
m_CapHandle = 0;
}
}

With these date I need to create an image. How can I do it ?
Please help me...

jpn
21st December 2007, 09:13
I don't see a single reference to QImage. How is the QImage constructed?

PS. Use [code]-tags around code blocks, please.

sabeesh
21st December 2007, 09:27
Hi,
I need to create a QImage from that code. I can do it in Linux and the code in like is like this


struct video_window vwin;
struct video_audio Audio;
QSize RequestedSize;
QDomNode v;
uint i;
const char * TEMP_NODENAME;
TEMP_NODENAME = m_NodeName.toStdString( ).c_str( );
m_CamFD = ::open((const char *) TEMP_NODENAME, O_RDWR);

if (m_CamFD < 0)
return false;

/* Check for Philips cams */
m_HasFramerate = false;

if (m_IntfName.contains ("Philips", Qt::CaseInsensitive )) {
m_HasFramerate = true;
}
else {
struct pwc_probe Probe;

if (ioctl(m_CamFD, VIDIOCPWCPROBE, &Probe) == 0) {
if (m_IntfName == Probe.name) {
m_HasFramerate = true;
} }
}

/* Probe audio functionality */
if (ioctl(m_CamFD, VIDIOCGAUDIO, &Audio) == 0) {
m_Mutable = (Audio.flags & VIDEO_AUDIO_MUTABLE);
if (m_Mutable)
qDebug("Device can be muted (usually TV card).");
}
else
qWarning("Cannot query audio capabilities of video device.");
/* See if device has mmap(); */
m_VMBuf.size = 0;
m_VMBuf.frames = 0;
vid_io_buffer_size = 0;

if (ioctl(m_CamFD, VIDIOCGMBUF, &m_VMBuf) == 0) {
vid_io_buffer_size = m_VMBuf.size;
if (m_RequestedBuffers > 0) {
// User specified a number of buffers; see if we can match that.
if (m_VMBuf.frames < m_RequestedBuffers) {
qWarning("There are more buffers requested than device can provide. Limiting to %d buffers.", m_Buffers);
} else
m_Buffers = m_RequestedBuffers;
}
else // We grab everything we can.
m_Buffers = m_VMBuf.frames;
}
else {
m_VMBuf.size = 0; // Just to be sure....
m_VMBuf.frames = 0;
}

/* See if we can actually mmap() the memory */
if (m_VMBuf.size > 0) {
vid_io_buffer = (uchar *)mmap(NULL, vid_io_buffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, m_CamFD, 0);
if (vid_io_buffer == (uchar *)-1) {
qWarning("mmap() failed (%d). Falling back to non-mmap()ed mode.", errno);
m_VMBuf.size = 0;
vid_io_buffer = NULL;
}
else {
vid_io_offsets.resize(m_Buffers);
for (i = 0; i < m_Buffers; i++)
vid_io_offsets[i] = m_VMBuf.offsets[i];
} }

if (m_VMBuf.size == 0) { // No mmap or failed: allocate a buffer
m_Buffers = m_RequestedBuffers;
if (m_Buffers < 0)
m_Buffers = 4; // In case the user didn't specify a buffer size, we make one.
vid_io_buffer_size = m_Buffers * m_MaxSize.width() * m_MaxSize.height() * 4;
vid_io_buffer = new uchar[vid_io_buffer_size];
vid_io_offsets.resize(m_Buffers);
for (i = 0; i < m_Buffers; i++)
vid_io_offsets[i] = i * m_MaxSize.width() * m_MaxSize.height() * 4;
}

if (vid_io_buffer == NULL) {
qWarning("Failed to mmap/malloc memory!");
return false;
}
// Try to set default image size (from config)
memset(&vwin, 0, sizeof(vwin));
RequestedSize = m_pSettings->GetSize();

if (!RequestedSize.isNull()) {
vwin.width = RequestedSize.width();
vwin.height = RequestedSize.height();
if (m_HasFramerate) {
vwin.flags |= (m_pSettings->GetFramerate() << PWC_FPS_SHIFT) & PWC_FPS_FRMASK;
}

if (ioctl(m_CamFD, VIDIOCSWIN, &vwin) < 0) {
qWarning("Failed to restore image size (%d, %d)", vwin.width, vwin.height);
}
}

// Query current image size
if (ioctl(m_CamFD, VIDIOCGWIN, &vwin) < 0) {
qWarning("Failed to query current image size.");
}
else {
m_ImageSize.setWidth(vwin.width);
m_ImageSize.setHeight(vwin.height);
if (m_HasFramerate)
{
m_Framerate = (vwin.flags & PWC_FPS_FRMASK) >> PWC_FPS_SHIFT;
qDebug("Initial image size = (%d, %d), framerate = %d", vwin.width, vwin.height, m_Framerate);
}
}

// Restore brightness, contrast, etc.
m_VPic.brightness = m_pSettings->GetBrightness();
m_VPic.contrast = m_pSettings->GetContrast();
m_VPic.colour = m_pSettings->GetSaturation();
m_VPic.hue = m_pSettings->GetHue();
m_VPic.whiteness = m_pSettings->GetGamma();

if (ioctl(m_CamFD, VIDIOCSPICT, &m_VPic) < 0)
qWarning("Failed to restore video controls.");

// Restore input/tuner
SetInput(m_CurrentVideoInput);
SetTuner(m_CurrentTuner);
return true;
]

and from another function I create the QImage like this

[
CreateImagesRGB()
{
int w, h;
uint u;
QImage *CImage;
m_RGB.resize(m_Buffers);
w = m_ImageSize.width();
h = m_ImageSize.height();

if (m_Palette == VIDEO_PALETTE_RGB32) {
// This is easy... map directly onto images
for (u = 0; u < m_Buffers; u++) {
m_RGB.insert(u, *(new QImage(vid_io_buffer + vid_io_offsets[u], w, h, QImage::Format_RGB32)));
} }
else {
for (u = 0; u < m_Buffers; u++) {
CImage = new QImage(w, h, QImage::Format_RGB32);
m_RGB.insert(u, *CImage);
}
} }

and it is working.
I need to create the same in Windows.
Please help me..

high_flyer
21st December 2007, 11:33
the conversation code to QImage should stay the same.
The only difference between windows and linux is in the sections that deal with the hardware/driver (the ioctl() calls).
But that is something you need to look up with the respective hardware drivers under windows, it has nothing to do with Qt.

jpn
21st December 2007, 18:10
Excuse me, but perhaps you should divide the problem into a bit smaller pieces or something? Honestly, it's kind of rude to expect anyone to start interpreting that. :)

PS. A proper indentation alone would make the code much more readable.





[...]
for (u = 0; u < m_Buffers; u++) {
m_RGB.insert(u, *(new QImage(vid_io_buffer + vid_io_offsets[u], w, h, QImage::Format_RGB32)));
}
[...]
for (u = 0; u < m_Buffers; u++) {
CImage = new QImage(w, h, QImage::Format_RGB32);
m_RGB.insert(u, *CImage);
}
[...]


Notice that QImage is an implicitly shared class (http://doc.trolltech.com/latest/shared.html#implicit-data-sharing)...