Jump to content
Eternal Lands Official Forums
Llywar

segfault in textures.c (1181)

Recommended Posts

When walking South from the Melinis South Gate running the current CVS I got a segfault in textures.c. The problem would repeat every time I reloaded the client. Launching the v1.8 client worked fine and allowed me to navigate past this point. The CVS client worked fine after that. Here is a backtrace:

 

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f5c68068740 (LWP 22428)]
0x00000000004b0555 in load_texture (file_name=0x15f9c84 "./3dobjects/trees/treehousebark.bmp",
tex=0x0, alpha=52 '4') at textures.c:1181
1181	textures.c: No such file or directory.
	in textures.c
(gdb) bt
#0  0x00000000004b0555 in load_texture (file_name=0x15f9c84 "./3dobjects/trees/treehousebark.bmp",
tex=0x0, alpha=52 '4') at textures.c:1181
#1  0x00000000004b0d0e in load_bmp8_color_key (tex_cache_entry=0x15f9c80, alpha=0) at textures.c:1585
#2  0x00000000004b10a1 in get_texture_id (i=174) at textures.c:1438
#3  0x0000000000411855 in draw_3d_object_detail (object_id=0x540aad0,
material_index=<value optimized out>, use_lightning=1, use_textures=<value optimized out>,
use_extra_textures=<value optimized out>) at textures.h:236
#4  0x0000000000411af8 in draw_3d_objects (object_type=<value optimized out>) at 3d_objects.c:397
#5  0x0000000000412193 in display_objects () at 3d_objects.c:691
#6  0x0000000000457b20 in display_game_handler (win=0x20b9bb0) at gamewin.c:1195
#7  0x000000000044b236 in draw_window (win=0x20b9bb0) at elwindows.c:1266
#8  0x000000000044b47d in display_windows (level=1) at elwindows.c:80
#9  0x0000000000440686 in draw_scene () at draw_scene.c:144
#10 0x000000000047522d in start_rendering () at main.c:205
#11 0x00000000004752bb in main (argc=1, argv=0x7fff700a1138) at main.c:344

 

I am using gzipped textures, but I tried uncompressing treehousebark.bmp and that didn't fix the problem. It looks like it managed to load hte 173 previous textures just fine, so not sure what is going on there. If there are any particular variables you'd like me to dump if I run into the bug again let me know.

 

This is on gentoo amd64.

Share this post


Link to post
Share on other sites
When walking South from the Melinis South Gate running the current CVS I got a segfault in textures.c. The problem would repeat every time I reloaded the client. Launching the v1.8 client worked fine and allowed me to navigate past this point. The CVS client worked fine after that. Here is a backtrace:....

I am using gzipped textures, but I tried uncompressing treehousebark.bmp and that didn't fix the problem. It looks like it managed to load hte 173 previous textures just fine, so not sure what is going on there. If there are any particular variables you'd like me to dump if I run into the bug again let me know.

This is on gentoo amd64.

A quick look at the code shows there is a check for a null pointer just after the pointer has been used. This obviously needs a little bit of re-ordering. As to why the texture is not loading, I'm not sure. I could not reproduce the fault walking the same route. Do you have the coordinates for where the crash occurs?

Share this post


Link to post
Share on other sites
A quick look at the code shows there is a check for a null pointer just after the pointer has been used. This obviously needs a little bit of re-ordering. As to why the texture is not loading, I'm not sure. I could not reproduce the fault walking the same route. Do you have the coordinates for where the crash occurs?

 

That would be the problem - reordering the code fixes the segfault. The problem occurs consistently for me at Melinis [224.86].

Share this post


Link to post
Share on other sites
That would be the problem - reordering the code fixes the segfault. The problem occurs consistently for me at Melinis [224.86].

OK, I'll commit a fix shortly. The only way I was able to reproduce your crash was to move the texture file and create a zero length file in its place. I presume your texture file is not corrupted, zero length or has invalid permissions?

 

edit: Or anything in your error_log.txt file?

Edited by bluap

Share this post


Link to post
Share on other sites

This same bug caused a crash under certain circumstances loading the unofficial tab map in some of the instance maps. It was caused by the client not knowing what continent it is on (small top left map when you hit tab) and trying to load a null value with the load_texture function. This fix from bluap resolved the crash. An upcoming fix server side (next update I guess probably) will set the continent value on instance maps under those circumstances that were causing the crash.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×