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!
dcmqrscp c-move problem
Moderator: Moderator Team
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!
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!
-
- DCMTK Developer
- Posts: 2052
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
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):
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:
Please try again and report the result
Regards,
Michael
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';
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';
Regards,
Michael
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.
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.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest