[Assimp] NULL-Pointer in DefaultIOStream::Read

Programmiersprachen, APIs, Bibliotheken, Open Source Engines, Debugging, Quellcode Fehler und alles was mit praktischer Programmierung zu tun hat.
Antworten
Benutzeravatar
Ingrater
Establishment
Beiträge: 103
Registriert: 18.04.2007, 21:52

[Assimp] NULL-Pointer in DefaultIOStream::Read

Beitrag von Ingrater »

Hallo zusammen, ich bin jetzt kürlich auf den vsc++ ide + compiler umgestiegen und habe jetzt ein problem mit assimp.
Und zwar schlägt ein assert in der funktion DefaultIOStream::Read fehl

Code: Alles auswählen

size_t DefaultIOStream::Read(void* pvBuffer, 
	size_t pSize, 
	size_t pCount)
{
	ai_assert(NULL != pvBuffer && 0 != pSize && 0 != pCount); //<--- das da
	return (mFile ? ::fread(pvBuffer, pSize, pCount, mFile) : 0);
}
Und zwar ist der pvBuffer NULL.

Der Callstack:

Code: Alles auswählen

 	NewEngine.exe!Assimp::aiAssert(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & message="NULL != pvBuffer && 0 != pSize && 0 != pCount", unsigned int uiLine=66, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file="d:\codeblocks nightly\projekte\newengine\assimpsvn\code\defaultiostream.cpp")  Zeile 25	C++
>	NewEngine.exe!Assimp::DefaultIOStream::Read(void * pvBuffer=0x00000000, unsigned int pSize=416579592, unsigned int pCount=1)  Zeile 66 + 0x92 Bytes	C++
 	NewEngine.exe!Assimp::CIrrXML_IOStreamReader::CIrrXML_IOStreamReader(Assimp::IOStream * _stream=0x18c46a28)  Zeile 88 + 0x33 Bytes	C++
 	NewEngine.exe!Assimp::ColladaParser::ColladaParser(Assimp::IOSystem * pIOHandler=0x003acc58, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & pFile="gfx/kugel.DAE")  Zeile 74 + 0x31 Bytes	C++
 	NewEngine.exe!Assimp::ColladaLoader::InternReadFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & pFile="gfx/kugel.DAE", aiScene * pScene=0x18c45c88, Assimp::IOSystem * pIOHandler=0x003acc58)  Zeile 115 + 0x13 Bytes	C++
 	NewEngine.exe!Assimp::BaseImporter::ReadFile(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & pFile="gfx/kugel.DAE", Assimp::IOSystem * pIOHandler=0x08a01ee8)  Zeile 79 + 0x1b Bytes	C++
 	NewEngine.exe!Assimp::Importer::ReadFile(const char * _pFile=0x003ad378, unsigned int pFlags=8388619)  Zeile 807 + 0x14 Bytes	C++
 	NewEngine.exe!aiImportFileEx(const char * pFile=0x003ad378, unsigned int pFlags=8388619, aiFileIO * pFS=0x00000000)  Zeile 291 + 0x10 Bytes	C++
 	NewEngine.exe!aiImportFile(const char * pFile=0x003ad378, unsigned int pFlags=8388619)  Zeile 262 + 0xf Bytes	C++
 	NewEngine.exe!renderer::Model::LoadFile(const char * pFilename=0x18d43c60)  Zeile 64 + 0x52 Bytes	C++
 	NewEngine.exe!renderer::OpenGL::DoModelLoadFile(boost::shared_ptr<msgr::Message> * pData=0x003ae684)  Zeile 1176	C++
 	NewEngine.exe!boost::_mfi::mf1<void,renderer::OpenGL,boost::shared_ptr<msgr::Message> *>::operator()(renderer::OpenGL * p=0x00a80118, boost::shared_ptr<msgr::Message> * a1=0x003ae684)  Zeile 162 + 0x10 Bytes	C++
 	NewEngine.exe!boost::_bi::list2<boost::_bi::value<renderer::OpenGL *>,boost::arg<1> >::operator()<boost::_mfi::mf1<void,renderer::OpenGL,boost::shared_ptr<msgr::Message> *>,boost::_bi::list1<boost::shared_ptr<msgr::Message> * &> >(boost::_bi::type<void> __formal={...}, boost::_mfi::mf1<void,renderer::OpenGL,boost::shared_ptr<msgr::Message> *> & f={...}, boost::_bi::list1<boost::shared_ptr<msgr::Message> * &> & a={...}, boost::_bi::type<void> __formal={...})  Zeile 307	C++
 	NewEngine.exe!boost::_bi::bind_t<void,boost::_mfi::mf1<void,renderer::OpenGL,boost::shared_ptr<msgr::Message> *>,boost::_bi::list2<boost::_bi::value<renderer::OpenGL *>,boost::arg<1> > >::operator()<boost::shared_ptr<msgr::Message> *>(boost::shared_ptr<msgr::Message> * & a1=0x003ae684)  Zeile 33	C++
 	NewEngine.exe!boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,renderer::OpenGL,boost::shared_ptr<msgr::Message> *>,boost::_bi::list2<boost::_bi::value<renderer::OpenGL *>,boost::arg<1> > >,void,boost::shared_ptr<msgr::Message> *>::invoke(boost::detail::function::function_buffer & function_obj_ptr={...}, boost::shared_ptr<msgr::Message> * a0=0x003ae684)  Zeile 154	C++
 	NewEngine.exe!boost::function1<void,boost::shared_ptr<msgr::Message> *>::operator()(boost::shared_ptr<msgr::Message> * a0=0x003ae684)  Zeile 1013 + 0x1a Bytes	C++
 	NewEngine.exe!boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >::operator()<boost::signals::detail::connection_slot_pair>(const boost::signals::detail::connection_slot_pair & slot={...})  Zeile 120	C++
 	NewEngine.exe!boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator>::dereference()  Zeile 61 + 0x1b Bytes	C++
 	NewEngine.exe!boost::iterator_core_access::dereference<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> >(const boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> & f={...})  Zeile 517	C++
 	NewEngine.exe!boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int>::operator*()  Zeile 634 + 0xe Bytes	C++
 	NewEngine.exe!boost::detail::postfix_increment_proxy<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> >::postfix_increment_proxy<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> >(const boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> & x={...})  Zeile 145 + 0x2b Bytes	C++
 	NewEngine.exe!boost::operator++<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int>(boost::iterator_facade<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator>,boost::signals::detail::unusable,boost::single_pass_traversal_tag,boost::signals::detail::unusable const &,int> & i={...}, int __formal=0)  Zeile 734	C++
 	NewEngine.exe!boost::last_value<void>::operator()<boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> >(boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> first={...}, boost::signals::detail::slot_call_iterator<boost::signals::detail::call_bound1<void>::caller<boost::shared_ptr<msgr::Message> *,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >,boost::signals::detail::named_slot_map_iterator> last={...})  Zeile 49 + 0x12 Bytes	C++
 	NewEngine.exe!boost::signal1<void,boost::shared_ptr<msgr::Message> *,boost::last_value<void>,int,std::less<int>,boost::function<void __cdecl(boost::shared_ptr<msgr::Message> *)> >::operator()(boost::shared_ptr<msgr::Message> * a1=0x003ae684)  Zeile 354 + 0x177 Bytes	C++
 	NewEngine.exe!lua::RendererLib::ModelLoadFile(lua_State * L=0x00aa5ea0)  Zeile 2631	C++
 	NewEngine.exe!luaD_precall(lua_State * L=0x00aa5ea0, lua_TValue * func=0x089df1c8, int nresults=0)  Zeile 319 + 0x16 Bytes	C++
 	NewEngine.exe!luaV_execute(lua_State * L=0x00aa5ea0, int nexeccalls=1)  Zeile 587 + 0x14 Bytes	C++
 	NewEngine.exe!luaD_call(lua_State * L=0x00aa5ea0, lua_TValue * func=0x089df168, int nResults=0)  Zeile 377 + 0xb Bytes	C++
 	NewEngine.exe!f_call(lua_State * L=0x00aa5ea0, void * ud=0x003af400)  Zeile 800 + 0x16 Bytes	C++
 	NewEngine.exe!luaD_rawrunprotected(lua_State * L=0x00aa5ea0, void (lua_State *, void *)* f=0x01db5300, void * ud=0x003af400)  Zeile 118 + 0xd Bytes	C++
 	NewEngine.exe!luaD_pcall(lua_State * L=0x00aa5ea0, void (lua_State *, void *)* func=0x01db5300, void * u=0x003af400, int old_top=256, int ef=240)  Zeile 463 + 0x11 Bytes	C++
 	NewEngine.exe!lua_pcall(lua_State * L=0x00aa5ea0, int nargs=0, int nresults=0, int errfunc=15)  Zeile 821 + 0x20 Bytes	C++
 	NewEngine.exe!lua::LuaEngine::Init()  Zeile 142 + 0x26 Bytes	C++
 	NewEngine.exe!WinMain(HINSTANCE__ * hInstance=0x01050000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00445952, int nCmdShow=1)  Zeile 489	C++
 	NewEngine.exe!__tmainCRTStartup()  Zeile 574 + 0x35 Bytes	C
 	NewEngine.exe!WinMainCRTStartup()  Zeile 399	C
 	kernel32.dll!75553677() 	
 	[Unten angegebene Rahmen sind möglicherweise nicht korrekt und/oder fehlen, keine Symbole geladen für kernel32.dll]	
 	ntdll.dll!774e9d72() 	
 	ntdll.dll!774e9d45() 	
Ich hab mir jetzt schon die neuste Version aus dem svn geholt hat aber nichts geholfen. Habt ihr eine Idee woran das liegen könnte?
Komischerweise hat es als ich es mit dem GCC compiliert habe einwandfrei funktioniert. Fehlt mir irgendein define? Ich verwende das static lib.

Schonmal danke im Vorraus
MFG Ingrater
Benutzeravatar
Ingrater
Establishment
Beiträge: 103
Registriert: 18.04.2007, 21:52

Re: [Assimp] NULL-Pointer in DefaultIOStream::Read

Beitrag von Ingrater »

Hier hätte TGGC jetzt mal ausnahmsweise sein RTFM posten dürfen ^^

Aus der Assimp Doku:
If you're linking statically against ASSIMP: Make sure your applications uses the same STl settings! If you do not, there are two binary incompatible STL versions mangled together and you'll crash. Alternatively you can disable the fast STL settings for ASSIMP by removing the 'FastSTL' property sheet from the vc project file.
Benutzeravatar
Aramis
Moderator
Beiträge: 1458
Registriert: 25.02.2009, 19:50
Echter Name: Alexander Gessler
Wohnort: 2016
Kontaktdaten:

Re: [Assimp] NULL-Pointer in DefaultIOStream::Read

Beitrag von Aramis »

Schön, dass es gelöst ist. Dieses Problem mit statischen Libs und unterschiedlich konfigurierten STL-Binaries hat uns damals monatelang geplagt ... ein Thread nach dem anderen ... vor allem, weil man (wie jetzt auch) erstmal nicht die geringste Ahnung hatte woran es liegen könnte :-)
Antworten