Giter Site home page Giter Site logo

Comments (9)

DrMcCoy avatar DrMcCoy commented on May 9, 2024

Hmm, can you do one or all of the following?

  • Compile xoreos with the sanitizers (export CXXFLAGS="-O2 -fno-omit-frame-pointer -fsanitize=address,undefined" before running configure or cmake)
  • Run xoreos in valgrind (warning, very slow)

Or run xoreos in gdb and give me a backtrace (not as useful as the other two methods).

from xoreos.

DrMcCoy avatar DrMcCoy commented on May 9, 2024

Oh, and please, use the current master branch for that, i.e. b3fe623, so that I know what's what.

from xoreos.

aFoxNamedMorris avatar aFoxNamedMorris commented on May 9, 2024

I am using master branch. Will recompile and post the results shortly.

EDIT:
With your sanitation flags and the current master code:

Target "kotor"                                                                                                                                                
Found Max FSAA: 16x                                                                                                                                           
OpenGL context successfully created:                                                                                                                          
OpenGL version: 3.2                                                                                                                                           
FSAA level    : 0x                                                                                                                                            
OpenGL context successfully created:                                                                                                                          
OpenGL version: 3.2                                                                                                                                           
FSAA level    : 8x                                                                                                                                            
Initialising shaders...
shader default/default.vert loaded
shader default/default.frag loaded
shader default/color.frag loaded
Initialising default surfaces...
Initialising default materials...
Initialising default mesh containers...
Graphics subsystem initialized
Sound subsystem initialized
Event subsystem initialized
Detected game "Star Wars: Knights of the Old Republic"
[  0%] Declare languages (0.00s)
Using the first available language (English)
Setting the language to English
[  5%] Loading user game config (0.03s)
[ 11%] Setting base directory (0.04s)
[ 17%] Adding extra archive directories (0.05s)
[ 23%] Loading main KEY (0.12s)
[ 29%] Loading global auxiliary resources (0.71s)
[ 35%] Loading GUI textures (0.85s)
[ 41%] Indexing extra sound resources (0.89s)
[ 47%] Indexing extra voice resources (0.97s)
[ 52%] Indexing extra music resources (1.88s)
[ 58%] Indexing extra movie resources (1.89s)
[ 64%] Indexing Windows-specific resources (1.91s)
[ 70%] Indexing override files (1.95s)
[ 76%] Loading main talk table (1.96s)
[ 82%] Registering file formats (2.04s)
[ 88%] Loading game cursors (2.04s)
[ 94%] Initializing internal game config (2.06s)
[100%] Successfully initialized the engine (2.09s)
WARNING: TODO: Add scaling for custom resolutions. Supported resolutions are 800x600, 1024x768, 1280x960 and 1600x1200!
Loading texture pack 2
WARNING: Failed to create texture "M01aa_04a_a0002t" (-1)
    Because: No such image resource "M01aa_04a_a0002t"
WARNING: Failed to create texture "DOR_LHR02_a00004" (-1)
    Because: No such image resource "DOR_LHR02_a00004"
WARNING: Failed to create texture "DOR_LHR02_a00004" (-1)
    Because: No such image resource "DOR_LHR02_a00004"
WARNING: Failed to create texture "DOR_LHR02_a00004" (-1)
    Because: No such image resource "DOR_LHR02_a00004"
WARNING: Failed to create texture "DOR_LHR02_a00004" (-1)
    Because: No such image resource "DOR_LHR02_a00004"
Segmentation fault (core dumped)

Mind you, I did not set a debugging level.

EDIT2: The assets are from my 4 CD boxed copy of the game, patched to 1.03.

from xoreos.

aFoxNamedMorris avatar aFoxNamedMorris commented on May 9, 2024

Here is the GDB output:

Thread 8 "GameInstance" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd25a6700 (LWP 24556)]
0x0000555555bf95cc in ?? ()

[Thread 0x7fffd2da7700 (LWP 24555) exited]
[Thread 0x7fffd25a6700 (LWP 24556) exited]
[Thread 0x7fffd35a8700 (LWP 24554) exited]
[Thread 0x7fffd3fff700 (LWP 24553) exited]
[Thread 0x7fffe89e1700 (LWP 24552) exited]
[Thread 0x7fffebc77700 (LWP 24536) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

from xoreos.

DrMcCoy avatar DrMcCoy commented on May 9, 2024

You need to type 'bt' at that gdb prompt and the sanitizer output is missing the output from the sanitizers.

from xoreos.

aFoxNamedMorris avatar aFoxNamedMorris commented on May 9, 2024

Thanks! Sorry about that. I'll be back with that and the Valgrind data.

from xoreos.

aFoxNamedMorris avatar aFoxNamedMorris commented on May 9, 2024

Here is the Valgrind data:

==29787== Thread 7 GameInstance:                                                                                                                              
==29787== Invalid write of size 8                                                                                                                             
==29787==    at 0x7AD5CC: Engines::KotOR::KotORWidget::setSubScene(Graphics::Aurora::SubSceneQuad*) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)              
==29787==    by 0x7E411B: Engines::KotOR::HUD::setMinimap(Common::UString const&, int, float, float, float, float, float, float, float, float) (in /home/aaron
morris/SRC/xoreos/bin/xoreos)                                                                                                                                 
==29787==    by 0x7E28E7: Engines::KotOR::IngameGUI::setMinimap(Common::UString const&, int, float, float, float, float, float, float, float, float) (in /home
/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x7C3DD1: Engines::KotOR::Module::loadModule(Common::UString const&, Common::UString const&, Engines::KotOR::ObjectType) (in /home/aaronmorris
/SRC/xoreos/bin/xoreos)
==29787==    by 0x7C39FA: Engines::KotOR::Module::load(Common::UString const&, Common::UString const&, Engines::KotOR::ObjectType) (in /home/aaronmorris/SRC/x
oreos/bin/xoreos)
==29787==    by 0x7DE17F: Engines::KotOR::CharacterGenerationMenu::start() (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x7DF23D: Engines::KotOR::QuickCharPanel::callbackActive(Engines::Widget&) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DFC54: Engines::GUI::checkWidgetActive(Engines::Widget*) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DFE53: Engines::GUI::mouseUp(SDL_Event const&) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DECCE: Engines::GUI::processEventQueue() (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DE897: Engines::GUI::run(unsigned int) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DF743: Engines::GUI::sub(Engines::GUI&, unsigned int, bool, bool) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==  Address 0x100 is not stack'd, malloc'd or (recently) free'd                                                                                        
==29787==                                                                                                                                                     
==29787==
==29787== Process terminating with default action of signal 11 (SIGSEGV)                                                                                      
==29787==  Access not within mapped region at address 0x100                                                                                                   
==29787==    at 0x7AD5CC: Engines::KotOR::KotORWidget::setSubScene(Graphics::Aurora::SubSceneQuad*) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)              
==29787==    by 0x7E411B: Engines::KotOR::HUD::setMinimap(Common::UString const&, int, float, float, float, float, float, float, float, float) (in /home/aaron
morris/SRC/xoreos/bin/xoreos)
==29787==    by 0x7E28E7: Engines::KotOR::IngameGUI::setMinimap(Common::UString const&, int, float, float, float, float, float, float, float, float) (in /home
/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x7C3DD1: Engines::KotOR::Module::loadModule(Common::UString const&, Common::UString const&, Engines::KotOR::ObjectType) (in /home/aaronmorris
/SRC/xoreos/bin/xoreos)
==29787==    by 0x7C39FA: Engines::KotOR::Module::load(Common::UString const&, Common::UString const&, Engines::KotOR::ObjectType) (in /home/aaronmorris/SRC/x
oreos/bin/xoreos)
==29787==    by 0x7DE17F: Engines::KotOR::CharacterGenerationMenu::start() (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x7DF23D: Engines::KotOR::QuickCharPanel::callbackActive(Engines::Widget&) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DFC54: Engines::GUI::checkWidgetActive(Engines::Widget*) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DFE53: Engines::GUI::mouseUp(SDL_Event const&) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DECCE: Engines::GUI::processEventQueue() (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DE897: Engines::GUI::run(unsigned int) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==    by 0x8DF743: Engines::GUI::sub(Engines::GUI&, unsigned int, bool, bool) (in /home/aaronmorris/SRC/xoreos/bin/xoreos)
==29787==  If you believe this happened as a result of a stack                                                                                        [5/1981]
==29787==  overflow in your program's main thread (unlikely but
==29787==  possible), you can try to increase the size of the
==29787==  main thread stack using the --main-stacksize= flag.
==29787==  The main thread stack size used in this run was 8388608.
==29787==
==29787== HEAP SUMMARY:
==29787==     in use at exit: 146,690,055 bytes in 552,851 blocks
==29787==   total heap usage: 5,162,790 allocs, 4,609,939 frees, 1,935,877,662 bytes allocated
==29787==
==29787== LEAK SUMMARY:
==29787==    definitely lost: 16 bytes in 1 blocks
==29787==    indirectly lost: 176 bytes in 4 blocks
==29787==      possibly lost: 18,426,546 bytes in 2,214 blocks
==29787==    still reachable: 128,263,317 bytes in 550,632 blocks
==29787==                       of which reachable via heuristic:
==29787==                         newarray           : 14,456 bytes in 30 blocks
==29787==                         multipleinheritance: 176 bytes in 2 blocks
==29787==         suppressed: 0 bytes in 0 blocks
==29787== Rerun with --leak-check=full to see details of leaked memory
==29787==
==29787== For counts of detected and suppressed errors, rerun with: -v
==29787== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 1)
Segmentation fault (core dumped)

And here is the GDB output from the bt command:

#0  0x0000555555bf95cc in ?? ()
#1  0x00007fffb4ca3b60 in ?? ()
#2  0x0000000000000000 in ?? ()

from xoreos.

DrMcCoy avatar DrMcCoy commented on May 9, 2024

Ah, yes, the valgrind log is useful, thanks :)! I wonder why it's missing source files and line numbers, but, eh, it works.

And yeah, I can see the issue now. The map view widget does not exist in the ingame GUI for you, and the code didn't properly check for that.

It seems like you're starting xoreos with KotOR in a resolution that's not supported by the original game (800x600, 1024x768, 1280x960 and 1600x1200). xoreos currently doesn't stop you from that, but spits out a warning. In the future, we might either disallow unsupported resolutions altogether or scale the GUI somehow.

We also, at the moment, don't support any of the widescreen mods, I think. Also, the Xbox version of the game is currently broken, and I'm not sure about the Mac OS and iOS versions. In short, only the original Windows is release was actually tested ATM. :P

Because the GUI files only exist for certain resolutions, xoreos then won't load the ingame GUI at all. The code that sets up the mini map doesn't account for that, and then crashes.

I fixed that with fb0d69b, and it should work now. Please test and say if it does for you, thanks.

But really, you should probably start xoreos with one of the supported resolutions. You can select them with the --width and --height command line options.

from xoreos.

aFoxNamedMorris avatar aFoxNamedMorris commented on May 9, 2024

Thank you so much! I'm on it.

EDIT: @DrMcCoy That did it! Thanks a ton for your time, and for the explanation. Looking forward to seeing where this goes!

from xoreos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.