|
From: Juan R. <jra...@in...> - 2011-01-12 03:26:21
|
Problem solved
My DLL was mysteriously linked against msvcp60d.dll, you can imagine the
rest...
Regards
Saludos!
Juan
2011/1/11 Juan Ramírez <jra...@in...>
> Correction:
>
> The service crashes when it is going to clean up the stack (when the
> variables goes out of scope)
>
>
> Saludos!
> Juan
>
>
>
>
> 2011/1/11 Juan Ramírez <jra...@in...>
>
> Hi,
>>
>> I am trying to create an external tape processor for oreka (i.e. a new
>> DLL)
>>
>> But when I try to register it the whole program chashes trying to destroy
>> the result of GetName()
>>
>> Here is the code:
>>
>>
>> // JRProcessor.h (ProcessorTest.dll)
>>
>> class JRProcessor : public TapeProcessor
>> {
>> public:
>> static void Initialize();
>> CStdString __CDECL__ GetName();
>> TapeProcessorRef __CDECL__ Instanciate();
>> void __CDECL__ AddAudioTape(AudioTapeRef&);
>> private:
>> JRProcessor(void){}
>> static TapeProcessorRef s_instance;
>> std::queue<AudioTapeRef> m_audioTapeQueue;
>> ACE_Thread_Mutex m_mutex;
>> };
>>
>> // JRProcessor.cpp (ProcessorTest.dll)
>>
>> TapeProcessorRef JRProcessor::s_instance;
>>
>> void JRProcessor::Initialize() {
>> if(s_instance.get() == NULL) {
>> s_instance.reset(new JRProcessor());
>> TapeProcessorRegistry::instance()->RegisterTapeProcessor(s_instance);
>> }
>> }
>> CStdString JRProcessor::GetName() {
>> return "JRProcessor";
>> }
>> TapeProcessorRef JRProcessor::Instanciate() {
>> return s_instance;
>> }
>> void JRProcessor::AddAudioTape(AudioTapeRef &tape) {
>> MutexSentinel lock(m_mutex);
>> m_audioTapeQueue.push(tape);
>> }
>>
>> // windbg stack trace
>>
>> 03003c88 00000000 7efde000 ntdll!RtlpLowFragHeapFree+0x31 (FPO: [0,10,4])
>> 00240000 00000000 03003c88 ntdll!RtlFreeHeap+0x105 (FPO: [3,1,4])
>> 03003c88 00000004 0018f250 msvcrt!free+0xcd (FPO: [SEH])
>> 00000001 10002100 0018f2b0
>> MSVCP60!std::basic_string<char,std::char_traits<char>,std::allocator<char>
>> >::_Tidy+0x2b (FPO: [1,0,4])
>> 0018f2b0 0018f340 1006482c
>> MSVCP60!std::basic_string<char,std::char_traits<char>,std::allocator<char>
>> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >+0x7
>> (FPO: [0,0,0])
>> 00000000 00000000 0018f290 OrkBase!CStdStr<char>::~CStdStr<char>+0x10
>> (CONV: thiscall)
>> 00a67760 0018f35c 0018f35c
>> OrkBase!TapeProcessorRegistry::RegisterTapeProcessor+0x13b (CONV: thiscall)
>> 0018f728 00401643 00000000 ProcessorTest!JRProcessor::Initialize+0xdf
>> (CONV: cdecl)
>> 00000000 0018f470 77b41c39 ProcessorTest!OrkInitialize+0x2f (CONV: cdecl)
>> 0018fde4 004ca378 004ca378 OrkAudio!LoadPlugins+0x5ae (CONV: cdecl)
>> ...
>>
>>
>> The exactly line is this one:
>>
>> LOG4CXX_INFO(s_log, CStdString("Registered processor: ") +
>> tapeProcessor->GetName());
>>
>> When I patched the log4cxx DLL so I could pass the line, the service
>> started to crash on the funcion
>> TapeProcessorRegistry::GetNewTapeProcessor
>> The call stack was almost the same, and it was exactly on this line
>> if( TapeProcessor->GetName().CompareNoCase(TapeProcessorName) == 0 )
>>
>> I think the calling convention is the problem, cause the CStdString object
>> is being destroyed, but I don't know why
>>
>>
>> Any help is welcome
>>
>> Thanks!
>>
>>
>> Saludos!
>> Juan
>>
>>
>>
>
|