Note that there are some explanatory texts on larger screens.

plurals
  1. POjs causing firefox to crash
    primarykey
    data
    text
    <p>I apologize for the vague question, but I don't know how to better describe what is happening.</p> <p>I'm developing a web app that so far is strictly coded in js (no server side code yet). I'm using an HTML 5 canvas to draw a sort of layout diagram that has click events and color coding and selecting of objects etc etc. </p> <p>I'm developing this strictly for use with Firefox (I'm using moz specific css stuff and Storage which the version of IE I have to use doesn't support.)</p> <p>Today while working on my project I started experiencing odd behavior. When loading the web page some of the content would appear (buttons, divs etc) and then Firefox would pop up a dialog stating "Firefox has stopped working" and asks if I want to "Check online for a solution and close the program" or just "Close the program". The following was in the "further details" pane:</p> <pre><code>&gt; Problem signature: Problem Event Name: APPCRASH Application &gt; Name: firefox.exe Application Version: 17.0.4.4814 Application &gt; Timestamp: 5138e84f Fault Module Name: mozjs.dll Fault Module &gt; Version: 0.0.0.0 Fault Module Timestamp: 5138d295 Exception &gt; Code: c0000005 Exception Offset: 0002171f OS &gt; Version: 6.1.7601.2.1.0.256.4 Locale ID: 1033 Additional &gt; Information 1: 0a9e Additional Information &gt; 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e &gt; Additional Information 4: 0a9e372d3b4ad19135b953a78882e789 &gt; &gt; Read our privacy statement online: &gt; http://go.microsoft.com/fwlink/?linkid=104288&amp;clcid=0x0409 If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.txt </code></pre> <p>I put some alert statements in my code and traced down the problem to a certain block of code. However if I step through that block (putting an alert statement in each iteration of a for loop) the code executes as expected, and Firefox doesn't crash. Firebug doesn't see anything wrong with the code either. If I take the alert away then suddenly Firefox chokes again.</p> <p>If I break that portion of code out and run it by clicking a button, then the code executes properly as well, however it's not practical for my users to have to click the button to make it work.</p> <p>I need help figuring out what I should try to zero in on the problem.</p> <p>A few things that may (I have no idea) be relevant:</p> <p>I'm loading data from about 12 different xml documents, one as big as 600KB, the rest about 20KB.</p> <p>I'm importing 15 different js libraries as well-- I can potentially reduce this number, but the functionality is broken up logically among these files, so it'll make it a little harder to develop if I have to concatenate them all together. </p> <p>I'm not using jQuery or MooTools or any other libraries like that.</p> <p>Any ideas on how to work out what's going on?</p> <p><strong>EDIT:</strong></p> <p>Here is the code for the function that it dies on. The reason I didn't post the actual code was because, as I said, the code itself executes properly when not run with the rest of the code of the page. Still, if it helps, here it is.</p> <pre><code>function GetSeatPaths(Seats){ // fills the SeatPath, ArmrestPath and SimpleSeatPath for the seat instance (used for cango drawing) for (var i =0; i&lt;Seats.length; i++){ var ThisSeat = Seats[i]; var SeatPath = ThisSeat.SeatPath; //alert("SeatCollection.prototype.GetSeatPaths: " + i); if (typeof(SeatPath) === "undefined" || SeatPath == null){ var Column = ThisSeat.Column; var Dims = ThisSeat.Dims; if (Column != "Left"){ BL = -1; } else { BL = 1; } var SeatRad = 2; try{ var seat_pax = parseInt(Dims.Seat_PAX); } catch(err){ var seat_pax = 3; } if (isNaN(seat_pax)){ var seat_pax = 3; } //Make an armrest and cushion set var SeatRad = 2; //this is the radius of the seat cushions //alert("getSeatPaths"); var CTS = 2.25; var TAR = 16; var CRP = 16.2; var BA = 18; var FOA = -2; var SBT2 = 23.2; var ACO = 45; if (Dims.hasOwnProperty('CTS')){ CTS = parseFloat(Dims.CTS.Value); } if (Dims.hasOwnProperty('TAR')){ TAR = parseFloat(Dims.TAR.Value); } if (Dims.hasOwnProperty('CRP')){ CRP = parseFloat(Dims.CRP.Value); } if (Dims.hasOwnProperty('BA')){ BA = parseFloat(Dims.BA.Value); } if (Dims.hasOwnProperty('FOA')){ FOA = parseFloat(Dims.FOA.Value); } if (Dims.hasOwnProperty('SBT2')){ SBT2 = parseFloat(Dims.SBT2.Value); } if (Dims.hasOwnProperty('ACO')){ ACO = parseFloat(Dims.ACO.Value); } SeatGeometryArr = []; ArmrestGeometryArr = []; var SeatOffset = 0 for (var j=0; j&lt;seat_pax; j++){ var CW = 17; var q = 4; if (Dims.hasOwnProperty('CW' + (j+1))){ CW = parseFloat(Dims['CW' + (j+1)].Value); } if (Dims.hasOwnProperty('q' + (j+1))){ CW = parseFloat(Dims['q' + (j+1)].Value); } SeatGeometryArr.push(['M',-CTS+SeatRad,-TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1,-CTS,-TAR+q/2+SeatRad + SeatOffset]); SeatGeometryArr.push(['L',-CTS,-TAR+q/2+CW-q/2-SeatRad + q/2 + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1,-CTS+SeatRad,-TAR+CW+q/2 + SeatOffset]); SeatGeometryArr.push(['L',CRP-SeatRad, -TAR+q/2+CW + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1,CRP, -TAR+q/2+CW-SeatRad + SeatOffset]); SeatGeometryArr.push(['L',CRP, -TAR+q/2+SeatRad + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1,CRP-SeatRad, -TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['L',-CTS+SeatRad,-TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['Z']); SeatGeometryArr.push(['M',CRP+SeatRad,-TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1,CRP,-TAR+q/2+SeatRad + SeatOffset]); SeatGeometryArr.push(['L',CRP,-TAR+q/2+CW-SeatRad + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1, CRP+SeatRad, -TAR+q/2+CW + SeatOffset]); SeatGeometryArr.push(['L',SBT2 - SeatRad ,-TAR+q/2+CW + SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1, SBT2, -TAR + q/2 + CW - SeatRad + SeatOffset]); SeatGeometryArr.push(['L',SBT2,-TAR + q/2 + SeatRad+ SeatOffset]); SeatGeometryArr.push(['A',SeatRad,SeatRad,0,0,1, SBT2 - SeatRad,-TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['L',CRP+SeatRad,-TAR+q/2 + SeatOffset]); SeatGeometryArr.push(['Z']); SeatOffset += CW; } //alert("Out of Cushions"); var SeatPath = FlipGeoArr(SeatGeometryArr,-BL); // Note: BL is flipped here because the geometry for the seat is defined for a RH seat // Create Armrest Geometry ArmrestGeometryArr = []; SeatOffset = 0 for (var j=0; j&lt;seat_pax+1; j++){ var CW = 17; var q = 4; if (Dims.hasOwnProperty('CW' + (j+1))){ CW = parseFloat(Dims['CW' + (j+1)].Value); } if (Dims.hasOwnProperty('q' + (j+1))){ CW = parseFloat(Dims['q' + (j+1)].Value); } ArmrestGeometryArr.push(['M',-FOA,-TAR + SeatOffset]); ArmrestGeometryArr.push(['L',-FOA,-TAR+q + SeatOffset]); ArmrestGeometryArr.push(['L',BA,-TAR+q + SeatOffset]); ArmrestGeometryArr.push(['L',BA,-TAR + SeatOffset]); ArmrestGeometryArr.push(['L',-FOA,-TAR + SeatOffset]); ArmrestGeometryArr.push(['Z']); SeatOffset += CW; } //alert("Out of Armrests"); var ArmrestPath = FlipGeoArr(ArmrestGeometryArr,-BL); // Note: BL is flipped here because the geometry for the seat is defined for a RH seat //alert("Into Simple"); // create geometry for the simplified seat SimpleSeatGeometryArr = []; SimpleSeatGeometryArr.push(['M',-CTS,-TAR]); SimpleSeatGeometryArr.push(['L',-CTS,ACO]); SimpleSeatGeometryArr.push(['L',SBT2,ACO]); SimpleSeatGeometryArr.push(['L',SBT2,-TAR]); SimpleSeatGeometryArr.push(['Z']); //alert("Out of Simple"); var SimpleSeatPath = FlipGeoArr(SimpleSeatGeometryArr,-BL); // Note: BL is flipped here because the geometry for the seat is defined for a RH seat // stick these values in for all seat instances with this part number for (var j=0; j&lt;Seats.length; j++){ if (Seats[j].PartNumber == Seats[i].PartNumber){ Seats[j].SeatPath = SeatPath; Seats[j].ArmrestPath = ArmrestPath; Seats[j].SimpleSeatPath = SimpleSeatPath; } } } } } </code></pre> <p>I thought it might be a race condition, too, so I tired using <code>window.setTimeout(functionThatBreaks,1)</code> to make sure it executed when it's dependencies were loaded, but to no avail. The same error pops up and FF dies. Is there anything else I can do, short of a user interaction to try and determine if it's a race condition?</p> <p><strong>EDIT 4-17-2013, 2:00 PM PST</strong> I revised the code above to show the changes made at the suggestion of lib3d and TheBrain. I also tried making it a regular function rather than an object prototype, still no change in the behavior.</p> <p>I also just discovered something peculiar. If I have FireBug active for the website, it runs fine. If I disable FireBug then FireFox crashes. I'm absolutely confused now.</p> <p><strong>EDIT 4-17-2013 4:05 PST</strong> It turns out I was wrong about FireBug causing issues. I can close the browser, reopen it by opening the html page from a folder on my computer and it'll fail. I can do nothing other than click "Close Window" in the Firefox failure dialog, then open the same html page, and suddenly it works.</p> <p>What might cause this sort of behavior?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload