Issue1002

Title Game crash after duplicating an item on the ground.
Priority bug Status resolved
Assigned To Keywords
Linked issues Watchers

Submitted on 2024-08-10 14h39 by duclou, last changed by fluzz.

Files
File name Uploaded Type Edit Remove
freedroid_crash_files.zip duclou, 2024-08-16.06:20:05 application/zip
freedroid_crash_files.zip duclou, 2024-08-16.07:21:13 application/zip
Messages
Author: duclou Date: 2024-08-10   14h39
This has already happened to me several times (but it's very very rare) during different games, I don't know how to reproduce the bug, but it seems to me that it's when I have the inventory open and I throw an item on the ground, I don't know why, but sometimes there's a duplication of this item on the ground, if I take the duplicated item in my inventory, then, when I save the game, it crashes and it will no longer be possible to load this game.

I don't think that's a problem, but it's always happened when I've interacted with a merchant or the equipment upgrade factory.

* text translated with deepl

In french, my native language:

Crash du jeu après duplication d'un item sur le sol.

Cela m'est déjà arrivé plusieurs fois (mais c'est très très rare) lors de différentes parties, je ne sais comment reproduire le bug, mais il me semble que c'est lorsque j'ai l'inventaire ouvert et que je jette un item au sol, je ne sais pourquoi, mais il y a parfois une duplication de cet item au sol, si je prends l'item dupliqué dans mon inventaire, alors, lors de la sauvegarde du jeu, il plante et il ne sera plus possible de charger cette partie.

Je ne pense pas que cela ait une incidence et peut-être du hasard, mais cela s'est toujours produit lorsque j'avais intéragi avec un marchand ou encore avec l'usine d'amélioration de l'équipement.

----------------------------------------------------

Content of the fdrpg_out.txt :

--start of real debug log--


Hello, this is FreedroidRPG, version 1.0.

Video system type: x11.
Using screen resolution 1366 x 768.

Testing if color depth 32 bits is available... YES.
video mode set (bpp=24 RGBA=8880 depth=24)
pixel format (shift/mask) : red: 16/0x00ff0000, green: 8/0x0000ff00, blue: 0/0x000000ff, alpha: 0/0x00000000

-OpenGL--------------------------------------------------------------------------
Vendor     : Intel Open Source Technology Center
Renderer   : Mesa DRI Intel(R) HD Graphics (Whiskey Lake 3x8 GT2) x86/MMX/SSE2
Version    : 3.0 Mesa 18.3.6
Extensions : GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_3DFX_texture_compression_FXT1 GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_S3_s3tc GL_SUN_multi_draw_arrays GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_texture_compression_s3tc GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_MESA_window_pos GL_NV_packed_depth_stencil GL_NV_texture_rectangle GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_window_pos GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_depth_clamp GL_NV_fog_distance GL_APPLE_packed_pixels GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_NV_primitive_restart GL_ARB_depth_clamp GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_100 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate GL_OES_read_format GL_ARB_color_buffer_float GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_float GL_ARB_texture_rectangle GL_EXT_packed_float GL_EXT_pixel_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_stencil GL_APPLE_object_purgeable GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_gpu_program_parameters GL_EXT_texture_array GL_EXT_texture_integer GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_OES_EGL_image GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_AMD_conservative_depth GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_debug_output GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_shader_stencil_export GL_ARB_shader_texture_lod GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_multisample GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_uniform_buffer_object GL_ARB_vertex_type_2_10_10_10_rev GL_EXT_provoking_vertex GL_EXT_texture_snorm GL_MESA_texture_signed_rgba GL_NV_texture_barrier GL_ARB_draw_indirect GL_ARB_get_program_binary GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_precision GL_ARB_texture_compression_bptc GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_AMD_multi_draw_indirect GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_shader_atomic_counters GL_ARB_shader_image_load_store GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_texture_storage GL_ARB_transform_feedback_instanced GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_transform_feedback GL_AMD_query_buffer_object GL_AMD_shader_trinary_minmax GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_clear_buffer_object GL_ARB_compute_shader GL_ARB_copy_image GL_ARB_explicit_uniform_location GL_ARB_fragment_layer_viewport GL_ARB_framebuffer_no_attachments GL_ARB_invalidate_subdata GL_ARB_multi_draw_indirect GL_ARB_program_interface_query GL_ARB_robust_buffer_access_behavior GL_ARB_shader_image_size GL_ARB_shader_storage_buffer_object GL_ARB_stencil_texturing GL_ARB_texture_query_levels GL_ARB_texture_storage_multisample GL_ARB_texture_view GL_ARB_vertex_attrib_binding GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_ARB_buffer_storage GL_ARB_clear_texture GL_ARB_indirect_parameters GL_ARB_internalformat_query2 GL_ARB_multi_bind GL_ARB_query_buffer_object GL_ARB_seamless_cubemap_per_texture GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_stencil8 GL_ARB_vertex_type_10f_11f_11f_rev GL_EXT_shader_framebuffer_fetch GL_EXT_shader_integer_mix GL_INTEL_performance_query GL_ARB_ES3_1_compatibility GL_ARB_clip_control GL_ARB_conditional_render_inverted GL_ARB_cull_distance GL_ARB_derivative_control GL_ARB_get_texture_sub_image GL_ARB_pipeline_statistics_query GL_ARB_shader_texture_image_samples GL_ARB_texture_barrier GL_ARB_transform_feedback_overflow_query GL_EXT_polygon_offset_clamp GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_ARB_fragment_shader_interlock GL_ARB_post_depth_coverage GL_ARB_shader_atomic_counter_ops GL_ARB_shader_ballot GL_ARB_shader_clock GL_EXT_shader_samples_identical GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_NV_fragment_shader_interlock GL_MESA_shader_integer_functions GL_ARB_polygon_offset_clamp GL_ARB_texture_filter_anisotropic GL_EXT_shader_framebuffer_fetch_non_coherent GL_INTEL_shader_atomic_float_minmax


Now respawning all bots on level : 12 (Cryo Stasis Lab).
---------------------------------------------------------------------------------
FreedroidRPG 1.0 encountered a problem in function: resume_lua_coroutine
Error running Lua code: .../local/share/freedroidrpg/lua_modules/script_helpers.lua:310: bad argument #2 to 'format' (no value).
Erroneous LuaCode={
305  	local no_wait = "WAIT"
306  	if (arg[#arg] == "NO_WAIT") then
307  		no_wait = "NO_WAIT"
308  		table.remove(arg)
309  	end
>310 	text = string.format(text, table.unpack(arg))
311  	return text, no_wait
312  end
}
Author: fluzz Date: 2024-08-14   10h47
Mhh... Never heard of such a bug, thanks for the report.
Without a way to reproduce, it could however be hard to catch.
We also need the file 'jux.shp'. Could you please add it to this report ?
Author: duclou Date: 2024-08-16   06h23
In fact I've just tested a lot of different things and I think I've found how to reproduce the bug, you need to have 2 identical items in your inventory, throw one on the ground, and throw the second exactly on top of the first (mouse pointer exactly on the ground item).

I've added the jux.shp file and a quick video showing how to reproduce the bug to the zip.
Author: fluzz Date: 2024-08-16   06h47
Your jux.shp file is empty... I tried your recipe, saved the game and reloaded it, but no crash. I'll try with your savegame, when you'll upload the right jux.shp.
Author: duclou Date: 2024-08-16   06h52
In fact, you don't need to have the same two items, this happens with any item on the ground.

Merci d'voir porté attention à mon message =)
Author: duclou Date: 2024-08-16   06h56
I can't reload my jux game, because freedroid crash when I try, sorry :/
Author: duclou Date: 2024-08-16   07h25
Ok, I changed to another game, and this time the shp file contains data, I hope it will be enough. I've also added another video leading up to the game crash.

Sorry for my bad english...
Author: fluzz Date: 2024-08-16   08h50
Ok. Easy to reproduce. Even no need to drop an item over an other one.

Take a bomb, for instance, drop it on the floor.
Take the equipped laser riffle (the one in the hands of Tux in the inventory), drop it where you want on the floor. There are now 2 riffles on the floor...

Now, here the actual bug :

Reload the savegame, click on the equipped riffle in the inventory, and you'll see that a riffle item label is displayed near Tux. This should not happen ! There's a bug here !

Because, if you click on the unequipped riffle (in the lower part of the inventory), you'll see that no label is displayed near Tux. That's the normal behavior.


Thx for the additional information, it can now be easier to find the bug.

(and don't worry for your english, it is not worst than mine - I'm also French :-))
Author: fluzz Date: 2024-08-16   11h22
I was not able to reproduce with a fresh new game...

So I tried several things with your savegame and, interesting fact: it only happens in Town !

In Town, you left many items on the floor... probably related...
Author: fluzz Date: 2024-08-16   12h09
So here's what happens: 

When the second item is dropped on the floor, the list containing all the dropped items on that level being full, it is extended by using realloc().
Then, the pointer to the item is not more valid. The bug could be with MoveItem() in drop_item(). Need further investigation.
Author: fluzz Date: 2024-08-16   12h13
As a confirmation: If the drop_list is initialized with a bigger size (100 instead of 10), the issue disappears...
Author: fluzz Date: 2024-08-22   09h06
duclou, could you please test the latest gitlab version (commit 85156e28), and confirm that the reported bug is fixed ?
Author: fluzz Date: 2024-08-25   13h46
duclou, if the bug is not fixed with latest version, please reopen the issue.
History
Date User Action Args
2024-08-25 13:46:51fluzzsetstatus: open -> resolved
messages: + msg3850
2024-08-22 09:06:49fluzzsetmessages: + msg3849
2024-08-16 12:13:20fluzzsetmessages: + msg3848
2024-08-16 12:09:44fluzzsetmessages: + msg3847
2024-08-16 11:22:58fluzzsetmessages: + msg3846
2024-08-16 08:50:30fluzzsetmessages: + msg3845
2024-08-16 07:26:00duclousetmessages: + msg3844
2024-08-16 07:21:13duclousetfiles: + freedroid_crash_files.zip
2024-08-16 06:56:38duclousetmessages: + msg3843
2024-08-16 06:52:51duclousetmessages: + msg3842
2024-08-16 06:47:16fluzzsetmessages: + msg3841
2024-08-16 06:24:11duclousetfiles: - freedroid_crash_files.zip
2024-08-16 06:23:03duclousetmessages: + msg3840
2024-08-16 06:20:05duclousetfiles: + freedroid_crash_files.zip
2024-08-14 10:47:16fluzzsetmessages: + msg3839
2024-08-10 14:39:04ducloucreate