boost::bad_any_cast: failed conversion using boost::any_cast

boost::bad_any_cast: failed conversion using boost::any_cast

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
vnull
Posts: 3
Joined: 21 Apr 2010, 18:43

boost::bad_any_cast: failed conversion using boost::any_cast

Post by vnull »

Hi,

springlobby is calling: 06:42:40 PM: spring call params: "/usr/local/bin/spring" --config="/home/XXX/.springrc" "/home/XXX/Spring//script.txt"
Spring is throwing: "boost::bad_any_cast: failed conversion using boost::any_cast"
This is CentOS5.3, Spring 0.81.2.1 (compiled from source), libboost 1.39 (installed from source)
I can launch spring binary itself, go to skirmish and play with bot, but any attempt to use script.txt or something like this fails with mentioned message.

0.79.xxx worked OK.

Any help?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: boost::bad_any_cast: failed conversion using boost::any_cast

Post by hoijui »

check if infolog.txt has more useful info (eg. a stack trace), and if so, attach it as a file here please.
maybe other versions of boost work better, or try compiling spring with debug symbols (cmake -DCMAKE_BUILD_TYPE=DEBUG2), and run it in gdb.
vnull
Posts: 3
Joined: 21 Apr 2010, 18:43

Re: boost::bad_any_cast: failed conversion using boost::any_cast

Post by vnull »

hoijui wrote:check if infolog.txt has more useful info (eg. a stack trace), and if so, attach it as a file here please.
maybe other versions of boost work better, or try compiling spring with debug symbols (cmake -DCMAKE_BUILD_TYPE=DEBUG2), and run it in gdb.

Code: Select all

(gdb) run
Starting program: /usr/local/bin/spring script.txt
[Thread debugging using libthread_db enabled]
using default configuration source "/home/vnull/.springrc"
[CMyMath::Init] CPU SSE mask: 120, flags:
        SSE 1.0:  1,  SSE 2.0:  1
        SSE 3.0:  1, SSSE 3.0:  0
        SSE 4.1:  0,  SSE 4.2:  0
        SSE 4.0A: 0,  SSE 5.0A: 0
        using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Linux
OS: 32bit native mode
Adding /home/vnull/Spring to directories
Adding /usr/local/bin to directories
Adding /home/vnull/.spring to directories
Adding /usr/local/share/games/spring to directories
LogOutput initialized.
Spring 0.81.2.1 (Debug)
Build date/time: Apr 21 2010 20:41:06
Available log subsystems: mapinfo, CollisionVolume, unit, VFS-detail, VFS, ArchiveScanner, Sound
Enabled log subsystems: Sound
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
Using read-write data directory: /home/vnull/Spring/
Using read-only  data directory: /usr/local/bin/
Using read-only  data directory: /home/vnull/.spring/
Using read-only  data directory: /usr/local/share/games/spring/
Scanning: /usr/local/share/games/spring/maps
Scanning: /usr/local/share/games/spring/base
Scanning: /usr/local/share/games/spring/mods
Scanning: /home/vnull/.spring/maps
Scanning: /home/vnull/.spring/mods
Scanning: /home/vnull/Spring/maps
[New Thread 0xb7f7b6f0 (LWP 3579)]
[New Thread 0xb7315b90 (LWP 3582)]
Video mode set to  800 x 600 / 32 bit
SDL:  1.2.10
GL:   1.5.8 NVIDIA 96.43.11
GL:   NVIDIA Corporation
GL:   GeForce2 MX/AGP/SSE2/3DNOW!
GLEW: 1.3.5
Joysticks found: 0
Joystick 0 not found
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast> >'
  what():  boost::bad_any_cast: failed conversion using boost::any_cast

Program received signal SIGABRT, Aborted.
0x00a30402 in __kernel_vsyscall ()
(gdb) bt
#0  0x00a30402 in __kernel_vsyscall ()
#1  0x00798d80 in raise () from /lib/libc.so.6
#2  0x0079a691 in abort () from /lib/libc.so.6
#3  0x0058b4c0 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#4  0x00588f25 in ?? () from /usr/lib/libstdc++.so.6
#5  0x00588f62 in std::terminate () from /usr/lib/libstdc++.so.6
#6  0x0058909a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0x086959a9 in boost::throw_exception<boost::bad_any_cast> (e=@0xbffcb11c)
    at /usr/local/include/boost/throw_exception.hpp:64
#8  0x08695a99 in boost::any_cast<std::string const&> (operand=@0xa91f004)
    at /usr/local/include/boost/any.hpp:195
#9  0x08695adf in boost::any_cast<std::string const&> (operand=@0xa91f004)
    at /usr/local/include/boost/any.hpp:210
#10 0x08695af3 in boost::program_options::variable_value::as<std::string> (this=0xa91f004)
    at /usr/local/include/boost/program_options/variables_map.hpp:64
#11 0x0869334b in BaseCmd::GetInputFile (this=0xa8ff3a8)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/Platform/BaseCmd.cpp:42
#12 0x0863f749 in SpringApp::Startup (this=0xbffcb554)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/SpringApp.cpp:733
#13 0x08646036 in SpringApp::Initialize (this=0xbffcb554)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/SpringApp.cpp:243
#14 0x0864609a in SpringApp::Run (this=0xbffcb554, argc=2, argv=0xbffcb634)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/SpringApp.cpp:950
---Type <return> to continue, or q <return> to quit---
#15 0x0868a13d in Run (argc=2, argv=0xbffcb634)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/Main.cpp:111
#16 0x0868a19a in main (argc=Cannot access memory at address 0xdfb
)
    at /home/vnull/Downloads/spring_0.81.2.1/rts/System/Main.cpp:127
(gdb)
/home/vnull/Downloads/spring_0.81.2.1/rts/System/Platform/BaseCmd.cpp:42 (return vm):

Code: Select all

std::string BaseCmd::GetInputFile()
{
    if (vm.count("input-file"))
        return vm["input-file"].as<std::string>();
    else
        return "";
}
Any ideas?
vnull
Posts: 3
Joined: 21 Apr 2010, 18:43

Re: boost::bad_any_cast: failed conversion using boost::any_cast

Post by vnull »

OK, recompiled cmake, boost 1.41 and afterwards Spring -- works right now. Thanks.
Post Reply

Return to “Help & Bugs”