I encountered a peculiar issue with Internet Explorer 11 while working on WebGL programming. Everything was functioning smoothly in all browsers until, out of the blue, IE started crashing when altering the positions of 4 meshes, without pointing to any specific code error in debug mode.
My IE 11 setup:
GL Version - WebGL 0.93
Shading Language Version - WebGL GLSL ES 0.93
The error message received was: Unhandled exception at 0x03F6435B (mshtml.dll) in iexplore.exe: 0xC0000005: Access violation writing location 0xBF35051C.
(5 last) Call Stack:
mshtml.dll!CMarkupPointer::RemoveMeFromList(void) Unknown mshtml.dll!
7'::`dynamic atexit destructor for 'fieldDefaultValue''(void) Unknown mshtml.dll!CMarkupPointer::MoveToPointer(class CMarkupPointer const *) Unknown mshtml.dll!CDisplayPointer::MoveToPointer(class CDisplayPointer *) Unknown mshtml.dll!CSelectTracker::DoSelection(class CEditEvent *,int,int *) UnknownCBackgroundInfo::Property<class CBackgroundImage>(int)'::
This is the code responsible for creating the meshes:
function PrepareFlowArrows(l_vDiffuser) {
var m_vExtraLoader = new THREE.JSONLoader();
m_vExtraLoader.load('3D_Control/models/FlowArrow.js', callbackLoadFlowArrows(l_vDiffuser));
}
// Callback function for loading FlowArrows models
function callbackLoadFlowArrows(l_vDiffuser) {
return function (geometry) {
var l_vRotation = 0;
for (var i = 0; i < 4; i++) {
if (i == 0)
l_vRotation = -1.5707;
else if (i == 1)
l_vRotation = 3.1414;
else if (i == 2)
l_vRotation = 1.5707;
else
l_vRotation = 0;
var l_vMaterial = new THREE.MeshBasicMaterial();
l_vMaterial.color.r = 0;
l_vMaterial.color.g = 255;
l_vMaterial.color.b = 0;
var m_vTempFlowArrowMesh = new THREE.Mesh(geometry, l_vMaterial);
m_vTempFlowArrowMesh.scale.x = m_vTempFlowArrowMesh.scale.y = m_vTempFlowArrowMesh.scale.z *= 25;
m_vTempFlowArrowMesh.position.set(0, 0, 0);
m_vTempFlowArrowMesh.rotation.y = l_vRotation;
l_vDiffuser.AddFlowArrow(m_vTempFlowArrowMesh);
m_vScene.add(m_vTempFlowArrowMesh);
}
}
}
However, the code snippet below causes IE11 to crash when Render(); is triggered, and the meshes become visible:
this.UpdateFlowArrows = function () {
this.GetBoundingBox();
if (m_vFlowArrows[0] != null) {
m_vFlowArrows[0].position.x = m_vBoundingBox.min.x - 100;
m_vFlowArrows[0].position.y = m_vBoundingBox.min.y + ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
m_vFlowArrows[0].position.z = m_vBoundingBox.min.z + ((m_vBoundingBox.max.z - m_vBoundingBox.min.z) / 2);
//m_vFlowArrows[0].rotation.y = -1.5707;
}
if (m_vFlowArrows[1] != null) {
m_vFlowArrows[1].position.x = m_vBoundingBox.min.x + ((m_vBoundingBox.max.x - m_vBoundingBox.min.x) / 2);
m_vFlowArrows[1].position.y = m_vBoundingBox.min.y + ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
m_vFlowArrows[1].position.z = m_vBoundingBox.min.z - 100;
//m_vFlowArrows[1].rotation.y = 3.1414;
}
if (m_vFlowArrows[2] != null) {
m_vFlowArrows[2].position.x = m_vBoundingBox.max.x + 100;
m_vFlowArrows[2].position.y = m_vBoundingBox.max.y - ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
m_vFlowArrows[2].position.z = m_vBoundingBox.max.z - ((m_vBoundingBox.max.z - m_vBoundingBox.min.z) / 2);
//m_vFlowArrows[0].rotation.y = 1.5707;
}
if (m_vFlowArrows[3] != null) {
m_vFlowArrows[3].position.x = m_vBoundingBox.max.x - ((m_vBoundingBox.max.x - m_vBoundingBox.min.x) / 2);
m_vFlowArrows[3].position.y = m_vBoundingBox.max.y - ((m_vBoundingBox.max.y - m_vBoundingBox.min.y) / 2);
m_vFlowArrows[3].position.z = m_vBoundingBox.max.z + 100;
//m_vFlowArrows[3].rotation.y = 1.5707;
}
}
Interestingly, adding the line
m_vTempFlowArrowMesh.visible = false;
within the callbackLoadFlowArrows method prevents the crash, even though the arrows still update.