Subj : Re: memory error causing undefined value has no properties To : , , From : Wong.Yung@inet.polyu.edu.hk (Wong Yung [SMILE]) Date : Sun Jan 26 2003 02:22 pm Hello Igor, The problem I described is under 1.5R3. I have not yet tried 1.5R2. I will try to run the script under 1.5R4 in these few days. regards, yung >>> Igor Bukanov 01/24/03 08:39PM >>> To determine if it is a Rhino or JVM bug , could you try to run you=20 scripts with Rhino 1.5R2, 1.5R3 and a release candidate for 1.5R4? Regards, Igor wyx wrote: > hello all, > I use rhino and written a js to calculate some statistic. > In my js file, I used array of javascript object > and also a few array of string and integer. >=20 > So I have a lof of "for/loop" as I need to iterate the values. >=20 > originally, I use "for(var in..)" for each array. > On SunBlade 100 with jdk 1.3.1_04-b02, the js program works fine=20 > and no error. >=20 > however, after I deployed my js to E280 with jdk 1.3.1-b24, it will > some time show the "undefined value has no properties" error. > But this error seems showing randomly, becuase I apply the same set of = data, > sometime it will show the error, sometime it will not. >=20 > And lastly, I added some system.out.println in the js file. > and I found that in the "for(var in...)" loop, sometime it will skip > some index and then error thrown. > eg.=20 > idx=3D151, print something > idx=3D153, print something >=20 > then error thrown. idx=3D152 was skipped. >=20 > Then after a pain investigation, I replace all the > "for(var in...)" loop by "for(var x=3D0; x then the "undefined value..." error never show up. >=20 > I use interpret mode (optimization=3D-1). >=20 > But so bad is that, there is some memory reference error. > I don't know why sometime, some interger value will be refered > with some garbage. eg. 4.: > So I added the follow line to check it. >=20 > if( parseInt(itemTCount[tt].tCount) !=3D itemTCount[tt].tCount) > java.lang.System.out.println("Error item:["+itemTCount[tt].tCount = +"]"); >=20 > What I expect is some string print out. > But so strange that it print something like > Error item:[130] >=20 > so....if the value is 130, then how can it be printed out? >=20 > so..I think there maybe some memory reference error for rhino when > it need to do complicated calculation or has many objects in the scope. >=20 > hope some can help! >=20 > yung .