Trouble with storescp --fork option on Windows 2000 Server.

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
rhinojunk
Posts: 10
Joined: Tue, 2006-03-14, 22:25

Trouble with storescp --fork option on Windows 2000 Server.

#1 Post by rhinojunk »

I was happy to see that the --fork option was supposed to be working with the storescp 3.5.4 release for Win32, but I'm having some trouble with it under a system running Windows 2000 Server with SP4. To test it out, I'm only sending a single asset using storescu. Comparing the output from storescp with and without the --forked option makes it look like the child process isn't getting or processing any of the association request data.

I'm using the pre-compiled Win32 3.5.4 binaries from here: http://dicom.offis.de/dcmtk.php.en

Any thoughts on what the problem might be, or anything else I can do to help troubleshoot it? Thanks!

Here's the output from storescp:

Code: Select all

C:\StoreSCPMe-5432>storescp.exe --verbose --debug --fork 5432
Association Received in child process (pid: 2436)
Parameters:
Our Implementation Class UID:    1.2.276.0.7230010.3.0.3.5.4
Our Implementation Version Name: OFFIS_DCMTK_354
Their Implementation Class UID:    
Their Implementation Version Name: 
Application Context Name:    
Calling Application Name:    
Called Application Name:     
Responding Application Name: 
Our Max PDU Receive Size: 16384
Their Max PDU Receive Size: 0
Presentation Contexts:
Requested Extended Negotiation: none
Accepted Extended Negotiation: none
called AE:  
calling AE: 
Association Rejected: bad application context name: 
0006:0303 DUL Finite State Machine Error: No action defined, state 1 event 7
Here's the output (trimmed) from storescu running on a seperate Windows 2000 system:

Code: Select all

C:\StoreSCUMe>StoreSCU.exe --verbose --debug -aet STORESCU -aec STORESCP storescpserver 5432 Images\MR.1.2.840.113619.2.5.1762583153.215519.978957063.240
Request Parameters:
Our Implementation Class UID:    1.2.276.0.7230010.3.0.3.4.0
Our Implementation Version Name: OFFIS_DCMTK_340
Their Implementation Class UID:    
Their Implementation Version Name: 
Application Context Name:    1.2.840.10008.3.1.1.1
Calling Application Name:    STORESCU
Called Application Name:     STORESCP
Responding Application Name: resp AP Title
Our Max PDU Receive Size: 16384
Their Max PDU Receive Size: 0
Presentation Contexts:
  Context ID:        1 (Proposed)
    Abstract Syntax: =StoredPrintStorage
    Proposed SCP/SCU Role: Default
    Accepted SCP/SCU Role: Default
    Proposed Transfer Syntax(es):
      =LittleEndianExplicit
  Context ID:        3 (Proposed)
...
  Context ID:        215 (Proposed)
    Abstract Syntax: =GrayscaleSoftcopyPresentationStateStorage
    Proposed SCP/SCU Role: Default
    Accepted SCP/SCU Role: Default
    Proposed Transfer Syntax(es):
      =BigEndianExplicit
      =LittleEndianImplicit
Requested Extended Negotiation: none
Accepted Extended Negotiation: none
Requesting Association
Constructing Associate RQ PDU
storescu: Association Request Failed:
  130012 Peer aborted Association (or never connected)
If I remove the --fork option on storescp, run the same storescu command from above, everything works (trimmed):

Code: Select all

C:\StoreSCPMe-5432>storescp.exe --verbose --debug 5432
PDU Type: Associate Request, PDU Length: 3413 + 6 bytes PDU header
Only dumping 512 bytes.
  01  00  00  00  0d  55  00  01  00  00  53  54  4f  52  45  53
  43  50  20  20  20  20  20  20  20  20  53  54  4f  52  45  53
  43  55  20  20  20  20  20  20  20  20  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  10  00  00  15  31  2e
  32  2e  38  34  30  2e  31  30  30  30  38  2e  33  2e  31  2e
  31  2e  31  20  00  00  33  01  00  ff  00  30  00  00  16  31
  2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  35  2e  31
  2e  31  2e  32  37  40  00  00  11  31  2e  32  2e  38  34  30
  2e  31  30  30  30  38  2e  31  2e  32  20  00  00  33  03  00
  ff  00  30  00  00  16  31  2e  32  2e  38  34  30  2e  31  30
  30  30  38  2e  35  2e  31  2e  31  2e  32  39  40  00  00  11
  31  2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  31  2e
  32  20  00  00  33  05  00  ff  00  30  00  00  16  31  2e  32
  2e  38  34  30  2e  31  30  30  30  38  2e  35  2e  31  2e  31
  2e  33  30  40  00  00  11  31  2e  32  2e  38  34  30  2e  31
  30  30  30  38  2e  31  2e  32  20  00  00  36  07  00  ff  00
  30  00  00  19  31  2e  32  2e  38  34  30  2e  31  30  30  30
  38  2e  35  2e  31  2e  34  2e  31  2e  31  2e  31  40  00  00
  11  31  2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  31
  2e  32  20  00  00  36  09  00  ff  00  30  00  00  19  31  2e
  32  2e  38  34  30  2e  31  30  30  30  38  2e  35  2e  31  2e
  34  2e  31  2e  31  2e  32  40  00  00  11  31  2e  32  2e  38
  34  30  2e  31  30  30  30  38  2e  31  2e  32  20  00  00  36
  0b  00  ff  00  30  00  00  19  31  2e  32  2e  38  34  30  2e
  31  30  30  30  38  2e  35  2e  31  2e  34  2e  31  2e  31  2e
  33  40  00  00  11  31  2e  32  2e  38  34  30  2e  31  30  30
  30  38  2e  31  2e  32  20  00  00  38  0d  00  ff  00  30  00
  00  1b  31  2e  32  2e  38  34  30  2e  31  30  30  30  38  2e
  35  2e  31  2e  34  2e  31  2e  31  2e  33  2e  31  40  00  00
  11  31  2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  31
  2e  32  20  00  00  36  0f  00  ff  00  30  00  00  19  31  2e

Association Received
Parameters:
Our Implementation Class UID:    1.2.276.0.7230010.3.0.3.5.4
Our Implementation Version Name: OFFIS_DCMTK_354
Their Implementation Class UID:    1.2.276.0.7230010.3.0.3.4.0
Their Implementation Version Name: OFFIS_DCMTK_340
Application Context Name:    1.2.840.10008.3.1.1.1
Calling Application Name:    STORESCU
Called Application Name:     STORESCP
Responding Application Name: 
Our Max PDU Receive Size: 16384
Their Max PDU Receive Size: 16384
Presentation Contexts:
  Context ID:        1 (Proposed)
    Abstract Syntax: =StoredPrintStorage
    Proposed SCP/SCU Role: Default
    Accepted SCP/SCU Role: Default
    Proposed Transfer Syntax(es):
      =LittleEndianImplicit
  Context ID:        3 (Proposed)\
...
.DIMSE receiveFileData: 16372 bytes read (last: NO)
.DIMSE receiveFileData: 9754 bytes read (last: YES)
.
DIMSE Command To Send:

# Dicom-Data-Set
# Used TransferSyntax: UnknownTransferSyntax
(0000,0000) UL 0                                        #   4, 1 CommandGroupLength
(0000,0002) UI =MRImageStorage                          #  26, 1 AffectedSOPClassUID
(0000,0100) US 32769                                    #   2, 1 CommandField
(0000,0120) US 1                                        #   2, 1 MessageIDBeingRespondedTo
(0000,0800) US 257                                      #   2, 1 DataSetType
(0000,0900) US 0                                        #   2, 1 Status
(0000,1000) UI [1.2.840.113619.2.5.1762583153.215519.978957063.240] #  50, 1 AffectedSOPInstanceUID
DIMSE sendDcmDataset: sending 144 bytes
DIMSE receiveCommand
Association Release

rhinojunk
Posts: 10
Joined: Tue, 2006-03-14, 22:25

Tried --forked-child option too...

#2 Post by rhinojunk »

If I try:

storescp.exe --verbose --debug --fork --forked-child 5432
or
storescp.exe --verbose --debug --forked-child 5432

I get zero output from storescp when trying to connect from storescu which still fails on the association request. As in my original post, if I remove the --forked-child and --fork options, storing with storescu works again.

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

#3 Post by Michael Onken »

Hi,

on first sight this seems to be a bug, that we didn't realized so far. You never need to use "--forked-child" from commandline manually, it's only used when storescp is "forked" through the CreateProcess mechanism in dcmnet. However, using "--fork" should work. For Windows XP this option worked for us. I've got to take a deeper look into the code to check, where this error comes from. If you're doing a debug session (with source code) for yourself and you get any results, please inform as using this thread.

Thank you, regards
Michael

rhinojunk
Posts: 10
Joined: Tue, 2006-03-14, 22:25

#4 Post by rhinojunk »

Michael Onken wrote:Hi,

on first sight this seems to be a bug, that we didn't realized so far. You never need to use "--forked-child" from commandline manually, it's only used when storescp is "forked" through the CreateProcess mechanism in dcmnet. However, using "--fork" should work. For Windows XP this option worked for us. I've got to take a deeper look into the code to check, where this error comes from. If you're doing a debug session (with source code) for yourself and you get any results, please inform as using this thread.

Thank you, regards
Michael
Thanks for the response. I moved storescp to a Windows XP SP2 box, and it now works with some light testing using the --fork option and two simultaneous storescus storing to it. Unfortunatly, my XP system is not the one I'd like to be running storescp on.

I do not have a development environment to run storescp in debug, so I can't help you there, but I'm more than willing to test builds you or anyone else may wish to provide. In the mean time, I'll try the --fork option on Windows 2000 Pro and Windows Server 2003 Standard computers as well when I get some time today.

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

#5 Post by Michael Onken »

Thank you very much for testing. We are going to analyze the problem soon if there is time;-) I'll write to this thread if there are some news about this issue.

Regards,
Michael

rhinojunk
Posts: 10
Joined: Tue, 2006-03-14, 22:25

--fork option Win32 OS compatibility results

#6 Post by rhinojunk »

Here are the results of trying the storescp --fork option on all Win32 systems available to me. All failures exhibited the same output/behavior as described in my original post. Passes denote I was able to successfully send 2 simultaneous stores using storescu into storescp.

Time permitting I will be doing some stress testing against the Windows Server 2003 system using the --fork option. Please let me know if I can be of further help. Thanks again.

Windows 2000 Professional (SP4): Fail
Windows 2000 Server (SP4): Fail
Windows 2000 Advanced Server: (SP4): Fail
Windows XP Professional (SP4): Pass
Windows Server 2003 Standard (SP1): Pass

Colby Dillion
Posts: 13
Joined: Tue, 2005-06-28, 16:48

#7 Post by Colby Dillion »

This may or may not be the issue here but it is something that should be considered.

From previous experience with writing multiprocess services, I found it is necessary to use OpenProcess to get the actual handle to the running process before DuplicateHandle and also to use DUPLICATE_SAME_ACCESS when duplicating a socket. For example in dul.cxx (line: 1700-ish) where the socket handle is duplicated:

Code: Select all

   HANDLE ParentProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId());
   //PROCESS_INFORMATION pi now contains various handles for the new process.
	// Now that we have a handle to the new process, we can duplicate the
	// socket handle into the new child process.
	if (DuplicateHandle(ParentProcessHandle, (HANDLE)sock, pi.hProcess, 
                &childSocketHandle, 0, TRUE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) 
   {
     ...
   }
   CloseHandle(ParentProcessHandle);
It looks as though the child process is being created and a handle has been passed which the child process thinks is a valid socket but the child process may not have permission to read. I have seen very similar problems before in software that we have written. Tomorrow I will have access to a Win2k machine at work and I can test this for sure. Everything works fine for me on XP.

Hopefully this will help and I haven't completely wasted everyone's time. If this is the case I will upload a patch.

Colby ;)

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

#8 Post by Michael Onken »

Hi Colby,

we're looking forward sharing your code, since we're little occupied doing other stuff at the moment.

Thank you for your engagement
Michael :)

Colby Dillion
Posts: 13
Joined: Tue, 2005-06-28, 16:48

#9 Post by Colby Dillion »

I finally got around to fixing dul.cxx for Windows 2000 (and possibly pre-2k) multi-process mode. I hate diff files but I uploaded the old and new versions for easy diff or windiff-ing. Also there is a binary for storescp compiled using VC8. It was compiled with OpenSSL on so you will need the dcmtkssl.dll and dcmtkeay.dll files in your path. The changes really were just a formality of my previous post.

http://www.zenpacs.com/dcmtk/DUL-Win32-20060321.zip
http://www.zenpacs.com/dcmtk/StoreSCP-DUL_Patch.zip

I tested this on a 2000 Pro machine and the old version failed and the new version worked so I will leave it at that. No guarantees but it should work now.

Colby

rhinojunk
Posts: 10
Joined: Tue, 2006-03-14, 22:25

#10 Post by rhinojunk »

Colby Dillion wrote:I finally got around to fixing dul.cxx for Windows 2000 (and possibly pre-2k) multi-process mode. I hate diff files but I uploaded the old and new versions for easy diff or windiff-ing. Also there is a binary for storescp compiled using VC8. It was compiled with OpenSSL on so you will need the dcmtkssl.dll and dcmtkeay.dll files in your path. The changes really were just a formality of my previous post.

http://www.zenpacs.com/dcmtk/DUL-Win32-20060321.zip
http://www.zenpacs.com/dcmtk/StoreSCP-DUL_Patch.zip

I tested this on a 2000 Pro machine and the old version failed and the new version worked so I will leave it at that. No guarantees but it should work now.

Colby
My newest son was born, so I was away for 2 weeks, but now I'm back. I can say that the above binary fixes my problem. Thanks Colby! I assume this will be incorporated into the next DCMTK release?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#11 Post by Marco Eichelberg »

I assume this will be incorporated into the next DCMTK release?
Yes it will. The changes have already been committed to our CVS.

PP11
Posts: 1
Joined: Thu, 2006-04-13, 14:05
Location: Belgium, Louvain-la-Neuve

#12 Post by PP11 »

Dear sirs,

I tried to use the storescp.exe contained in the StoreSCP-DLL _Patch.zip but on my computer it refuses to start:
"The application has failed to start because DCMTKSSL.dll was not found."

I haven't found this DLL in the DCMTK-3.5.4.zip.

Thanks in advance for your help !

Patrick

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

#13 Post by Michael Onken »

Hi Patrick,

this is a 3rd party library (OpenSSL), so it's not really part of the DCMTK. But we packaged these (compile time -) optional support libs in extra package for download. You can get them from the DCMTK website, too (DCMTK 3.5.4 - support libraries for Windows).

Regards,
Michael

Tsunamis
Posts: 31
Joined: Wed, 2005-05-04, 17:07

#14 Post by Tsunamis »

Those 2 links are broken...
I'd like to get them to test if they solve my problem...
________
Scion xP
________
herbalaire vaporizer
Last edited by Tsunamis on Tue, 2011-02-01, 14:40, edited 2 times in total.

Colby Dillion
Posts: 13
Joined: Tue, 2005-06-28, 16:48

#15 Post by Colby Dillion »

The server those files were hosted on died last week and I haven't gotten around to putting those files back up. It may be a few more days. There is a possibility I might can find them on my laptop to email you if no one else has them.

Sorry. Hope to have it fixed soon.

Colby

Post Reply

Who is online

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