Page 1 of 1

strange errors

Posted: Mon Feb 21, 2005 11:13 am
by AXEmonster
Hi Guys

i am writing a system in PHP (LAMP) and the users are reporting intermittent errors.

if they get an error and they refresh the page it sorts its self out (although after a few refreshes the browser hangs)


the error takes the form of rubbish being printed to the page, values and data are interpreted incorectly (strike through text and wierd symbols)

i asked them to send the source and this is what was returned

i have noticed that numbers are being written to the document (left aligned as if its an empty file and in the middle of functions, table tags etc)
i have indicated the numbers with a trailing hash e.g a5#, 191#, 192#, 190#.

any ideas

Code: Select all

a5#
<html>
<head>
<title>Summary</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="PIP.css" rel="stylesheet" type="text/css">

2#
<s
191#
cript language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) &#123;  //reloads the window if Nav4 resized
  if (init==true) with (navigator) &#123;if ((appName=="Netscape")&&(parseInt(appVersion)==4)) &#123;
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; &#125;&#125;
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
&#125;
MM
192#
_reloadPage(true);

function MM_findObj(n, d) &#123; //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) &#123;
    d=parent.frames&#1111;n.substring(p+1)].document; n=n.substring(0,p);&#125;
  if(!(x=d&#1111;n])&&d.all) x=d.all&#1111;n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms&#1111;i]&#1111;n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers&#1111;i].document);
  if(!x && d.getElement
191#
ById) x=d.getElementById(n); return x;
&#125;

function MM_showHideLayers() &#123; //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args&#1111;i]))!=null) &#123; v=args&#1111;i+2];
    if (obj.style) &#123; obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; &#125;
    obj.visibility=v; &#125;
&#125;

function tmt_winPrint(id)&#123; 
	if(window.print())&#123;
	var d=eval(id)==nul
190#
l||eval(id+".closed");
	if(!d)&#123;eval(id+".print()");&#125;&#125;
&#125;

function MM_timelinePlay(tmLnName, myID) &#123; //v1.2
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time&#1111;tmLnName];
  i
191#
f (myID == null) &#123; myID = ++tmLn.ID; firstTime=true;&#125;//if new call, incr ID
  if (myID == tmLn.ID) &#123; //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) &#123;
      sprite = tmLn&#1111;i];
      if (sprite.charAt(0) == 's') &#123;
        if (sprite.obj) &#123;
          numKeyFr = sprite.keyFrames.length; firstKeyFr = spri
94#
te.keyFrames&#1111;0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames&#1111;numKeyFr-1]) &#123;//in range
            keyFrm=1;
            for (j=0; j
2
<s
191#
prite.values.length; j++) &#123;
              props = sprite.values&#1111;j]; 
              if (numKeyFr != props.length) &#123;
                if (props.prop2 == null) sprite.obj&#1111;props.prop] = props&#1111;fNew-firstKeyFr];
                else        sprite.obj&#1111;props.prop2]&#1111;props.prop] = props&#1111;fNew-firstKeyFr];
              &#125; else &#123;
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames&#1111;keyFrm]) keyFrm++;
190#

                if (firstTime || fNew==sprite.keyFrames&#1111;keyFrm-1]) &#123;
                  if (props.prop2 == null) sprite.obj&#1111;props.prop] = props&#1111;keyFrm-1];
                  else        sprite.obj&#1111;props.prop2]&#1111;props.prop] = props&#1111;keyFrm-1];
        &#125; &#125; &#125; &#125; &#125;
      &#125; else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  &#125; &#125;
&#125;

fun
190#
ction MM_timelineGoto(tmLnName, fNew, numGotos) &#123; //v2.0
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time&#1111;tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmL
191#
n.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) &#123;tmLn.gotoCount=0; return&#125;
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) &#123;
    sprite = (jmpFwd)? tmLn&#1111;i] : tmLn&#1111;(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") &#123;
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames&#1111;0];
      lastKeyFr = sprite.keyFrames&#1111;n
d5#
umKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames&#1111;keyFrm]; keyFrm++);
      for (j=0; j
2
<s
190#
prite.values.length; j++) &#123;
        props = sprite.values&#1111;j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) &#123;
          if (props.prop2 == null) sprite.obj&#1111;props.prop] = props&#1111;propNum];
          else        sprite.obj&#1111;props.prop2]&#1111;props.
190#
prop] = props&#1111;propNum];
      &#125; &#125;
    &#125; else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  &#125;
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
&#125;

function MM_timelineStop(tmLnName) &#123; //v1.2
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  if (document.MM_Time == null) MM_initTimelines(); //if *ver
191#
y* 1st time
  if (tmLnName == null)  //stop all
    for (var i=0; i<document.MM_Time.length; i++) document.MM_Time&#1111;i].ID = null;
  else document.MM_Time&#1111;tmLnName].ID = null; //stop one
&#125;

function MM_initTimelines() &#123; //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) 
190#
== 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    document.MM_Time = new Array(1);
    document.MM_Time&#1111;0] = new Array(5);
    document.MM_Time&#1111;"Timeline1"] = document.MM_Time&#1111;0];
    document.MM_Time&#1111;0].MM_Name = "Timeline1";
    document.MM_Time&#1111;0].fps = 15;
    document.MM_Time&#1111;0]&#1111;0] = new String("behavior");
    document.MM_Time&#1111;0]&#1111;0].frame = 5;
    document.MM_Time&#1111;0]&#1111;0].va
190#
lue = "tmt_winPrint('self')";
    document.MM_Time&#1111;0]&#1111;1] = new String("behavior");
    document.MM_Time&#1111;0]&#1111;1].frame = 30;
    document.MM_Time&#1111;0]&#1111;1].value = "MM_showHideLayers('prnt','','show')";
    document.MM_Time&#1111;0]&#1111;2] = new String("behavior");
    document.MM_Time&#1111;0]&#1111;2].frame = 45;
    document.MM_Time&#1111;0]&#1111;2].value = "MM_timelineGoto('Timeline1','1')";
    document.MM_Time&#1111;0]&#1111;3] = new String("
191#
behavior");
    document.MM_Time&#1111;0]&#1111;3].frame = 1;
    document.MM_Time&#1111;0]&#1111;3].value = "MM_timelineStop('Timeline1')";
    document.MM_Time&#1111;0]&#1111;4] = new String("behavior");
    document.MM_Time&#1111;0]&#1111;4].frame = 2;
    document.MM_Time&#1111;0]&#1111;4].value = "MM_timelinePlay('Timeline1')";
    document.MM_Time&#1111;0].lastFrame = 45;
    for (i=0; i<document.MM_Time.length; i++) &#123;
        document.MM_Time&#1111;i].ID = null;
196#

        document.MM_Time&#1111;i].curFrame = 0;
        document.MM_Time&#1111;i].delay = 1000/document.MM_Time&#1111;i].fps;
    &#125;
&#125;
//-->
</script>
</head>

<body onLoad="MM_timelineGoto('Timeline1','1')" >

<div id="prnt" style="position:absolute; left:12px; top:40px; width:44px; height:16px; z-index:1"><a href="#"><img src="Images/print.jpg" width="34" height="35" border="0" onClick="MM_timelineGoto('Timeline1','2')
40#
" onMouseUp="MM_showHideLayers('prnt','','hide')"></a></div>
<p>
2
<s
2a
pan class="PageHeader">Summary Report for 
a
17/11/2004
18
</span></p>


<br>
<br>

ef
<table border="0" align="left" cellpadding="0" cellspacing="0" class="color1">

Posted: Mon Feb 21, 2005 11:32 am
by feyd
it'd be more helpful to post the script(s) that are generating this page...

Posted: Mon Feb 21, 2005 11:56 am
by markl999
Might be worth checking if mod_gzip is being used too, i've see that cause some corruption in certain circumstances.

Posted: Tue Feb 22, 2005 4:04 am
by AXEmonster
sorry guys in being vague

i posted the code snippet in order to display the errors (thinking that someone would recognise the errors)

posting the script wouldnt realy help as it doesnt seem to be a syntax problem and it may happen to one user and not others then two users then 5 users then one user (you get the drift)

from my development server i have never had it and cant emulate it. even if i dial in i dont get it?

the end users are a large corp with about 20 users for this area of the application

they have there own firewall and proxy

we are hosting the application.

///////////////

i dont know if it could be our machine that is throwing these errors or their proxy.

is there a way of capturing the stream from a request at their end so we end up with a processed html file as they would have receive it (not an rcp as this would be pointless) This would indicate if these errors are being generated from our machine.