CTD shooting up witchpoint buoy in 1.76.1

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

Testing Clear HUD 1.1.1 and Sniper Sight 2.0.3 I can reliably crash Oolite. Jump into system, target witchpoint buoy because there's nothing else around (green alert), cycle compass to target mode invoking sniper sight HUD (ensure mode is set to hold), destroy buoy, wait one second, CTD. There's a definite second or so delay, I don't know whether that is the delay for the takeSnapshot() function in Sniper Sight, or the delay for the timer in Clear HUD to update for the first time.
01:09:39.196 [log.header]: Opening log for Oolite version 1.76.1 (x86-32 test release) under Windows at 2012-11-03 01:09:39 +0800.
2 processors detected.
Build options: spoken messages, mass/fuel pricing, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

01:09:40.029 [display.mode.list.native]: Windows native resolution detected: 1920 x 1200
01:09:40.161 [joystick.init]: Number of joysticks detected: 0
01:09:40.204 [rendering.opengl.version]: OpenGL renderer version: 2.1.0 ("2.1.0 - Build 8.15.10.2302"). Vendor: "Intel". Renderer: "Mobile Intel(R) 4 Series Express Chipset Family".
01:09:40.204 [rendering.opengl.extensions]: OpenGL extensions (82):
GL_ARB_texture_env_crossbar, GL_EXT_abgr, GL_ARB_shadow, GL_IBM_texture_mirrored_repeat, GL_EXT_separate_specular_color, GL_EXT_texture_edge_clamp, GL_EXT_blend_minmax, GL_EXT_draw_buffers2, GL_ARB_texture_env_add, GL_EXT_framebuffer_blit, GL_EXT_transform_feedback, GL_ARB_texture_env_dot3, GL_EXT_framebuffer_object, GL_EXT_blend_subtract, GL_3DFX_texture_compression_FXT1, GL_NV_conditional_render, GL_ARB_multitexture, GL_EXT_stencil_wrap, GL_ARB_texture_border_clamp, GL_ARB_framebuffer_sRGB, GL_ARB_texture_env_combine, GL_EXT_texture_env_add, GL_EXT_packed_pixels, GL_SGIS_texture_edge_clamp, GL_ARB_depth_texture, GL_SGIS_texture_lod, GL_ARB_occlusion_query, GL_ARB_transpose_matrix, GL_NV_texgen_reflection, GL_EXT_stencil_two_side, GL_ARB_shading_language_100, GL_ARB_texture_compression_rgtc, GL_EXT_texture_shared_exponent, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_EXT_secondary_color, GL_ARB_half_float_pixel, GL_EXT_blend_equation_separate, GL_EXT_draw_range_elements, GL_EXT_texture_lod_bias, GL_EXT_texture_filter_anisotropic, GL_ARB_half_float_vertex, GL_EXT_texture_swizzle, GL_SGIS_generate_mipmap, GL_ARB_texture_rectangle, GL_ARB_texture_non_power_of_two, GL_ARB_point_sprite, GL_EXT_packed_depth_stencil, GL_ARB_vertex_shader, GL_EXT_texture_compression_s3tc, GL_ARB_depth_buffer_float, GL_ARB_draw_instanced, GL_ARB_vertex_buffer_object, GL_WIN_swap_hint, GL_ARB_color_buffer_float, GL_ARB_shader_objects, GL_ATI_separate_stencil, GL_EXT_packed_float, GL_EXT_texture_rectangle, GL_ARB_texture_rg, GL_ARB_fragment_shader, GL_EXT_fog_coord, GL_EXT_texture3D, GL_ARB_window_pos, GL_ARB_fragment_program, GL_ARB_vertex_program, GL_EXT_texture_env_combine, GL_ARB_point_parameters, GL_ARB_texture_cube_map, GL_EXT_bgra, GL_EXT_compiled_vertex_array, GL_ARB_vertex_array_object, GL_ARB_draw_buffers, GL_ARB_texture_compression, GL_EXT_multi_draw_arrays, GL_ARB_texture_float, GL_EXT_blend_func_separate, GL_EXT_texture_sRGB, GL_EXT_shadow_funcs, GL_EXT_clip_volume_hint, GL_EXT_blend_color, GL_NV_blend_square
01:09:40.212 [rendering.opengl.shader.support]: Shaders are supported.
01:09:40.212 [speech.synthesis]: Spoken messages are off.
01:09:40.241 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
Resources
../AddOns
../AddOns/Basic-debug.oxp
../AddOns/Clear-HUD_1.1-1.oxp
../AddOns/Sniper Sight 2.0.3.oxp
01:09:40.583 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
01:09:42.814 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'No connection could be made because the target machine actively refused it.

' (outStream status: 7, inStream status: 7)."
01:09:42.814 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 0, inStream status: 0)."
01:09:42.815 [debugTCP.connect.failed]: Failed to connect to debug console at address 127.0.0.1:8563.
01:09:44.271 [loading.complete]: ========== Loading complete. ==========
01:10:01.772 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
01:12:21.595 [Sniper Sight]: killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].
01:12:21.599 [screenshot.filenameExists]: Snapshot "Sniper-Sight.png.png" already exists - adding numerical sequence.
01:12:21.603 [screenshot]: Saved screen shot "Sniper-Sight-061.png" (1920 x 1200 pixels).
01:15:21.063 [log.header]: Opening log for Oolite version 1.76.1 (x86-32 test release) under Windows at 2012-11-03 01:15:21 +0800.
2 processors detected.
Build options: spoken messages, mass/fuel pricing, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

01:15:21.894 [display.mode.list.native]: Windows native resolution detected: 1920 x 1200
01:15:22.065 [joystick.init]: Number of joysticks detected: 0
01:15:22.116 [rendering.opengl.version]: OpenGL renderer version: 2.1.0 ("2.1.0 - Build 8.15.10.2302"). Vendor: "Intel". Renderer: "Mobile Intel(R) 4 Series Express Chipset Family".
01:15:22.116 [rendering.opengl.extensions]: OpenGL extensions (82):
GL_ARB_texture_env_crossbar, GL_EXT_abgr, GL_ARB_shadow, GL_IBM_texture_mirrored_repeat, GL_EXT_separate_specular_color, GL_EXT_texture_edge_clamp, GL_EXT_blend_minmax, GL_EXT_draw_buffers2, GL_ARB_texture_env_add, GL_EXT_framebuffer_blit, GL_EXT_transform_feedback, GL_ARB_texture_env_dot3, GL_EXT_framebuffer_object, GL_EXT_blend_subtract, GL_3DFX_texture_compression_FXT1, GL_NV_conditional_render, GL_ARB_multitexture, GL_EXT_stencil_wrap, GL_ARB_texture_border_clamp, GL_ARB_framebuffer_sRGB, GL_ARB_texture_env_combine, GL_EXT_texture_env_add, GL_EXT_packed_pixels, GL_SGIS_texture_edge_clamp, GL_ARB_depth_texture, GL_SGIS_texture_lod, GL_ARB_occlusion_query, GL_ARB_transpose_matrix, GL_NV_texgen_reflection, GL_EXT_stencil_two_side, GL_ARB_shading_language_100, GL_ARB_texture_compression_rgtc, GL_EXT_texture_shared_exponent, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_EXT_secondary_color, GL_ARB_half_float_pixel, GL_EXT_blend_equation_separate, GL_EXT_draw_range_elements, GL_EXT_texture_lod_bias, GL_EXT_texture_filter_anisotropic, GL_ARB_half_float_vertex, GL_EXT_texture_swizzle, GL_SGIS_generate_mipmap, GL_ARB_texture_rectangle, GL_ARB_texture_non_power_of_two, GL_ARB_point_sprite, GL_EXT_packed_depth_stencil, GL_ARB_vertex_shader, GL_EXT_texture_compression_s3tc, GL_ARB_depth_buffer_float, GL_ARB_draw_instanced, GL_ARB_vertex_buffer_object, GL_WIN_swap_hint, GL_ARB_color_buffer_float, GL_ARB_shader_objects, GL_ATI_separate_stencil, GL_EXT_packed_float, GL_EXT_texture_rectangle, GL_ARB_texture_rg, GL_ARB_fragment_shader, GL_EXT_fog_coord, GL_EXT_texture3D, GL_ARB_window_pos, GL_ARB_fragment_program, GL_ARB_vertex_program, GL_EXT_texture_env_combine, GL_ARB_point_parameters, GL_ARB_texture_cube_map, GL_EXT_bgra, GL_EXT_compiled_vertex_array, GL_ARB_vertex_array_object, GL_ARB_draw_buffers, GL_ARB_texture_compression, GL_EXT_multi_draw_arrays, GL_ARB_texture_float, GL_EXT_blend_func_separate, GL_EXT_texture_sRGB, GL_EXT_shadow_funcs, GL_EXT_clip_volume_hint, GL_EXT_blend_color, GL_NV_blend_square
01:15:22.126 [rendering.opengl.shader.support]: Shaders are supported.
01:15:22.128 [speech.synthesis]: Spoken messages are off.
01:15:22.166 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
Resources
../AddOns
../AddOns/Basic-debug.oxp
../AddOns/Clear-HUD_1.1-1.oxp
../AddOns/Sniper Sight 2.0.3.oxp
01:15:22.547 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
01:15:24.802 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'No connection could be made because the target machine actively refused it.

' (outStream status: 7, inStream status: 7)."
01:15:24.803 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 0, inStream status: 0)."
01:15:24.803 [debugTCP.connect.failed]: Failed to connect to debug console at address 127.0.0.1:8563.
01:15:26.396 [loading.complete]: ========== Loading complete. ==========
01:15:44.426 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
01:17:03.996 [Sniper Sight]: killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].
01:17:04.001 [screenshot.filenameExists]: Snapshot "Sniper-Sight.png.png" already exists - adding numerical sequence.
01:17:04.007 [screenshot]: Saved screen shot "Sniper-Sight-062.png" (1920 x 1200 pixels).
Last edited by Wildeblood on Sat Nov 03, 2012 5:32 am, edited 1 time in total.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Smivs »

Possibly not related, but this line in the log looks wrong.
01:12:21.599 [screenshot.filenameExists]: Snapshot "Sniper-Sight.png.png" already exists - adding numerical sequence.
.png.png?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

Smivs wrote:
.png.png?
You've never noticed that before!?

Anyway, I just tried it again. It happens when the snapshot function is off, so that's not the cause.
01:38:20.265 [log.header]: Opening log for Oolite version 1.76.1 (x86-32 test release) under Windows at 2012-11-03 01:38:20 +0800.
2 processors detected.
Build options: spoken messages, mass/fuel pricing, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

01:38:21.175 [display.mode.list.native]: Windows native resolution detected: 1920 x 1200
01:38:21.388 [joystick.init]: Number of joysticks detected: 0
01:38:21.438 [rendering.opengl.version]: OpenGL renderer version: 2.1.0 ("2.1.0 - Build 8.15.10.2302"). Vendor: "Intel". Renderer: "Mobile Intel(R) 4 Series Express Chipset Family".
01:38:21.439 [rendering.opengl.extensions]: OpenGL extensions (82):
GL_ARB_texture_env_crossbar, GL_EXT_abgr, GL_ARB_shadow, GL_IBM_texture_mirrored_repeat, GL_EXT_separate_specular_color, GL_EXT_texture_edge_clamp, GL_EXT_blend_minmax, GL_EXT_draw_buffers2, GL_ARB_texture_env_add, GL_EXT_framebuffer_blit, GL_EXT_transform_feedback, GL_ARB_texture_env_dot3, GL_EXT_framebuffer_object, GL_EXT_blend_subtract, GL_3DFX_texture_compression_FXT1, GL_NV_conditional_render, GL_ARB_multitexture, GL_EXT_stencil_wrap, GL_ARB_texture_border_clamp, GL_ARB_framebuffer_sRGB, GL_ARB_texture_env_combine, GL_EXT_texture_env_add, GL_EXT_packed_pixels, GL_SGIS_texture_edge_clamp, GL_ARB_depth_texture, GL_SGIS_texture_lod, GL_ARB_occlusion_query, GL_ARB_transpose_matrix, GL_NV_texgen_reflection, GL_EXT_stencil_two_side, GL_ARB_shading_language_100, GL_ARB_texture_compression_rgtc, GL_EXT_texture_shared_exponent, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_EXT_secondary_color, GL_ARB_half_float_pixel, GL_EXT_blend_equation_separate, GL_EXT_draw_range_elements, GL_EXT_texture_lod_bias, GL_EXT_texture_filter_anisotropic, GL_ARB_half_float_vertex, GL_EXT_texture_swizzle, GL_SGIS_generate_mipmap, GL_ARB_texture_rectangle, GL_ARB_texture_non_power_of_two, GL_ARB_point_sprite, GL_EXT_packed_depth_stencil, GL_ARB_vertex_shader, GL_EXT_texture_compression_s3tc, GL_ARB_depth_buffer_float, GL_ARB_draw_instanced, GL_ARB_vertex_buffer_object, GL_WIN_swap_hint, GL_ARB_color_buffer_float, GL_ARB_shader_objects, GL_ATI_separate_stencil, GL_EXT_packed_float, GL_EXT_texture_rectangle, GL_ARB_texture_rg, GL_ARB_fragment_shader, GL_EXT_fog_coord, GL_EXT_texture3D, GL_ARB_window_pos, GL_ARB_fragment_program, GL_ARB_vertex_program, GL_EXT_texture_env_combine, GL_ARB_point_parameters, GL_ARB_texture_cube_map, GL_EXT_bgra, GL_EXT_compiled_vertex_array, GL_ARB_vertex_array_object, GL_ARB_draw_buffers, GL_ARB_texture_compression, GL_EXT_multi_draw_arrays, GL_ARB_texture_float, GL_EXT_blend_func_separate, GL_EXT_texture_sRGB, GL_EXT_shadow_funcs, GL_EXT_clip_volume_hint, GL_EXT_blend_color, GL_NV_blend_square
01:38:21.446 [rendering.opengl.shader.support]: Shaders are supported.
01:38:21.446 [speech.synthesis]: Spoken messages are off.
01:38:21.477 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
Resources
../AddOns
../AddOns/Basic-debug.oxp
../AddOns/Clear-HUD_1.1-1.oxp
../AddOns/Sniper Sight 2.0.3.oxp
01:38:21.818 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
01:38:24.011 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'No connection could be made because the target machine actively refused it.

' (outStream status: 7, inStream status: 7)."
01:38:24.012 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 0, inStream status: 0)."
01:38:24.012 [debugTCP.connect.failed]: Failed to connect to debug console at address 127.0.0.1:8563.
01:38:25.577 [loading.complete]: ========== Loading complete. ==========
01:38:43.067 [script.load.world.listAll]: Loaded 7 world scripts:
AadHUD 0.5
oolite-cloaking-device 1.76.1
oolite-constrictor-hunt 1.76.1
oolite-nova 1.76.1
oolite-thargoid-plans 1.76.1
oolite-trumbles 1.76.1
Sniper Sight 2.0.3
That's the entire log file.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Smivs »

Wildeblood wrote:
Smivs wrote:
.png.png?
You've never noticed that before!?
No. I don't use sniper sight or Clear HUD so I wouldn't have seen it from there. Also never in a log - a normal snapshot just shows as .png like this one I just took.

Code: Select all

17:48:45.584 [screenshot]: Saved screen shot "oolite-192.png" (1438 x 814 pixels).
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by cim »

I can't duplicate this in either 1.76.1 or trunk on Linux. I'll give it a go on Windows later.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Cody »

Unrelated...
Wildeblood wrote:
takeSnapshot() function
This is a different thingy from an ordinary screenshot - the takeSnapshot() function is disabled in the 1.76.1 deployment trial build, yes?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

Okay, here are two versions of the function in the clear HUD script. This first is my personal copy (where I commented out the distance display and changed the scope of a variable) and doesn't cause a crash.

Code: Select all

this.showMessage = function() {

	if (!player.ship.compassTarget) return;
	var compTarget = player.ship.compassTarget;

	// Speed calculation
	// var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
	var vPtoT = compTarget.position.subtract(player.ship.position); //player-target vector

	var	vVelPtoT = vPtoT.multiply(player.ship.velocity.dot(vPtoT) / (vPtoT.dot(vPtoT))); //velocity vector projection on player-target vector
	if (vVelPtoT.angleTo(vPtoT) < 1) //direction check
		var speedToTarget = vVelPtoT.magnitude(); //velocity projection magnitude ie. projected speed to target
	else
		var speedToTarget = -vVelPtoT.magnitude();
	// var distInKm = player.ship.position.distanceTo(this.compTarget) - this.compTarget.collisionRadius;
	var distInKm = player.ship.position.distanceTo(compTarget) - compTarget.collisionRadius;
	var timeToTarget = distInKm / speedToTarget;
	// var dist = distInKm/this.ostronomicalUnit;
	player.consoleMessage(this.message);
	// player.consoleMessage(dist.toFixed(6)+" OU");
	if (speedToTarget > 0.1) {
		var hours = Math.floor(timeToTarget / 3600);
		var mins = Math.floor((timeToTarget - 3600 * hours) / 60);
		var secs = (Math.floor(timeToTarget - hours * 3600 - mins * 60)).toString();
		if (hours.toString().length == 1) 
			hours = "0"+hours;
		if (mins.toString().length == 1) 
			mins = "0"+mins;
		if (secs.length == 1) 
			secs = "0"+secs;
		player.consoleMessage("ETA " + hours + ":" + mins + ":" + secs);
	}
	else {
		player.consoleMessage("ETA **:**:**");
	}
}
This is Spara's version, included in the OXP, which does cause a crash:

Code: Select all

this.showMessage = function() {
 	if (!player.ship.compassTarget) return;
	//Speed calculation
	var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
	var	vVelPtoT = vPtoT.multiply(player.ship.velocity.dot(vPtoT) / (vPtoT.dot(vPtoT))); //velocity vector projection on player-target vector
	if (vVelPtoT.angleTo(vPtoT) < 1) //direction check
		var speedToTarget = vVelPtoT.magnitude(); //velocity projection magnitude ie. projected speed to target
	else
		var speedToTarget = -vVelPtoT.magnitude();
	var distInKm = player.ship.position.distanceTo(this.compTarget) - this.compTarget.collisionRadius;
	var timeToTarget = distInKm / speedToTarget;
	var dist = distInKm/this.ostronomicalUnit;
	player.consoleMessage(this.message);
	player.consoleMessage(dist.toFixed(6)+" OU");
	if (speedToTarget > 0.1) {
		var hours = Math.floor(timeToTarget / 3600);
		var mins = Math.floor((timeToTarget - 3600 * hours) / 60);
		var secs = (Math.floor(timeToTarget - hours * 3600 - mins * 60)).toString();
		if (hours.toString().length == 1) 
			hours = "0"+hours;
		if (mins.toString().length == 1) 
			mins = "0"+mins;
		if (secs.length == 1) 
			secs = "0"+secs;
		player.consoleMessage(hours+":"+mins+":"+secs);
	}
	else {
		player.consoleMessage("**:**:**");
	}
}
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by cim »

El Viejo wrote:
the takeSnapshot() function is disabled in the 1.76.1 deployment trial build, yes?
Correct.

I've tried that OXP combination on Windows with both 1.76.1 and trunk, and that works fine for me too. Several systems around Ensoreus are now a nav buoy short, but no crashes...

Could you try commenting out lines of the (original) clear HUD script to see which one causes the crash?
User avatar
aegidian
Master and Commander
Master and Commander
Posts: 1161
Joined: Thu May 20, 2004 10:46 pm
Location: London UK
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by aegidian »

Old and possibly out-of-time coder here, but why is there no explicit check that speedToTarget is non-zero before trying to calculate timeToTarget? Do divide by zero errors not happen anymore?

UPDATE: Aha, I see JS has an Infinity value, and that tricksy math can only (at worst) result in NaN being returned. Still, one should probably still deal with a zero speed situation more cleanly.
"The planet Rear is scourged by well-intentioned OXZs."

Oolite models and gear? click here!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

aegidian wrote:
Old and possibly out-of-time coder here, but why is there no explicit check that speedToTarget is non-zero before trying to calculate timeToTarget?
var timeToTarget = distInKm / speedToTarget;
var dist = distInKm/this.ostronomicalUnit;
player.consoleMessage(this.message);
player.consoleMessage(dist.toFixed(6)+" OU");
if (speedToTarget > 0.1) {
var hours = Math.floor(timeToTarget / 3600);
var mins = Math.floor((timeToTarget - 3600 * hours) / 60);
var secs = (Math.floor(timeToTarget - hours * 3600 - mins * 60)).toString();
if (hours.toString().length == 1)
hours = "0"+hours;
if (mins.toString().length == 1)
mins = "0"+mins;
if (secs.length == 1)
secs = "0"+secs;
player.consoleMessage(hours+":"+mins+":"+secs);
}
Should be like this?...
var dist = distInKm/this.ostronomicalUnit;
player.consoleMessage(this.message);
player.consoleMessage(dist.toFixed(6)+" OU");
if (speedToTarget > 0.1) {
var timeToTarget = distInKm / speedToTarget;
var hours = Math.floor(timeToTarget / 3600);
var mins = Math.floor((timeToTarget - 3600 * hours) / 60);
var secs = (Math.floor(timeToTarget - hours * 3600 - mins * 60)).toString();
if (hours.toString().length == 1)
hours = "0"+hours;
if (mins.toString().length == 1)
mins = "0"+mins;
if (secs.length == 1)
secs = "0"+secs;
player.consoleMessage(hours+":"+mins+":"+secs);
}
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

Use Up and Down arrows to scroll through the command history.
Type /quit to quit.
Waiting for connection...
Opened connection with Oolite version 1.76.1
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].
This was my version of the script.
Connection closed:"Oolite is terminating."
Opened connection with Oolite version 1.76.1
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].
I don't know why it worked properly this time.
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

Connection closed with no message. CTD
Opened connection with Oolite version 1.76.1
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

Connection closed with no message. CTD
Opened connection with Oolite version 1.76.1
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

Exception: TypeError: this.compTarget.position is undefined
Active script: AadHUD 0.5
script.js, line 147:
var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
Hundreds more lines like this.
Exception: TypeError: this.compTarget.position is undefined
Active script: AadHUD 0.5
script.js, line 147:
var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
Exception: TypeError: this.compTarget.position is undefined
Active script: AadHUD 0.5
script.js, line 147:
var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

Connection closed with no message. CTD
Opened connection with Oolite version 1.76.1
Changed sniper sight to release mode...
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].
Changed sniper sight back to hold mode...
killed other ship [Ship "Witchpoint Beacon" position: (0, 0, 0) scanClass: CLASS_BUOY status: STATUS_DEAD].

Connection closed with no message. CTD
Spara was using compassTargetChanged() to store a reference to the target in this.compTarget for later use, rather than getting it directly from player.ship.compassTarget when he actually needed it. But sniper sight deliberately prevents compassTargetChanged() from firing, so the reference was stale. But...

Adding this.compTarget = player.ship.compassTarget; to the top of this.showMessage() doesn't help. And...

Changing it to a local var doesn't help, either. This is still crashing for me...

Code: Select all

this.showMessage = function() {
 	if (!player.ship.compassTarget) return;
//	this.compTarget = player.ship.compassTarget; // Doesn't help.
	var compTarget = player.ship.compassTarget;
	//Speed calculation
//	var vPtoT = this.compTarget.position.subtract(player.ship.position); //player-target vector
	var vPtoT = compTarget.position.subtract(player.ship.position); //player-target vector
	var	vVelPtoT = vPtoT.multiply(player.ship.velocity.dot(vPtoT) / (vPtoT.dot(vPtoT))); //velocity vector projection on player-target vector
	if (vVelPtoT.angleTo(vPtoT) < 1) //direction check
		var speedToTarget = vVelPtoT.magnitude(); //velocity projection magnitude ie. projected speed to target
	else
		var speedToTarget = -vVelPtoT.magnitude();
//	var distInKm = player.ship.position.distanceTo(this.compTarget) - this.compTarget.collisionRadius;
	var distInKm = player.ship.position.distanceTo(compTarget) - compTarget.collisionRadius;
	var timeToTarget = distInKm / speedToTarget;
	var dist = distInKm/this.ostronomicalUnit;
	player.consoleMessage(this.message);
	player.consoleMessage(dist.toFixed(6)+" OU");
	if (speedToTarget > 0.1) {
		var hours = Math.floor(timeToTarget / 3600);
		var mins = Math.floor((timeToTarget - 3600 * hours) / 60);
		var secs = (Math.floor(timeToTarget - hours * 3600 - mins * 60)).toString();
		if (hours.toString().length == 1) 
			hours = "0"+hours;
		if (mins.toString().length == 1) 
			mins = "0"+mins;
		if (secs.length == 1) 
			secs = "0"+secs;
		player.consoleMessage(hours+":"+mins+":"+secs);
	}
	else {
		player.consoleMessage("**:**:**");
	}
}
So then I thought it must be the distance calculation, and commented out two more lines...

Code: Select all

//	var dist = distInKm/this.ostronomicalUnit;
	player.consoleMessage(this.message);
//	player.consoleMessage(dist.toFixed(6)+" OU");
But it still crashes! How is that any different from my version that I said last night didn't crash!? :? :shock: :(

...Which I've now tried again, and it reliably causes a CTD too. :? :?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Eric Walch »

[Off topic]
Instead if lay-outing the time yourself, you could also let JS do that.

Code: Select all

var myTime = new Date(0,0,0, 0,0,timeToTarget)
player.consoleMessage(myTime.toLocaleTimeString());
Only used in the second field in this case.
[On topic]
Last edited by Eric Walch on Sat Nov 03, 2012 9:17 am, edited 1 time in total.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by spara »

Wildeblood, could you try with the new version of the aad-hud if it still causes ctd with sniper scope. New version should not run the problematic function at all when sniper scope is on.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by spara »

Eric Walch wrote:
[Off topic]
Instead if lay-outing the time yourself, you could also let JS do that.

Code: Select all

var myTime = new Date(0,0,0 0,0,timeToTarget)
player.consoleMessage(myTime.toLocaleTimeString());
[On topic]
I just knew there was a function for this! Just could not find it :D . Thanks.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: CTD shooting up witchpoint buoy in 1.76.1

Post by Wildeblood »

spara wrote:
Wildeblood, could you try with the new version of the aad-hud if it still causes ctd with sniper scope. New version should not run the problematic function at all when sniper scope is on.
I have done, that is fine.* But it doesn't explain why removing the compass makes this function cause me so much drama.

* But there must be a better way than running a frame callback and a timer...
Post Reply