Help with VS engine crash on loading New_Game (Priv:WCU)

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ermo »

Hey,

So, while I'm slogging through the cleanup and conversion of my Privateer: Parallel Universe pet continuation project to python 3, I recently began getting an error when starting a new game.

The game message looks like this:

Code: Select all

 ;;; VS.loadGame(VS.getNewGameSaveName=New_Game)
Found ship named : tarsus.begin
Faction not found assigning default one: privateer
terminate called after throwing an instance of 'std::length_error'
  what():  vector::reserve
fish: Job 1, “bin/vs-py3-debug” terminated by signal SIGABRT (Abort)
The first line is from a python debug statement that I inserted into main_menu.py, which shows that a call to load New_Game from a VS method is requested as part of the python script.

Since I know that klauss loves full backtraces, this is what a full backtrace looks like (note that New_Game is ASCII encoded):

Code: Select all

 ;;; VS.loadGame(VS.getNewGameSaveName=New_Game)
 +++ m/dynamic_battle.py:342 <<507>> = Director.getSaveStringLength(fg_util.ccp=0, key=FF:1)
 +++ m/dynamic_battle.py:352 >>Rho<< = Director.getSaveString(fg_util.ccp=0, key=FF:1, lftiter=34)
 +++ m/dynamic_battle.py:342 <<507>> = Director.getSaveStringLength(fg_util.ccp=0, key=FF:1)
 +++ m/dynamic_battle.py:352 >>Base_Sol/E-Erandi<< = Director.getSaveString(fg_util.ccp=0, key=FF:1, lftiter=35)
Found ship named : tarsus.begin
Faction not found assigning default one: privateer
terminate called after throwing an instance of 'std::length_error'
  what():  vector::reserve

Program received signal SIGABRT, Aborted.
0x0000003c9ba35c39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing separate debuginfos, use: debuginfo-install SDL-1.2.15-12.fc20.x86_64 dbus-libs-1.6.12-8.fc20.x86_64 expat-2.1.0-7.fc20.x86_64 flac-libs-1.3.0-3.fc20.x86_64 freeglut-2.8.1-3.fc20.x86_64 gsm-1.0.13-10.fc20.x86_64 json-c-0.11-6.fc20.x86_64 libICE-1.0.8-6.fc20.x86_64 libSM-1.2.1-6.fc20.x86_64 libX11-1.6.1-1.fc20.x86_64 libXau-1.0.8-2.fc20.x86_64 libXcursor-1.1.14-2.fc20.x86_64 libXext-1.3.2-2.fc20.x86_64 libXfixes-5.0.1-2.fc20.x86_64 libXi-1.7.2-2.fc20.x86_64 libXmu-1.1.1-5.fc20.x86_64 libXrandr-1.4.1-2.fc20.x86_64 libXrender-0.9.8-2.fc20.x86_64 libXt-1.1.4-7.fc20.x86_64 libXtst-1.2.2-2.fc20.x86_64 libXxf86vm-1.1.3-2.fc20.x86_64 libasyncns-0.8-6.fc20.x86_64 libattr-2.4.47-3.fc20.x86_64 libcap-2.22-7.fc20.x86_64 libjpeg-turbo-1.3.1-2.fc20.x86_64 libogg-1.3.0-6.fc20.x86_64 libpng-1.6.3-3.fc20.x86_64 libsndfile-1.0.25-8.fc20.x86_64 libuuid-2.24.2-1.fc20.x86_64 libvorbis-1.3.4-1.fc20.x86_64 libxcb-1.9.1-3.fc20.x86_64 mesa-libGLU-9.0.0-4.fc20.x86_64 openal-soft-1.15.1-3.fc20.x86_64 pulseaudio-libs-4.0-13.gitf81e3.fc20.x86_64 tcp_wrappers-libs-7.6-76.fc20.x86_64 zlib-1.2.8-3.fc20.x86_64
(gdb) bt full
#0  0x0000003c9ba35c39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 27827
        selftid = 27827
#1  0x0000003c9ba37348 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0xffffffffffffffff, sa_sigaction = 0xffffffffffffffff}, sa_mask = {__val = {18446744073709551615, 
              163336360, 260304856870, 257698037765, 0, 13756880, 260309019968, 13756880, 163336360, 163336288, 260304884101, 140737349564384, 260309936125, 
              1, 140737349566736, 163194000}}, sa_flags = 10, sa_restorer = 0x7ffff7ba3800}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x0000003ca3a60f85 in __gnu_cxx::__verbose_terminate_handler () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
        terminating = true
        t = <optimized out>
#3  0x0000003ca3a5eee6 in __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
No locals.
#4  0x0000003ca3a5ef13 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
No locals.
#5  0x0000003ca3a5f13f in __cxxabiv1::__cxa_throw (obj=0x9ba2500, tinfo=<optimized out>, dest=<optimized out>)
    at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:84
No locals.
#6  0x0000003ca3ab39f7 in std::__throw_length_error (__s=__s@entry=0x9e29b0 "vector::reserve") at ../../../../../libstdc++-v3/src/c++11/functexcept.cc:76
No locals.
#7  0x0000000000639f3a in std::vector<std::string, std::allocator<std::string> >::reserve (this=<optimized out>, __n=18446744073709551615)
    at /usr/include/c++/4.8.2/bits/vector.tcc:69
No locals.
#8  0x00000000008523df in SaveGame::ReadMissionStringData (this=this@entry=0x8bc7a90, 
Python Exception <type 'exceptions.IndexError'> list index out of range: 
    buf=@0x7fffffffb2d8: 0xa13ff88 "3079\n4 FF:1516 12 Base_Sol/Sol8 Stanford6 Banjul17 Base_Vega/Proxima15 Base_Vega/Munro17 Base_Enigma/Niven5 Skien19 Base_Enigma/Salayna12 Saundersfoot16 Base_Enigma/Brin6 Delran5 Lisse9 Magdeburg19 Ba"..., select_data=select_data@entry=false, 
    select_data_filter=std::set with 0 elements) at /home/ermo/VegaStrike/trunk/vegastrike/src/savegame.cpp:566
        md_i_size = -1
        mag_num = "1 "
        vecstring = <optimized out>
        skip = true
        i = 3049
        mdsize = 3079
        buf2 = 0xa17b5fa "-1 0.3 1 -1 0.7 1 1 0.2 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 -1 1 -0.8 -1 0.2 -1 -1 -1 0 -1 -1 -0.8 -0.5 0 0 0 0 0 0 0 0 0 0 -0.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0.15 -0.8 1 0.3 -0.5 -0."...
#9  0x00000000008526ce in SaveGame::ReadSavedPackets (this=this@entry=0x8bc7a90, 
    buf=@0x7fffffffb2d8: 0xa13ff88 "3079\n4 FF:1516 12 Base_Sol/Sol8 Stanford6 Banjul17 Base_Vega/Proxima15 Base_Vega/Munro17 Base_Enigma/Niven5 Skien19 Base_Enigma/Salayna12 Saundersfoot16 Base_Enigma/Brin6 Delran5 Lisse9 Magdeburg19 Ba"..., commitfactions=commitfactions@entry=true, 
---Type <return> to continue, or q <return> to quit---
Python Exception <type 'exceptions.IndexError'> list index out of range: 
    skip_news=skip_news@entry=false, select_data=select_data@entry=false, select_data_filter=std::set with 0 elements)
    at /home/ermo/VegaStrike/trunk/vegastrike/src/savegame.cpp:673
        a = 0
        unitname = "missionstring\000\000\000\220\252\377\377\377\177\000\000h\252\377\377\377\177\000\000x\217\354\t\000\000\000\000\240\252\377\377\377\177\000\000\271\000\000\000\000\000\000\000\061U\000\000\000\200\377\377\000\000\000\000\000\000$\364\003\000\000\000\000\000\000\000\063\000\000\000\000@5E\026\270\243\233<\000\000\000\200", '\000' <repeats 15 times>, "\177\003\000\000n", '\000' <repeats 19 times>, "\v", '\000' <repeats 15 times>, "\f\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000aգ\233<", '\000' <repeats 11 times>, "\240"...
        factname = "data\000\000\000\000p\257\377\377\377\177\000\000\000\000\000\000\000\000\000\000\f", '\000' <repeats 19 times>, "C\b\260\026", '\000' <repeats 16 times>, "`\220ۛ<\000\000\000\000\001\000\000\000\000\000\000>\343\242\000\001\000\000\000\233u\236\000\000\000\000\000\377\377\377\377\000\000\000\000\200\254\377\377\377\177", '\000' <repeats 26 times>, "\v\000\000\000\000\000\000\000\213\254\377\377\377\177\000\000\211M\210\000\000\000\000\000H\300\000\002\000\000\000\000\070\263\377\377\377\177\000\000\370,\371\t\000\000\000\000\000\000\000\000\002\000\000\000\030\000\000\000\060\000\000\000\200"...
#10 0x0000000000852fc1 in SaveGame::ParseSaveGame (this=0x8bc7a90, filename_p="explore_wcuniverse", FSS="", originalstarsystem="", PP=..., 
    shouldupdatepos=@0x7fffffffb4df: true, credits=@0x8bfafb8: 2900, savedstarship=std::vector of length 1, capacity 1 = {...}, 
    player_num=player_num@entry=0, save_contents="", read=read@entry=true, commitfaction=commitfaction@entry=true, quick_read=quick_read@entry=false, 
Python Exception <type 'exceptions.IndexError'> list index out of range: 
    skip_news=skip_news@entry=false, select_data=select_data@entry=false, select_data_filter=std::set with 0 elements)
    at /home/ermo/VegaStrike/trunk/vegastrike/src/savegame.cpp:971
        buf = 0xa13ff88 "3079\n4 FF:1516 12 Base_Sol/Sol8 Stanford6 Banjul17 Base_Vega/Proxima15 Base_Vega/Munro17 Base_Enigma/Niven5 Skien19 Base_Enigma/Salayna12 Saundersfoot16 Base_Enigma/Brin6 Delran5 Lisse9 Magdeburg19 Ba"...
        headlen = 72
        factionname = 0x9f49eb0 "\020"
        deletebuf = 0xa13fec0 "Gemini/Troy^2900.000000^tarsus.begin 17972.762846 516.810020 517.512846"
        tmp2 = 0x9ebe2b0 "Gemini/Troy"
        freetmp2 = 0x9ebe2b0 "Gemini/Troy"
        tmppos = {{i = 17972.762846000001, x = 17972.762846000001}, {j = 516.81002000000001, y = 516.81002000000001}, {k = 517.51284599999997, 
            z = 517.51284599999997}}
        res = 4
        str = ""
        filename = ""
        f = {fp = 0x99aea20, pk3_file = 0x0, pk3_extracted_file = 0x0, file_index = -1, offset = 0, file_type = VSFileSystem::UnknownFile, 
          alt_type = VSFileSystem::UnknownFile, file_mode = VSFileSystem::ReadOnly, volume_type = VSFileSystem::VSFSNone, filename = "New_Game", 
          subdirectoryname = "", directoryname = "", rootname = "", size = 247016, valid = true}
        err = <optimized out>
#11 0x00000000008f7717 in Cockpit::Update (this=0x8bfadd0) at /home/ermo/VegaStrike/trunk/vegastrike/src/gfx/cockpit_generic.cpp:747
        actually_have_save = <optimized out>
        ss = <optimized out>
        whichcp = 0
        mysize = <optimized out>
        un = <optimized out>
        k = 0
        newsystem = ""
---Type <return> to continue, or q <return> to quit---
        setplayerXloc = true
        packedInfo = std::vector of length 1, capacity 1 = {"tarsus.begin"}
        persistent_on_load = false
        savedtextures = {backups = {0xffffffff00000000, 0x7fffe6bc0d90, 0x7fffe6bc0d98, 0x7fffe6bc0d98, 0x7fffec069620, 0x7fffffffb650, 0x7fffffffb638}}
        saved = std::vector of length 32212254721, capacity 1719226 = {<error reading variable saved (Cannot access memory at address 0x0)>
        fgsnumber = <optimized out>
        savegamefile = "explore_wcuniverse"
        pos = {{i = 0, x = 0}, {j = 0, y = 0}, {k = 0, z = 0}}
        tmpoldpos = {{i = 119990000000, x = 119990000000}, {j = -9000000, y = -9000000}, {k = -109990000000, z = -109990000000}}
        initialzoom = 2.25
        autoclear = false
#12 0x000000000085a64b in StarSystem::Update (this=0x8d47640, priority=1, executeDirector=executeDirector@entry=true)
    at /home/ermo/VegaStrike/trunk/vegastrike/src/star_system_generic.cpp:705
        j = 0
        firstframe = <optimized out>
        normal_simulation_atom = 0.0599999987
        bolttime = <optimized out>
#13 0x000000000048b0b1 in GameUniverse::StartDraw (this=0x807d850) at /home/ermo/VegaStrike/trunk/vegastrike/src/universe.cpp:279
        i = 0
        lastStarSystem = <optimized out>
        sorttime = 131
#14 0x0000000000476a79 in main_loop () at /home/ermo/VegaStrike/trunk/vegastrike/src/main_loop.cpp:1018
No locals.
#15 0x00000000006d1258 in winsys_process_events () at /home/ermo/VegaStrike/trunk/vegastrike/src/gldrv/winsys.cpp:534
        key = <optimized out>
        y = 0
        state = <optimized out>
        event = {type = 6 '\006', active = {type = 6 '\006', gain = 0 '\000', state = 1 '\001'}, key = {type = 6 '\006', which = 0 '\000', state = 1 '\001', 
            keysym = {scancode = 164 '\244', sym = SDLK_UNKNOWN, mod = KMOD_NONE, unicode = 0}}, motion = {type = 6 '\006', which = 0 '\000', 
            state = 1 '\001', x = 420, y = 683, xrel = 0, yrel = 0}, button = {type = 6 '\006', which = 0 '\000', button = 1 '\001', state = 0 '\000', 
            x = 420, y = 683}, jaxis = {type = 6 '\006', which = 0 '\000', axis = 1 '\001', value = 420}, jball = {type = 6 '\006', which = 0 '\000', 
            ball = 1 '\001', xrel = 420, yrel = 683}, jhat = {type = 6 '\006', which = 0 '\000', hat = 1 '\001', value = 0 '\000'}, jbutton = {
            type = 6 '\006', which = 0 '\000', button = 1 '\001', state = 0 '\000'}, resize = {type = 6 '\006', w = 44761508, h = 0}, expose = {
            type = 6 '\006'}, quit = {type = 6 '\006'}, user = {type = 6 '\006', code = 44761508, data1 = 0x0, data2 = 0x0}, syswm = {type = 6 '\006', 
            msg = 0x0}}
        x = 32
        keysym_to_unicode = {0 <repeats 256 times>}
        keysym_to_unicode_init = true
#16 0x00000000006be6ac in GFXLoop (main_loop=0x6d32e0 <bootstrap_first_loop()>) at /home/ermo/VegaStrike/trunk/vegastrike/src/gldrv/gl_init.cpp:739
        are_we_looping = true
---Type <return> to continue, or q <return> to quit---
#17 0x0000000000489d44 in GameUniverse::Loop (this=<optimized out>, main_loop=<optimized out>) at /home/ermo/VegaStrike/trunk/vegastrike/src/universe.cpp:156
No locals.
#18 0x00000000006d3048 in main (argc=1, argv=0x7fffffffdf08) at /home/ermo/VegaStrike/trunk/vegastrike/src/main.cpp:350
        exitcode = <optimized out>
        temp = std::vector of length 25, capacity 25 = {std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 2 '\002', 1 '\001', 1 '\001', 0 '\000', 31 '\037', 31 '\037', 3 '\003', 5 '\005', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {1 '\001', 31 '\037', 
            5 '\005', 5 '\005', 2 '\002', 1 '\001', 1 '\001', 0 '\000', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 3 '\003', 31 '\037', 10 '\n', 
            6 '\006', 12 '\f', 31 '\037', 31 '\037', 6 '\006', 6 '\006', 6 '\006', 6 '\006', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 
            31 '\037', 31 '\037', 5 '\005', 31 '\037', 31 '\037', 31 '\037', 5 '\005', 1 '\001', 0 '\000', 0 '\000', 2 '\002', 31 '\037', 31 '\037', 
            1 '\001', 3 '\003', 16 '\020', 20 '\024', 31 '\037', 31 '\037', 16 '\020', 16 '\020', 16 '\020', 16 '\020', 31 '\037'}, 
          std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 1 '\001', 2 '\002', 
            2 '\002', 16 '\020', 31 '\037', 31 '\037', 3 '\003', 3 '\003', 31 '\037', 3 '\003', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {1 '\001', 31 '\037', 20 '\024', 10 '\n', 5 '\005', 4 '\004', 4 '\004', 0 '\000', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 10 '\n', 5 '\005', 6 '\006', 20 '\024', 31 '\037', 31 '\037', 6 '\006', 
            6 '\006', 6 '\006', 6 '\006', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 30 '\036', 0 '\000', 
            0 '\000', 0 '\000', 1 '\001', 30 '\036', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 8 '\b', 4 '\004', 8 '\b', 20 '\024', 31 '\037', 
            31 '\037', 8 '\b', 8 '\b', 8 '\b', 8 '\b', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 30 '\036', 
            0 '\000', 0 '\000', 0 '\000', 1 '\001', 30 '\036', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 8 '\b', 4 '\004', 8 '\b', 4 '\004', 
            4 '\004', 31 '\037', 8 '\b', 8 '\b', 8 '\b', 8 '\b', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 
            5 '\005', 25 '\031', 25 '\031', 25 '\031', 20 '\024', 1 '\001', 0 '\000', 0 '\000', 0 '\000', 31 '\037', 31 '\037', 1 '\001', 3 '\003', 
            16 '\020', 26 '\032', 31 '\037', 31 '\037', 16 '\020', 16 '\020', 16 '\020', 16 '\020', 31 '\037'}, std::vector of length 25, capacity 25 = {
            31 '\037', 31 '\037', 31 '\037', 30 '\036', 30 '\036', 30 '\036', 30 '\036', 20 '\024', 0 '\000', 5 '\005', 1 '\001', 5 '\005', 20 '\024', 
            25 '\031', 1 '\001', 2 '\002', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, 
          std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 30 '\036', 30 '\036', 30 '\036', 30 '\036', 30 '\036', 3 '\003', 
            1 '\001', 0 '\000', 2 '\002', 20 '\024', 25 '\031', 4 '\004', 5 '\005', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 1 '\001', 25 '\031', 20 '\024', 31 '\037', 31 '\037', 31 '\037', 20 '\024', 20 '\024', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 30 '\036', 30 '\036', 30 '\036', 1 '\001', 2 '\002', 0 '\000', 3 '\003', 4 '\004', 31 '\037', 31 '\037', 1 '\001', 4 '\004', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {
            4 '\004', 31 '\037', 31 '\037', 31 '\037', 6 '\006', 5 '\005', 5 '\005', 2 '\002', 2 '\002', 1 '\001', 3 '\003', 2 '\002', 1 '\001', 0 '\000', 
            0 '\000', 3 '\003', 31 '\037', 5 '\005', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, 
          std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 5 '\005', 6 '\006', 6 '\006', 4 '\004', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 31 '\037', 5 '\005', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 4 '\004', 1 '\001', 0 '\000', 0 '\000', 31 '\037', 2 '\002', 3 '\003', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 2 '\002', 0 '\000', 31 '\037', 
            1 '\001', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {0 '\000', 
---Type <return> to continue, or q <return> to quit---
            1 '\001', 0 '\000', 2 '\002', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, 
          std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 29 '\035', 29 '\035', 29 '\035', 29 '\035', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 10 '\n', 11 '\v', 31 '\037', 0 '\000', 31 '\037', 0 '\000', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 0 '\000', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 0 '\000', 
            1 '\001', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, 
          std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 20 '\024', 
            1 '\001', 0 '\000', 0 '\000', 31 '\037', 31 '\037', 30 '\036', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 31 '\037', 31 '\037', 2 '\002', 3 '\003', 31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {31 '\037', 31 '\037', 31 '\037', 
            31 '\037', 2 '\002', 1 '\001', 1 '\001', 0 '\000', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 4 '\004', 
            31 '\037', 2 '\002', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}, std::vector of length 25, capacity 25 = {
            31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 2 '\002', 1 '\001', 1 '\001', 0 '\000', 31 '\037', 
            31 '\037', 3 '\003', 5 '\005', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037', 31 '\037'}}
(gdb) 
I don't suppose some kind soul has a clue about what is going on? :)
You do not have the required permissions to view the files attached to this post.
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ezee »

Hi .

Are you using a debug version of python with release version of VS ?
bin/vs-py3-debug

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ermo »

ezee wrote:Hi .

Are you using a debug version of python with release version of VS ?
bin/vs-py3-debug
I compiled VS r13678 with the Debug profile and -Og optimization selected in ccmake. I made sure to install debug symbols for gcc and python3 as well (because I chatted to klauss and he indicated that the more info, the merrier).

The executable is just linked to my Priv:WCU bin/ game data dir from the trunk/vegastrike SVN dir where the VS executable lives after being compiled. FWIW, I have compiled vs-py3-debug, vs-py3-release, vs-py2-debug and vs-py2-release and named them accordingly to avoid any confusion. I used the internal Boost libraries.
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ezee »

Okay .
I suggest you to try the release version , and see what happens .
Sometimes , the debug version can be different than the release ( i personally spent more time in release mode than in debug , so
perhaps it's the same for the other devs ? ).

It seem that the use of python3 is problematic , in a lot of cases .
Why do you want to use python3 in your project , for what real benefits ?
Is there a specific reason ( like the use of new external libs that need python3 ) or it is just to upgrade your system with the new/last
python release ?

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ermo »

I switched to python 3 because I want to distribute my own Windows version of the VS binary.

Now, py2.7 officially requires VS2008 in order to be compiled on Windows. VS2008 Express Edition is no longer officially supported and quite hard to get a hold of (although I did manage to find a copy). And I'm not in the mood to try to make py2.7 compile with VS2010 Express Edition -- I believe it is simply a waste of time, especially since it is not officially supported by the python developers.

Py3.x is compiled with VS2010 and can be compiled with VS 2010 Express Edition out of the box, just like VS, so it seemed the obvious choice for less painful Windows support. Travists is on Windows and he is not currently able to contribute to Priv:WCU because there is no working Windows version of VS available with the necessary python modules.

Now, can we get back to trying to find the error in the traceback and point towards possible solutions, please? To me it appears that the error is to be found between #10 and #6 in the backtrace, though I am unsure what to make of it and where to look... :)
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ezee »

Now, can we get back to trying to find the error in the traceback and point towards possible solutions, please? To me it appears that the error is to be found between #10 and #6 in the backtrace, though I am unsure what to make of it and where to look... :)
Sure !
Thez error is caused by a bad memory allocation in a Vector container :
terminate called after throwing an instance of 'std::length_error'
what(): vector::reserve
The context seem to be in :
#8 0x00000000008523df in SaveGame::ReadMissionStringData (this=this@entry=0x8bc7a90,
Python Exception <type 'exceptions.IndexError'> list index out of range:
The index that was used point to a non-existent memory .
Why ?
duno , because there is many possibilities , from a bad mission file ( that ends with a crash ) , a bad csv entry , etc ...

Sorry , but it's difficult to diagnose here for me , i am a windows user and i am not familiar with your environment .
Edit : I suspect python 3 behavior to be different from 2.7 , i had the same kind of crash
when i was trying to run the actual trunk version for windows .
Read that :
This article explains the new features in Python 3.0, compared to 2.6. Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever intentionally backwards incompatible Python release. source : https://docs.python.org/3.0/whatsnew/3.0.html
more specific to files ( perhaps your problem here ...)
Files opened as text files (still the default mode for open()) always use an encoding to map between strings (in memory) and bytes (on disk). Binary files (opened with a b in the mode argument) always use bytes in memory. This means that if a file is opened using an incorrect mode or encoding, I/O will likely fail loudly, instead of silently producing incorrect data. It also means that even Unix users will have to specify the correct mode (text or binary) when opening a file. There is a platform-dependent default encoding, which on Unixy platforms can be set with the LANG environment variable (and sometimes also with some other platform-specific locale-related environment variables). In many cases, but not all, the system default is UTF-8; you should never count on this default. Any application reading or writing more than pure ASCII text should probably have a way to override the encoding. There is no longer any need for using the encoding-aware streams in the codecs module.
in your traceback , there is a reference to Locals ....
#4 0x0000003ca3a5ef13 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
No locals.
#5 0x0000003ca3a5f13f in __cxxabiv1::__cxa_throw (obj=0x9ba2500, tinfo=<optimized out>, dest=<optimized out>)
at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:84
No locals.
You are under unix
#0 0x0000003c9ba35c39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
and :
I switched to python 3 because I want to distribute my own Windows version of the VS binary.
:?:

Edit : I use vs2008 because it's faster with windows xp , but c++11 can't be used .
The only solution that worked for me out of the box is the tag/0.5.1.rc1
And it's working with python 2.7
If your goal is to help Travis , perhaps he could try this tag/0.5.1 rc1 ?

If you really want to use Python3 , read that before :
Porting To Python 3.0
For porting existing Python 2.5 or 2.6 source code to Python 3.0, the best strategy is the following:

(Prerequisite:) Start with excellent test coverage.
Port to Python 2.6. This should be no more work than the average port from Python 2.x to Python 2.(x+1). Make sure all your tests pass.
(Still using 2.6:) Turn on the -3 command line switch. This enables warnings about features that will be removed (or change) in 3.0. Run your test suite again, and fix code that you get warnings about until there are no warnings left, and all your tests still pass.
Run the 2to3 source-to-source translator over your source code tree. (See 2to3 - Automated Python 2 to 3 code translation for more on this tool.) Run the result of the translation under Python 3.0. Manually fix up any remaining issues, fixing problems until all tests pass again.
It is not recommended to try to write source code that runs unchanged under both Python 2.6 and 3.0; you’d have to use a very contorted coding style, e.g. avoiding print statements, metaclasses, and much more. If you are maintaining a library that needs to support both Python 2.6 and Python 3.0, the best approach is to modify step 3 above by editing the 2.6 version of the source code and running the 2to3 translator again, rather than editing the 3.0 version of the source code.

For porting C extensions to Python 3.0, please see Porting Extension Modules to 3.0.

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ermo »

ezee wrote:
Now, can we get back to trying to find the error in the traceback and point towards possible solutions, please? To me it appears that the error is to be found between #10 and #6 in the backtrace, though I am unsure what to make of it and where to look... :)
Sure !
Thez error is caused by a bad memory allocation in a Vector container :
terminate called after throwing an instance of 'std::length_error'
what(): vector::reserve
The context seem to be in :
#8 0x00000000008523df in SaveGame::ReadMissionStringData (this=this@entry=0x8bc7a90,
Python Exception <type 'exceptions.IndexError'> list index out of range:
The index that was used point to a non-existent memory .
Why ?
duno , because there is many possibilities , from a bad mission file ( that ends with a crash ) , a bad csv entry , etc ...
Looking at the vegastrike/trunk/data/New_Game file and comparing it with the New_Game file from Priv:WCU, it appears that the file format may have changed? If so, it is plausible that the VS code could barf when encountering something unexpected in the Priv:WCU New_Game file...?
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ezee »

All i know , is that in some python files , perhaps even mission file , i've seen some comments
about default parameters for the engine . So i guess that if this mission file don't have the requisite string ,
you end up with a crash , yes .

Can you paste the differences in the new_game that you have found ?
I will try to find that file with the dev's comment .
:)

EDIT : Okay , i've found it .
It's in main_menu.mission :
<mission>
<settings>
<origin planet="earth" x="0000" y="100" z="000.0"/>
</settings>

<variables>
<var name="credits" value="13500"/>
<var name="defaultplayer" value="blue"/>
<var name="mission_name" value="Vega Strike Main Menu" />
<var name="difficulty" value=".25"/><!--good starting difficulty here-->
<var name="system" value="Special/Empty" />
<var name="description" value="Welcome to Vega Strike: Upon the Cold Sea." />
<var name="savegame" value="main_menu" />
</variables>

<flightgroups>
<!-- need at least one, to avoid messing with the engine -->
<flightgroup name="Shlimazel" faction="privateer" type="dumbfire" ainame="default" waves="1" nr_ships="1">
<pos x="119990000000" y="-9000000" z="-109990000000.0"/>
</flightgroup>
</flightgroups>
Ah aaah !
That will not solve your problem , but i understand now why sometimes i had a dumbfire
as vessel ...
You remember that topic ? -> http://forums.vega-strike.org/viewtopic.php?f=0&t=18648
Same problem with python 2.7 versus 3 .

Edit 2 :

there is in your error log :
[quote]Faction not found assigning default one: privateer
terminate called after throwing an instance of 'std::length_error'
what(): vector::reserve[/quote]

That seem to match the definition in main_menu.mission :
<!-- need at least one, to avoid messing with the engine -->
<flightgroup name="Shlimazel" faction="privateer" type="dumbfire" ainame="default" waves="1" nr_ships="1">
<pos x="119990000000" y="-9000000" z="-109990000000.0"/>
</flightgroup>
</flightgroups>[/quote]

we see that a faction is given AND a type .
I think the type is missing in your new_game file .
mm... i just look inside your file , and there is a tarsus defined .
Are you sure the typo is correct ? I mean , tarsus or Tarsus ?
Try with a Llama.begin to verify that point of typo .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ermo
Mercenary
Mercenary
Posts: 104
Joined: Tue Oct 30, 2012 7:46 pm

Re: Help with VS engine crash on loading New_Game (Priv:WCU)

Post by ermo »

Better late than never, I guess:

A quick heads up that I isolated the error in New_Game file. I had edited the New_Game file manually but it turns out that what I needed to do was to programmatically convert it from ISO-8859-1 to UTF-8 -- otherwise the code would try to allocate strings of length -1 which would obviously fail.

In the course of fixing this, I made a small VS patch to guard against this error and print an error message to the console when trying to read an invalid savegame line.
Privateer: Wing Commander Universe -- the continuation of chuck_starchaser's Privateer: Parallel Universe mod.
Post Reply