Mailing List Archive

Debug or Execute program show an error Run-Time Check Failure #3 - The variable 'm' is being used without being initialized.
Hello All,

After i built code of clamscan success, Visual Studio v.2010
debug by pass "-dC:\clamav-dev\win32\Win32\Debug\database\
C:\clamav-dev\win32\Win32\Debug\clamav_unittest\test\clam-upack.exe"
command line message in order to scan file clam-upack.exe. Program show
error as below.

'clamscan.exe': Loaded 'C:\clamav-dev\win32\Win32\Debug\clamscan.exe',
Symbols loaded.
'clamscan.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open
the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\clamav-dev\win32\Win32\Debug\libclamav.dll',
Symbols loaded.
'clamscan.exe': Loaded 'C:\Windows\System32\ws2_32.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\nsi.dll', Cannot find or open
the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'clamscan.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'clamscan.exe': Loaded 'C:\Windows\System32\psapi.dll', Cannot find or open
the PDB file
'clamscan.exe': Loaded 'C:\Windows\System32\dbghelp.dll', Cannot find or
open the PDB file
'clamscan.exe': Loaded
'C:\clamav-dev\win32\Win32\Debug\libclamunrar_iface.dll', Symbols loaded.
'clamscan.exe': Loaded 'C:\clamav-dev\win32\Win32\Debug\libclamunrar.dll',
Symbols loaded.
Run-Time Check Failure #3 - The variable 'm' is being used without being
initialized.
First-chance exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.
Unhandled exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.
First-chance exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.
Unhandled exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.
First-chance exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.
Unhandled exception at 0x1046468e (libclamav.dll) in clamscan.exe:
0xC0000005: Access violation reading location 0xcccccd1c.

I not sure, Why "m" variable not initializes in with function
"fmap_check_empty(int fd, long offset, unsigned int len, int * empty) Line
138 + 0x13 bytes C"? I copy a stack traces call of function when clamscan
depend on debug mode.You should see below.

" if(!(mh = CreateFileMapping(m->fh, NULL, PAGE_READONLY,
(DWORD)((len>>31)>>1), (DWORD)len, NULL))) { "

> libclamav.dll!fmap_check_empty(int fd, long offset, unsigned int len, int
* empty) Line 138 + 0x13 bytes C
libclamav.dll!fmap(int fd, long offset, unsigned int len) Line 717 +
0x15 bytes C
libclamav.dll!cli_magic_scandesc(int desc, cli_ctx_tag * ctx) Line 2613
+ 0xf bytes C
libclamav.dll!scan_common(int desc, cl_fmap * map, const char * *
virname, unsigned long * scanned, const cl_engine * engine, unsigned int
scanoptions, void * context) Line 2735 + 0x34 bytes C
libclamav.dll!cl_scandesc_callback(int desc, const char * * virname,
unsigned long * scanned, const cl_engine * engine, unsigned int
scanoptions, void * context) Line 2748 + 0x1f bytes C
clamscan.exe!scanfile(const char * filename, cl_engine * engine, const
optstruct * opts, unsigned int options) Line 293 + 0x21 bytes C
clamscan.exe!scanmanager(const optstruct * opts) Line 849 + 0x18 bytes C
clamscan.exe!real_main(int argc, char * * argv) Line 150 + 0x9 bytes C
clamscan.exe!main(int argc, char * * argv) Line 58 + 0x75 bytes C
clamscan.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
clamscan.exe!mainCRTStartup() Line 371 C

Best Regards,
Chatsiri Rattana
--
:--------------------------------------------------------
http://about.me/chatsiri.ratana
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: Debug or Execute program show an error Run-Time Check Failure #3 - The variable 'm' is being used without being initialized. [ In reply to ]
On 1/22/12 6:40 AM, Chatsiri Ratana wrote:
> Hello All,
>
> After i built code of clamscan success, Visual Studio v.2010

Can you please update to latest master and try again?

--aCaB

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net