[tsc-devel] Re: Bad build?
datahead |
Sun, 31 Jul 2016 23:45:36 UTC
Post via forum by datahead <…9@x…>:
I'm not sure why, but it seems to give a little different backtrace now. Frame 4 looks different. Frame 5 is the last TSC code executed:
[code]
3489 malloc.c: No such file or directory.
(gdb) bt
#0 _int_malloc (av=0x7ffff4bec760 <main_arena>, bytes=131072) at malloc.c:3489
#1 0x00007ffff48b06c0 in __GI___libc_malloc (bytes=131072) at malloc.c:2891
#2 0x00007ffff517a758 in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff769db82 in std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&) ()
from /usr/local/lib/libCEGUIBase-0.so.2
#4 0x00007ffff7089092 in sf::Image::create(unsigned int, unsigned int, unsigned char const*) ()
from /usr/local/lib/libsfml-graphics.so.2.3
#5 0x000000000053fdf9 in TSC::cVideo::Create_Texture (this=0xab4a00, p_sf_image=0x23caac0, mipmap=false, force_width=256,
force_height=128) at /home/datahead/TSC-Release/TSC/tsc/src/video/video.cpp:1066
#6 0x000000000053f8d7 in TSC::cVideo::Load_GL_Surface_Helper (this=0xab4a00, filename=..., use_settings=true,
print_errors=true, package=false) at /home/datahead/TSC-Release/TSC/tsc/src/video/video.cpp:952
#7 0x000000000053e647 in TSC::cVideo::Get_Surface_Helper (this=0xab4a00, filename=..., print_errors=true, package=false)
at /home/datahead/TSC-Release/TSC/tsc/src/video/video.cpp:789
#8 0x000000000053e2e8 in TSC::cVideo::Get_Surface (this=0xab4a00, filename=..., print_errors=true)
at /home/datahead/TSC-Release/TSC/tsc/src/video/video.cpp:753
#9 0x00000000006bfa1d in TSC::cEditor::Try_Add_Image_Item (this=0x16ad080, settings_path=...)
at /home/datahead/TSC-Release/TSC/tsc/src/core/editor/editor.cpp:801
#10 0x00000000006c11f8 in TSC::cEditor::load_image_items (this=0x16ad080)
at /home/datahead/TSC-Release/TSC/tsc/src/core/editor/editor.cpp:937
#11 0x00000000006bc47b in TSC::cEditor::Init (this=0x16ad080)
at /home/datahead/TSC-Release/TSC/tsc/src/core/editor/editor.cpp:93
#12 0x000000000069f415 in TSC::Init_Game () at /home/datahead/TSC-Release/TSC/tsc/src/core/main.cpp:311
#13 0x000000000069e896 in main (argc=1, argv=0x7fffffffdef8) at /home/datahead/TSC-Release/TSC/tsc/src/core/main.cpp:180
[/code]
This is what info I have now...
Line in question from video.cpp
[code]
(gdb) frame 5
#5 0x000000000053fdf9 in TSC::cVideo::Create_Texture (this=0xab4a00,
p_sf_image=0x23caad0, mipmap=false, force_width=256, force_height=128)
at /home/datahead/TSC-Release/TSC/tsc/src/video/video.cpp:1066
1066 p_new_image->create(texture_width, texture_height, static_cast<const uint8_t*>(new_pixels));
[/code]
Input to p_new_image->create - the width and height look valid, and new_pixels is not NULL (no 0 address):::
[code]
(gdb) print texture_width
$1 = 256
(gdb) print texture_height
$2 = 128
(gdb) print new_pixels
$3 = (unsigned char *) 0x26099c0 ""
[/code]
Full code snippet from video.cpp:
[code]
// scale to new size
if (texture_width != p_sf_image->getSize().x || texture_height != p_sf_image->getSize().y) {
int reduce_block_x = p_sf_image->getSize().x / texture_width;
int reduce_block_y = p_sf_image->getSize().y / texture_height;
// create scaled image
unsigned char* new_pixels = static_cast<unsigned char*>(malloc(texture_width * texture_height * 4));
Downscale_Image(static_cast<const unsigned char*>(p_sf_image->getPixelsPtr()), p_sf_image->getSize().x, p_sf_image->getSize().y, 8 /* getPixelsPtr() guarantees 8 BPP */, new_pixels, reduce_block_x, reduce_block_y);
sf::Image* p_new_image = new sf::Image();
p_new_image->create(texture_width, texture_height, static_cast<const uint8_t*>(new_pixels));
delete p_sf_image;
p_sf_image = p_new_image;
free(new_pixels);
}
[/code]
--
Sent by Chessboard.