dcmqrscp c-move problem

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Aaron1
Posts: 24
Joined: Tue, 2005-11-01, 08:55
Location: China xi'an

dcmqrscp c-move problem

#1 Post by Aaron1 »

Hi
We have discussed problem about c-move in dcmqrscp on wi n32 .When running dcmqrscp.exe-movescu.exe a problem fail occurs: Assertion failed: !(pos >= this->size()), file ..\..\..\dcmtk\ofstd\include\dcmtk/ofstd/ofstring.h, line 375.
Someone said that it is a bug in dcmqrscp.exe,may i get any code to fix it?
Recently i modifed dcmqrscp to support MultiProcess using methods of Colby Dillion(in previous post),but same occurs:
Assertion failed: !(pos >= this->size()), file ..\..\..\dcmtk\ofstd\include\dcmtk/ofstd/ofstring.h, line 375.
What's problem? How i do?

Wish poniters!

Aaron1
Posts: 24
Joined: Tue, 2005-11-01, 08:55
Location: China xi'an

#2 Post by Aaron1 »

I compiled DCMTK3.54 again using MSVC6.0 on Windows XP,and found that if DCMTK3.54 is compiled using Win32 Release configration,dcmqrscp.exe work well in implementing c-move,but compiled using Win32 Debug configration,when dcmqrscp.exe running c-move,the program fail will occur:!(pos >= this->size()), file ..\..\..\dcmtk\ofstd\include\dcmtk/ofstd/ofstring.h, line 375.
I wondered the problem is due to MSVC6.0,OS or DCMTK3.54,but I think if DCMTK3.54 were strong enough it would work well in various conditions.
I have debugged dcmqrscp,the fail come from the constructor of class DcmQueryRetrieveMoveContext,in detail,when initiating OFstring variable:
ourAETitle[0] = '\0',
[] operator function:
char& operator[] (size_t pos)
{
OFSTRING_OUTOFRANGE (pos >= this->size());
return this->theCString[pos];
}
causes the fail.

How to fix the bug?

wish pointer! :?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#3 Post by Michael Onken »

Hi,

thank you for debugging this; please look into dcmqrcbm.h and dcmqrcbg.h and look for the following code in the constructors (minor differences between both files):

Code: Select all


//    , origAETitle()
//    , origHostName()
    , priority(pr)
//    , ourAETitle()
//    , dstAETitle()
    , failedUIDs(NULL)
    , nRemaining(0)
    , nCompleted(0)
    , nFailed(0)
    , nWarning(0)
    {
      origAETitle[0] = '\0';
      origHostName[0] = '\0';
      dstAETitle[0] = '\0';
      ourAETitle[0] = '\0';

The problem, is, that origAETitle and ourAETitle are no char arrays but of type OFString, so they can't be initialized using "='\0'. This runs into an error, because the OFString object is of length 0 at this time. So remove the comments ("//") from the initialization of both OFStrings in the initializer list of the constructors and remove their initialization with '\0' in the constructors body. dstAETitle and origHostName are char arrays, so do not change these!

Then it looks like:

Code: Select all

    , origAETitle()
//    , origHostName()
    , priority(pr)
    , ourAETitle()
//    , dstAETitle()
    , failedUIDs(NULL)
    , nRemaining(0)
    , nCompleted(0)
    , nFailed(0)
    , nWarning(0)
    {
      origHostName[0] = '\0';
      dstAETitle[0] = '\0';
Please try again and report the result :)

Regards,
Michael

Aaron1
Posts: 24
Joined: Tue, 2005-11-01, 08:55
Location: China xi'an

#4 Post by Aaron1 »

Hi Michael
Thanks for your Reply.I modified code in dcmqrcbm.h and dcmqrcbg.h by your means.It is fine in dcmqrcbg.h,origAETitle and ourAETitle are all type of OFString,so we should use constructor of class OFString not code as follow:
origAETitle[0] = '\0';
ourAETitle[0] = '\0';
but in dcmqrcbm.h, class member origAETitle[] seems to be type of char array :
DIC_AE origAETitle;
so I think we should only change initiating of ourAETitle[].
code modified in dcmqrcbm.h :

, origMsgId(msgid)
// , origAETitle()
// , origHostName()
, priority(pr)
, ourAETitle()
// , dstAETitle()
, failedUIDs(NULL)
, nRemaining(0)
, nCompleted(0)
, nFailed(0)
, nWarning(0)
{
origAETitle[0] = '\0';
origHostName[0] = '\0';
dstAETitle[0] = '\0';
// ourAETitle[0] = '\0';
}

after modification I tested dcmqrscp.exe,It worked well.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#5 Post by Jörg Riesmeier »

Thank you for the report and the positive feedback. We will fix this issue for the next release.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest