S
sysmatrix
Guest
I have a program keeps throwing out exceptions on Windows 2012 and Windows 2016. The codes were migrated from VS 2010 to VS 2017 - No change in codes as VS successfully migrate the project. The codes were compiled to 64-bits as it used to be in VS 2010.
When run the EXE it throws out exceptions immediately. Is anything I need to fix or add parameters to recompile ?
The debugger told me the code now fails on ULongToPtr()
thread_context->m_arg_list[ count ] = (UINT) PtrToUlong((void*)new char[ str_len + 1 ]);
Failed -> strcpy((char *)UlongToPtr(thread_context->m_arg_list[count++]), string_array[index]);
"Unhandled exception at 0x00007FFEBFB213ED (ucrtbase.dll) in eTskEil.exe: 0xC0000005: Access violation writing location 0x0000000040043D10."
Run in DOS prompt
<!-- -->
<!-- Exception parameters -->
<!-- -->
<time> 02/26/2019 11:20:24 </time>
<parent> XXXXX.exe </parent>
<threadId> XXXX6 </threadId>
<Build> 1355 </Build>
<HandleCount> 90 </HandleCount>
<GdiObjects> 4 </GdiObjects>
<UserObjects> 1 </UserObjects>
<code> c0000005 (ACCESS_VIOLATION) </code>
<address> 00007FFB97257D12 01:00016D12 </address>
<flags> 00000000 </flags>
<param0> 0000000000000001 </param0>
<param1> 000000003DA3A500 (Address accessed) </param1>
<!-- -->
<!-- Loaded modules (start,end,time,checksum, name) -->
<!-- -->
<module> 00007FF646BD0000, 00007FF646D52000, Thu Feb 21 09:43:47 2019, 00000
00, XXXXX.exe </module>
<module> 00007FFA23740000, 00007FFA238ED000, Thu Sep 14 09:40:43 2017, 001ad
bf, C:\Windows\SYSTEM32\ntdll.dll </module>
<module> 00007FFA23580000, 00007FFA236BE000, Tue Oct 28 22:45:30 2014, 00140
ec, C:\Windows\system32\KERNEL32.DLL </module>
<module> 00007FFA20C60000, 00007FFA20D75000, Sun Apr 16 05:21:24 2017, 00117
62, C:\Windows\system32\KERNELBASE.dll </module>
<module> 00007FFA01950000, 00007FFA01EDC000, Wed Nov 7 13:48:59 2018, 0058a
3d, C:\Windows\SYSTEM32\mfc140.dll </module>
<module> 00007FFA20DD0000, 00007FFA20F47000, Wed Nov 9 12:49:59 2016, 00187
a8, C:\Windows\system32\USER32.dll </module>
<module> 00007FFA23370000, 00007FFA2341A000, Wed Sep 6 10:14:56 2017, 000b2
56, C:\Windows\system32\ADVAPI32.dll </module>
<module> 00007FFA22FB0000, 00007FFA23144000, Sun Apr 16 02:54:07 2017, 0019f
af, C:\Windows\system32\ole32.dll </module>
<module> 00007FFA213F0000, 00007FFA214B6000, Sun Apr 16 03:33:35 2017, 000cd
d5, C:\Windows\system32\OLEAUT32.dll </module>
<module> 00007FFA22F90000, 00007FFA22FA6000, Tue Oct 28 21:21:18 2014, 0001d
bb, C:\Windows\system32\imagehlp.dll </module>
<module> 00007FFA20F50000, 00007FFA20FAA000, Fri May 13 17:58:43 2016, 0005c
24, C:\Windows\system32\WS2_32.dll </module>
<module> 00007FFA15100000, 00007FFA15115000, Wed Nov 7 13:35:37 2018, 00017
21, C:\Windows\SYSTEM32\VCRUNTIME140.dll </module>
<module> 00007FFA091A0000, 00007FFA091A4000, Tue Jul 14 21:27:26 2015, 0000f
a2, C:\Windows\SYSTEM32\api-ms-win-crt-string-l1-1-0.dll </module>
<module> 00007FFA09190000, 00007FFA09194000, Tue Jul 14 21:27:25 2015, 00013
e8, C:\Windows\SYSTEM32\api-ms-win-crt-stdio-l1-1-0.dll </module>
<module> 00007FFA09180000, 00007FFA09183000, Tue Jul 14 21:27:26 2015, 0000b
da, C:\Windows\SYSTEM32\api-ms-win-crt-heap-l1-1-0.dll </module>
<module> 00007FFA08F60000, 00007FFA08F64000, Tue Jul 14 21:27:26 2015, 0000b
fc, C:\Windows\SYSTEM32\api-ms-win-crt-convert-l1-1-0.dll </module>
<module> 00007FFA08F50000, 00007FFA08F53000, Tue Jul 14 21:27:26 2015, 00010
9b, C:\Windows\SYSTEM32\api-ms-win-crt-time-l1-1-0.dll </module>
<module> 00007FFA08F40000, 00007FFA08F44000, Tue Jul 14 21:27:26 2015, 0000a
4d, C:\Windows\SYSTEM32\api-ms-win-crt-runtime-l1-1-0.dll </module>
<module> 00007FFA08F30000, 00007FFA08F33000, Tue Jul 14 21:27:25 2015, 0000a
86, C:\Windows\SYSTEM32\api-ms-win-crt-filesystem-l1-1-0.dll </module>
<module> 00007FFA07B10000, 00007FFA07B15000, Tue Jul 14 21:27:25 2015, 00013
16, C:\Windows\SYSTEM32\api-ms-win-crt-multibyte-l1-1-0.dll </module>
<module> 00007FFA07B00000, 00007FFA07B03000, Tue Jul 14 21:27:26 2015, 0000d
73, C:\Windows\SYSTEM32\api-ms-win-crt-utility-l1-1-0.dll </module>
<module> 00007FFA02720000, 00007FFA02725000, Tue Jul 14 21:27:26 2015, 00014
29, C:\Windows\SYSTEM32\api-ms-win-crt-math-l1-1-0.dll </module>
<module> 00007FFA02550000, 00007FFA02553000, Tue Jul 14 21:27:25 2015, 0000b
dc, C:\Windows\SYSTEM32\api-ms-win-crt-locale-l1-1-0.dll </module>
<module> 00007FFA01940000, 00007FFA01943000, Tue Jul 14 21:27:26 2015, 00005
c1, C:\Windows\SYSTEM32\api-ms-win-crt-environment-l1-1-0.dll </module>
<module> 00007FFA21670000, 00007FFA217BB000, Fri Sep 8 13:13:16 2017, 00150
9b, C:\Windows\system32\GDI32.dll </module>
<module> 00007FFA21310000, 00007FFA21364000, Tue Oct 28 20:52:51 2014, 0005b
27, C:\Windows\system32\SHLWAPI.dll </module>
<module> 00007FFA22E30000, 00007FFA22E66000, Tue Oct 28 21:23:43 2014, 0003a
b5, C:\Windows\system32\IMM32.dll </module>
<module> 00007FFA1F530000, 00007FFA1F659000, Tue Oct 10 12:39:30 2017, 00128
f2, C:\Windows\SYSTEM32\UxTheme.dll </module>
<module> 00007FFA21260000, 00007FFA2130A000, Tue Oct 28 22:50:38 2014, 000b0
b4, C:\Windows\system32\msvcrt.dll </module>
<module> 00007FFA21380000, 00007FFA213D9000, Fri Mar 20 00:08:34 2015, 00062
fd, C:\Windows\SYSTEM32\sechost.dll </module>
<module> 00007FFA22CF0000, 00007FFA22E30000, Thu Mar 31 00:13:42 2016, 0014f
8a, C:\Windows\system32\RPCRT4.dll </module>
<module> 00007FFA23150000, 00007FFA23362000, Sun Apr 16 03:41:51 2017, 0021b
31, C:\Windows\SYSTEM32\combase.dll </module>
<module> 00007FFA21370000, 00007FFA21379000, Tue Oct 28 22:48:43 2014, 00007
6b, C:\Windows\system32\NSI.dll </module>
<module> 00007FFA23420000, 00007FFA23571000, Sat Sep 9 12:16:52 2017, 00152
3d, C:\Windows\system32\MSCTF.dll </module>
<module> 00007FFA20BD0000, 00007FFA20BFE000, Tue Oct 28 21:29:54 2014, 0002c
2a, C:\Windows\system32\SspiCli.dll </module>
<module> 00007FFA01840000, 00007FFA01934000, Tue Sep 5 03:19:44 2017, 000ff
89, C:\Windows\SYSTEM32\ucrtbase.DLL </module>
<module> 00007FFA01790000, 00007FFA01834000, Fri Apr 24 22:34:22 2015, 000a1
4e, C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_
.82.9600.17810_none_34ae2abd958aedeb\Comctl32.dll </module>
<module> 00007FFA1F690000, 00007FFA1F69B000, Tue Oct 28 21:27:02 2014, 00014
cc, C:\Windows\SYSTEM32\kernel.appcore.dll </module>
<module> 00007FFA015F0000, 00007FFA01779000, Tue Mar 31 23:45:14 2015, 00178
26, C:\Windows\system32\dbghelp.dll </module>
<!-- -->
<!-- Call stack information -->
<!-- -->
<frame>
<pc> 00007FFA01857D12, strcpy+22 (C:\Windows\SYSTEM32\ucrtbase.DLL) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
<frame>
<pc> 00007FF646C986A7 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C9F32C (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C87005 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C8305E (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646CBFF18 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FFA235813D2, BaseThreadInitThunk+22 (C:\Windows\system32\KERNEL3
.DLL) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
<frame>
<pc> 00007FFA237554F4, RtlUserThreadStart+34 (C:\Windows\SYSTEM32\ntdll.dl
) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
/exception>
Continue reading...
When run the EXE it throws out exceptions immediately. Is anything I need to fix or add parameters to recompile ?
The debugger told me the code now fails on ULongToPtr()
thread_context->m_arg_list[ count ] = (UINT) PtrToUlong((void*)new char[ str_len + 1 ]);
Failed -> strcpy((char *)UlongToPtr(thread_context->m_arg_list[count++]), string_array[index]);
"Unhandled exception at 0x00007FFEBFB213ED (ucrtbase.dll) in eTskEil.exe: 0xC0000005: Access violation writing location 0x0000000040043D10."
Run in DOS prompt
<!-- -->
<!-- Exception parameters -->
<!-- -->
<time> 02/26/2019 11:20:24 </time>
<parent> XXXXX.exe </parent>
<threadId> XXXX6 </threadId>
<Build> 1355 </Build>
<HandleCount> 90 </HandleCount>
<GdiObjects> 4 </GdiObjects>
<UserObjects> 1 </UserObjects>
<code> c0000005 (ACCESS_VIOLATION) </code>
<address> 00007FFB97257D12 01:00016D12 </address>
<flags> 00000000 </flags>
<param0> 0000000000000001 </param0>
<param1> 000000003DA3A500 (Address accessed) </param1>
<!-- -->
<!-- Loaded modules (start,end,time,checksum, name) -->
<!-- -->
<module> 00007FF646BD0000, 00007FF646D52000, Thu Feb 21 09:43:47 2019, 00000
00, XXXXX.exe </module>
<module> 00007FFA23740000, 00007FFA238ED000, Thu Sep 14 09:40:43 2017, 001ad
bf, C:\Windows\SYSTEM32\ntdll.dll </module>
<module> 00007FFA23580000, 00007FFA236BE000, Tue Oct 28 22:45:30 2014, 00140
ec, C:\Windows\system32\KERNEL32.DLL </module>
<module> 00007FFA20C60000, 00007FFA20D75000, Sun Apr 16 05:21:24 2017, 00117
62, C:\Windows\system32\KERNELBASE.dll </module>
<module> 00007FFA01950000, 00007FFA01EDC000, Wed Nov 7 13:48:59 2018, 0058a
3d, C:\Windows\SYSTEM32\mfc140.dll </module>
<module> 00007FFA20DD0000, 00007FFA20F47000, Wed Nov 9 12:49:59 2016, 00187
a8, C:\Windows\system32\USER32.dll </module>
<module> 00007FFA23370000, 00007FFA2341A000, Wed Sep 6 10:14:56 2017, 000b2
56, C:\Windows\system32\ADVAPI32.dll </module>
<module> 00007FFA22FB0000, 00007FFA23144000, Sun Apr 16 02:54:07 2017, 0019f
af, C:\Windows\system32\ole32.dll </module>
<module> 00007FFA213F0000, 00007FFA214B6000, Sun Apr 16 03:33:35 2017, 000cd
d5, C:\Windows\system32\OLEAUT32.dll </module>
<module> 00007FFA22F90000, 00007FFA22FA6000, Tue Oct 28 21:21:18 2014, 0001d
bb, C:\Windows\system32\imagehlp.dll </module>
<module> 00007FFA20F50000, 00007FFA20FAA000, Fri May 13 17:58:43 2016, 0005c
24, C:\Windows\system32\WS2_32.dll </module>
<module> 00007FFA15100000, 00007FFA15115000, Wed Nov 7 13:35:37 2018, 00017
21, C:\Windows\SYSTEM32\VCRUNTIME140.dll </module>
<module> 00007FFA091A0000, 00007FFA091A4000, Tue Jul 14 21:27:26 2015, 0000f
a2, C:\Windows\SYSTEM32\api-ms-win-crt-string-l1-1-0.dll </module>
<module> 00007FFA09190000, 00007FFA09194000, Tue Jul 14 21:27:25 2015, 00013
e8, C:\Windows\SYSTEM32\api-ms-win-crt-stdio-l1-1-0.dll </module>
<module> 00007FFA09180000, 00007FFA09183000, Tue Jul 14 21:27:26 2015, 0000b
da, C:\Windows\SYSTEM32\api-ms-win-crt-heap-l1-1-0.dll </module>
<module> 00007FFA08F60000, 00007FFA08F64000, Tue Jul 14 21:27:26 2015, 0000b
fc, C:\Windows\SYSTEM32\api-ms-win-crt-convert-l1-1-0.dll </module>
<module> 00007FFA08F50000, 00007FFA08F53000, Tue Jul 14 21:27:26 2015, 00010
9b, C:\Windows\SYSTEM32\api-ms-win-crt-time-l1-1-0.dll </module>
<module> 00007FFA08F40000, 00007FFA08F44000, Tue Jul 14 21:27:26 2015, 0000a
4d, C:\Windows\SYSTEM32\api-ms-win-crt-runtime-l1-1-0.dll </module>
<module> 00007FFA08F30000, 00007FFA08F33000, Tue Jul 14 21:27:25 2015, 0000a
86, C:\Windows\SYSTEM32\api-ms-win-crt-filesystem-l1-1-0.dll </module>
<module> 00007FFA07B10000, 00007FFA07B15000, Tue Jul 14 21:27:25 2015, 00013
16, C:\Windows\SYSTEM32\api-ms-win-crt-multibyte-l1-1-0.dll </module>
<module> 00007FFA07B00000, 00007FFA07B03000, Tue Jul 14 21:27:26 2015, 0000d
73, C:\Windows\SYSTEM32\api-ms-win-crt-utility-l1-1-0.dll </module>
<module> 00007FFA02720000, 00007FFA02725000, Tue Jul 14 21:27:26 2015, 00014
29, C:\Windows\SYSTEM32\api-ms-win-crt-math-l1-1-0.dll </module>
<module> 00007FFA02550000, 00007FFA02553000, Tue Jul 14 21:27:25 2015, 0000b
dc, C:\Windows\SYSTEM32\api-ms-win-crt-locale-l1-1-0.dll </module>
<module> 00007FFA01940000, 00007FFA01943000, Tue Jul 14 21:27:26 2015, 00005
c1, C:\Windows\SYSTEM32\api-ms-win-crt-environment-l1-1-0.dll </module>
<module> 00007FFA21670000, 00007FFA217BB000, Fri Sep 8 13:13:16 2017, 00150
9b, C:\Windows\system32\GDI32.dll </module>
<module> 00007FFA21310000, 00007FFA21364000, Tue Oct 28 20:52:51 2014, 0005b
27, C:\Windows\system32\SHLWAPI.dll </module>
<module> 00007FFA22E30000, 00007FFA22E66000, Tue Oct 28 21:23:43 2014, 0003a
b5, C:\Windows\system32\IMM32.dll </module>
<module> 00007FFA1F530000, 00007FFA1F659000, Tue Oct 10 12:39:30 2017, 00128
f2, C:\Windows\SYSTEM32\UxTheme.dll </module>
<module> 00007FFA21260000, 00007FFA2130A000, Tue Oct 28 22:50:38 2014, 000b0
b4, C:\Windows\system32\msvcrt.dll </module>
<module> 00007FFA21380000, 00007FFA213D9000, Fri Mar 20 00:08:34 2015, 00062
fd, C:\Windows\SYSTEM32\sechost.dll </module>
<module> 00007FFA22CF0000, 00007FFA22E30000, Thu Mar 31 00:13:42 2016, 0014f
8a, C:\Windows\system32\RPCRT4.dll </module>
<module> 00007FFA23150000, 00007FFA23362000, Sun Apr 16 03:41:51 2017, 0021b
31, C:\Windows\SYSTEM32\combase.dll </module>
<module> 00007FFA21370000, 00007FFA21379000, Tue Oct 28 22:48:43 2014, 00007
6b, C:\Windows\system32\NSI.dll </module>
<module> 00007FFA23420000, 00007FFA23571000, Sat Sep 9 12:16:52 2017, 00152
3d, C:\Windows\system32\MSCTF.dll </module>
<module> 00007FFA20BD0000, 00007FFA20BFE000, Tue Oct 28 21:29:54 2014, 0002c
2a, C:\Windows\system32\SspiCli.dll </module>
<module> 00007FFA01840000, 00007FFA01934000, Tue Sep 5 03:19:44 2017, 000ff
89, C:\Windows\SYSTEM32\ucrtbase.DLL </module>
<module> 00007FFA01790000, 00007FFA01834000, Fri Apr 24 22:34:22 2015, 000a1
4e, C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_
.82.9600.17810_none_34ae2abd958aedeb\Comctl32.dll </module>
<module> 00007FFA1F690000, 00007FFA1F69B000, Tue Oct 28 21:27:02 2014, 00014
cc, C:\Windows\SYSTEM32\kernel.appcore.dll </module>
<module> 00007FFA015F0000, 00007FFA01779000, Tue Mar 31 23:45:14 2015, 00178
26, C:\Windows\system32\dbghelp.dll </module>
<!-- -->
<!-- Call stack information -->
<!-- -->
<frame>
<pc> 00007FFA01857D12, strcpy+22 (C:\Windows\SYSTEM32\ucrtbase.DLL) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
<frame>
<pc> 00007FF646C986A7 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C9F32C (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C87005 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646C8305E (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FF646CBFF18 (XXXXX.exe) [000001e7] </pc>
</frame>
<frame>
<pc> 00007FFA235813D2, BaseThreadInitThunk+22 (C:\Windows\system32\KERNEL3
.DLL) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
<frame>
<pc> 00007FFA237554F4, RtlUserThreadStart+34 (C:\Windows\SYSTEM32\ntdll.dl
) </pc>
<source> Source file unknown. Reason 0x1e7 </source>
</frame>
/exception>
Continue reading...