Archived

This forum has been archived. Please start a new discussion on GitHub.

Problem w. debug assertion after Ice call

I don't know if this belongs in the Bug Reporting area instead of here, or if it is even a porblem with Ice and not with my code, but I thought I might as well present here and see what you could say.

In brief the problem is that when running my program in debug mode (compiled with debug flags and libraries ofcourse) in MSVC++ 7.0, I get a heap check assertion failure after making a Ice call, and as far as I can see it occurs when the program tries to delete a

::IceInternal::Handle< ::IceDelegate::Ice::Object>

Somewhere in the slice generated code.

The full stacktrace (If it is of any help) is

ntdll.dll!7c901230()
ntdll.dll!7c96d208()
ntdll.dll!7c960ae7()
kernel32.dll!7c85e7af()
msvcr70d.dll!_heapchk() Line 104 + 0x10 C
msvcr70d.dll!_CrtCheckMemory() Line 1500 + 0x5 C
msvcr70d.dll!_free_dbg_lk(void * pUserData=0x0f69d2c8, int nBlockUse=0x00000001) Line 1100 + 0x5 C
msvcr70d.dll!_free_dbg(void * pUserData=0x0f69d2c8, int nBlockUse=0x00000001) Line 1070 + 0xd C
msvcr70d.dll!operator delete(void * pUserData=0x0f69d2c8) Line 53 + 0x10 C++
ice20d.dll!std::map<IceInternal::Handle<Ice::Object>,int,std::less<IceInternal::Handle<Ice::Object> >,std::allocator<std::pair<IceInternal::Handle<Ice::Object> const ,int> > >::`scalar deleting destructor'() + 0x29 C++
ice20d.dll!IceInternal::BasicStream::WriteEncaps::~WriteEncaps() Line 248 + 0x1f C++
ice20d.dll!IceInternal::BasicStream::WriteEncaps::`scalar deleting destructor'() + 0x16 C++
ice20d.dll!IceInternal::BasicStream::endWriteEncaps() Line 289 + 0x1c C++
ice20d.dll!IceInternal::Outgoing::invoke() Line 109 C++
GameClient.exe!IceDelegateM::GameWorld::GameObjectConnection::runScript(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & scriptName={...}, const std::vector<IceInternal::Handle<GameWorld::BaseVariant>,std::allocator<IceInternal::Handle<GameWorld::BaseVariant> > > & parms={...}, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > & __context={...}) Line 2529 + 0xe C++
> GameClient.exe!IceProxy::GameWorld::GameObjectConnection::runScript(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & scriptName={...}, const std::vector<IceInternal::Handle<GameWorld::BaseVariant>,std::allocator<IceInternal::Handle<GameWorld::BaseVariant> > > & parms={...}, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > & __ctx={...}) Line 1869 + 0x19 C++
GameClient.exe!IceProxy::GameWorld::GameObjectConnection::runScript(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & scriptName={...}, const std::vector<IceInternal::Handle<GameWorld::BaseVariant>,std::allocator<IceInternal::Handle<GameWorld::BaseVariant> > > & parms={...}) Line 1857 C++
GameClient.exe!GameObject::requestScript(Utils::String functionName={...}, Com::Ptr<Q::VariantCollection> parms={...}, bool blocking=false) Line 1120 + 0x45 C++
GameClient.exe!GameObject::receive(Q::MessagePeer * from=0x00000000, Q::Message * m=0x02378ab0, Q::MessageResult * result=0x02378b70) Line 563 C++
GameClient.exe!Fixture::receive(Q::MessagePeer * from=0x00000000, Q::Message * m=0x02378ab0, Q::MessageResult * result=0x02378b70) Line 307 C++
qgamedev.dll!48014147()
qgamedev.dll!48014d96()
qgamedev.dll!48015f0b()
GameClient.exe!GameObject::onCommand(Utils::String command={...}) Line 746 C++
GameClient.exe!Fixture::onCommand(Utils::String command={...}) Line 311 C++
GameClient.exe!GameObjectPieMenu::onChildButtonRelease(FrameComponent * child=0x0f69c128, Q::Layer & l={...}, const Maths::Vec2<float> & layerRelative={...}, const Maths::Vec2<float> & screenRelative={...}, unsigned int buttons=0x00000001) Line 79 C++
GameClient.exe!PieComponent::onChildButtonRelease(FrameComponent * child=0x0f69ddb8, Q::Layer & l={...}, const Maths::Vec2<float> & layerRelative={...}, const Maths::Vec2<float> & screenRelative={...}, unsigned int buttons=0x00000001) Line 211 + 0x2c C++
GameClient.exe!FrameComponent::onButtonRelease(Q::Layer & l={...}, const Maths::Vec2<float> & layerRelative={...}, const Maths::Vec2<float> & screenRelative={...}, unsigned int buttons=0x00000001) Line 201 + 0x2f C++
qserver.dll!44a3fd97()
qserver.dll!44a3db1d()
qserver.dll!44a38c64()
qserver.dll!44a390d5()
QKflow.dll!44152248()
qsys.dll!44003fc0()
qsys.dll!4400436e()
kernel32.dll!7c80b50b()
kernel32.dll!7c825bc4()

The client is being run via the debugger of MSVC++ 7.0 on a Windows XP machine connecting to a server running on a Fedora Core 2 linux machine.

There doesn't appear to be a problem when I don't run the program in debug mode.

mvh

Nis

Comments

  • benoit
    benoit Rennes, France
    The first thing to check is that you've correctly built your application with the correct flags but it sounds like you already did check this (/MD for release multi-threaded and linked with ice.lib, /MDd for debug multi-thread and linked iced.lib).

    Without more information, I'm afraid it's impossible to say what could be wrong :( Would it be possible to send us a small self compilable example demonstrating the problem?

    Thanks,

    Benoit.
  • benoit wrote:
    The first thing to check is that you've correctly built your application with the correct flags but it sounds like you already did check this (/MD for release multi-threaded and linked with ice.lib, /MDd for debug multi-thread and linked iced.lib).

    I do use /MDd and link with iced (and iceutild, freezed etc.) for this debug build, so if that is the main concern that shouldn't be the cause.
    benoit wrote:
    Without more information, I'm afraid it's impossible to say what could be wrong :( Would it be possible to send us a small self compilable example demonstrating the problem?

    I don't know how easy it will be to create a standalone example to demonstrate the problem, as I have yet to isolate the cause. And since things have been working fine earlier, I suspect it really isn't a problem in Ice. I just wanted to tell you about it to see if you might have any ideas.

    I'll see if I can track some other source of the problem, and otherwise I'll get back to you with a more selfcontained example.

    Thanks for the quick reply.

    mvh

    NHB