Sign in to follow this  

Support for VS2005?

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Recently, I let VS2005 convert the msvc7 project to vs8. No problem at all! However, when I tried the tutorial example I got an asEXECUTION_EXCEPTION. This happens when the script uses Print(). I guess this is due to the new VS2005 compiler or that I've missed something in my configuration. Any thoughts about this issue would be appreciated. Regards, topcatse

Share this post


Link to post
Share on other sites
OK, I'm glad to hear that it works for you guys!

Unfortunatly, I'm still having the same problem. It's interesting that when I switched back to 2.4.1d the tutorial worked fine but not with 2.5.0a. I will try 2.5.0a on WinXP now to see if I experience the same problem.

Here's some information from a debug session of the tutorial sample if some is interested.

The exception is generated in asCContext::ExecuteNext(), row 2130:
case BC_ChkNullV:
{
// TODO: Pointer size
asDWORD *a = *(asDWORD**)(l_fp - SWORDARG0(l_bc));
if( *a == 0 )
{
byteCode = l_bc;
stackPointer = l_sp;
stackFramePointer = l_fp;

SetInternalException(TXT_NULL_POINTER_ACCESS);
return;
}
}

In AS_DEBUG\__@init.txt
Temps:

0 0 * RET 0

In AS_DEBUG\__calc.txt
Temps: 1, 2, 3, 4, 6, 8

0 0 * PUSH 8
- 4,5 -
1 8 * SUSPEND
2 8 * STR 0 (l:10 s:"Received: ")
3 10 * CALLSYS -27 (string@ ?(int, const uint8))
5 8 * STOREOBJ v1
6 8 * ChkNullV v1
7 8 * VAR v1
8 9 * PshV4 v0
9 10 * SWAP4
10 10 * GETOBJREF 0
11 10 * CALLSYS -44 (string@ ?(const string&in, float))
13 8 * STOREOBJ v2
14 8 * PSF v1
15 9 * FREE 3445752
17 8 * ChkNullV v2
18 8 * VAR v2
19 9 * STR 1 (l:2 s:", ")
20 11 * CALLSYS -27 (string@ ?(int, const uint8))
22 9 * STOREOBJ v1
23 9 * ChkNullV v1
24 9 * VAR v1
25 10 * SWAP4
26 10 * GETOBJREF 0
27 10 * GETOBJREF 1
28 10 * CALLSYS -34 (string@ ?(const string&in, const string&in))
30 8 * STOREOBJ v3
31 8 * PSF v1
32 9 * FREE 3445752
34 8 * PSF v2
35 9 * FREE 3445752
37 8 * ChkNullV v3
38 8 * VAR v3
39 9 * PshV4 v-1
40 10 * SWAP4
41 10 * GETOBJREF 0
42 10 * CALLSYS -44 (string@ ?(const string&in, float))
44 8 * STOREOBJ v1
45 8 * PSF v3
46 9 * FREE 3445752
48 8 * ChkNullV v1
49 8 * VAR v1
50 9 * STR 2 (l:1 s:"
")
51 11 * CALLSYS -27 (string@ ?(int, const uint8))
53 9 * STOREOBJ v2
54 9 * ChkNullV v2
55 9 * VAR v2
56 10 * SWAP4
57 10 * GETOBJREF 0
58 10 * GETOBJREF 1
59 10 * CALLSYS -34 (string@ ?(const string&in, const string&in))
61 8 * STOREOBJ v3
62 8 * PSF v2
63 9 * FREE 3445752
65 8 * PSF v1
66 9 * FREE 3445752
68 8 * ChkNullV v3
69 8 * VAR v3
70 9 * GETOBJREF 0
71 9 * CALLSYS -58 (void Print(string&in))
73 8 * PSF v3
74 9 * FREE 3445752
- 7,5 -
76 8 * SUSPEND
77 8 * STR 3 (l:28 s:"System has")
78 10 * CALLSYS -27 (string@ ?(int, const uint8))
80 8 * STOREOBJ v2
81 8 * ChkNullV v2
82 8 * VAR v2
83 9 * CALLSYS -59 (uint GetSystemTime())
85 9 * CpyRtoV4 v4
86 9 * uTOd v6, v4
88 9 * SetV8 v8, 0x408f400000000000 (i:4652007308841189376, f:1000)
91 9 * DIVd v6, v6, v8
93 9 * PSF v6
94 10 * RDS8
95 11 * SWAP84
96 11 * GETOBJREF 0
97 11 * CALLSYS -40 (string@ ?(const string&in, double))
99 8 * STOREOBJ v3
100 8 * PSF v2
101 9 * FREE 3445752
103 8 * ChkNullV v3
104 8 * VAR v3
105 9 * STR 4 (l:9 s:" seconds
")
106 11 * CALLSYS -27 (string@ ?(int, const uint8))
108 9 * STOREOBJ v1
109 9 * ChkNullV v1
110 9 * VAR v1
111 10 * SWAP4
112 10 * GETOBJREF 0
113 10 * GETOBJREF 1
114 10 * CALLSYS -34 (string@ ?(const string&in, const string&in))
116 8 * STOREOBJ v2
117 8 * PSF v1
118 9 * FREE 3445752
120 8 * PSF v3
121 9 * FREE 3445752
123 8 * ChkNullV v2
124 8 * VAR v2
125 9 * GETOBJREF 0
126 9 * CALLSYS -58 (void Print(string&in))
128 8 * PSF v2
129 9 * FREE 3445752
- 10,5 -
131 8 * SUSPEND
132 8 * MULf v4, v0, v-1
134 8 * CpyVtoR4 v4
135 8 * 0:
135 0 * RET 2

In AS_DEBUG\stats.txt
RET : 1

total : 1

LABEL , RET : 1

PUSH : 1
STR : 1
CALLSYS : 1
SUSPEND : 1
STOREOBJ : 1
ChkNullV : 1

total : 6

PUSH , SUSPEND : 1
STR , CALLSYS : 1
CALLSYS , STOREOBJ : 1
SUSPEND , STR : 1
STOREOBJ , ChkNullV : 1
LABEL , PUSH : 1

In AS_DEBUG\total.txt

Total count
PUSH : 1
RET : 1
STR : 1
CALLSYS : 1
SUSPEND : 1
STOREOBJ : 1
ChkNullV : 1

Never executed
POP
PshC4
PshV4
PSF
SWAP4
NOT
PshG4
LdGRdR4
CALL
JMP
JZ
JNZ
JS
JNS
JP
JNP
TZ
TNZ
TS
TNS
TP
TNP
NEGi
NEGf
NEGd
INCi16
INCi8
DECi16
DECi8
INCi
DECi
INCf
DECf
INCd
DECd
IncVi
DecVi
BNOT
BAND
BOR
BXOR
BSLL
BSRL
BSRA
COPY
SET8
RDS8
SWAP8
CMPd
CMPu
CMPf
CMPi
CMPIi
CMPIf
CMPIu
JMPP
PopRPtr
PshRPtr
CALLBND
ALLOC
FREE
LOADOBJ
GETOBJ
REFCPY
CHKREF
GETOBJREF
GETREF
SWAP48
SWAP84
OBJTYPE
TYPEID
SetV4
SetV8
ADDSi
CpyVtoV4
CpyVtoV8
CpyVtoR4
CpyVtoR8
CpyVtoG4
CpyRtoV4
CpyRtoV8
CpyGtoV4
WRTV1
WRTV2
WRTV4
WRTV8
RDR1
RDR2
RDR4
RDR8
LDG
LDV
PGA
RDS4
VAR
iTOf
fTOi
uTOf
fTOu
sbTOi
swTOi
ubTOi
uwTOi
dTOi
dTOu
dTOf
iTOd
uTOd
fTOd
ADDi
SUBi
MULi
DIVi
MODi
ADDf
SUBf
MULf
DIVf
MODf
ADDd
SUBd
MULd
DIVd
MODd
ADDIi
SUBIi
MULIi
ADDIf
SUBIf
MULIf
SetG4
ChkRefS



Share this post


Link to post
Share on other sites
Looks like the tutorial sample is triggering a bug in the library. It's possible that this is the same bug that I fixed for 2.5.1 WIP 1 (which Villemon found in 2.5.0a). You could try the WIP version, if you want. It should be backwards-compatible with version 2.5.0a.

I will be releasing a new version of 2.5.0 with the bug fix, when I get the chance to actually make sure that the fix corrects the problem.

Share this post


Link to post
Share on other sites
After installing Microsoft Visual C++ 2005 Express edition, I've finally been able to reproduce the bug. It's strange that the problem doesn't show on MSVC6, but I guess Microsoft changed the implementation of the std::string object.

After some preliminary testing it seems the BC_ChkNullV has a bug in it. It shouldn't check the value that 'a' points to, but the value of 'a' itself.


case BC_ChkNullV:
{
// TODO: Pointer size
asDWORD *a = *(asDWORD**)(l_fp - SWORDARG0(l_bc));
if( a == 0 )
{


Making this change makes the tutorial work perfectly. However it seems to be breaking some other things, that I'm studying right this moment.

I'll be back with more info when I can.

Share this post


Link to post
Share on other sites
Sure it does. If the iterator happens to be a pointer. There is nothing in the standard that says std::string::iterator is a char*.

Share this post


Link to post
Share on other sites
Did I miss something? Who mentioned iterators?

Anyway, I've confirmed that the above fix is correct. However, by installing VS2005 I also discovered various other bugs in the library related to memory management. It seems that Microsoft improved the debug memory manager to more easily catch writes to already deallocated memory blocks.

I've fixed most of them, but I'll do some more testing in order to verify if there are more bugs hiding in the code.

Hopefully I'll be able to release 2.5.0b (and eventually 2.4.1e) later this week with all the bugs fixed.

Regards,
Andreas

Share this post


Link to post
Share on other sites

This topic is 4334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this