user dump for windows 7/windows 8.1/ windows server 2008 ... · service & support answers for...

19
Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS 7? User Dump for Windows 7/Windows 8.1/ Windows Server 2008/Windows Server 2008 R2/ Windows Server 2012 R2 / Windows 10 FAQ October 2016

Upload: nguyentu

Post on 01-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

Service & Support

Answers for industry.

Cover sheet

How do you create memory dumpsfor diagnostics purposes inWinCC/PCS 7?

User Dump for Windows 7/Windows 8.1/Windows Server 2008/Windows Server 2008 R2/Windows Server 2012 R2 / Windows 10

FAQ � October 2016

Page 2: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

Contents

Windows 7 DumpVersion V1.3, Item ID: 45020870 2

This entry originates from the Siemens Industry Online Support. The conditions ofuse specified there apply (http://www.siemens.com/terms_of_use).

Securitynotes

Siemens offers products and solutions with industrial security functions whichsupport the secure operation of plants, solutions, machines, devices and/ornetworks. They are important components in a comprehensive industrial securityconcept. The Siemens products and solutions continue to be developed underthis aspect. Siemens recommends that you keep yourself regularly informedabout product updates.For the safe operation of Siemens products and solutions it is necessary to takeappropriate security measures (cell protection concept, for example) and tointegrate each component in an overall industrial security concept which is stateof the art. This should also cover the third-party products used. Additionalinformation about Industrial Security is available here:http://www.siemens.com/industrialsecurity.In order to keep yourself informed about product updates, we recommendsubscribing to our product-specific newsletter. Additional information about this isavailable at:http://support.industry.siemens.com/.

1 Installing the Microsoft Windows Software Development Kit (SDK) ............ 32 Start and Parameterize the "adplus.exe" Program ....................................... 7

2.1 Preparations ...................................................................................... 82.2 Start and Parameterize the "adplus.exe" Program .............................. 92.3 Terminating Process Monitoring with the "adplus.exe" Program ....... 112.3.1 Procedure for terminating monitoring without terminating the

process being monitored .................................................................. 11

3 Entering the "adplus.exe" Program in the Startup List of the WinCCProject ........................................................................................................... 13

4 Notes ............................................................................................................. 155 Enabling and Using the "gflags" Tool ......................................................... 16

5.1 Enabling the "gflags" Tool ................................................................ 16

6 Glossary ........................................................................................................ 19

QuestionHow do you create memory dumps for diagnostics purposes in WinCC/PCS 7?

AnswerFollow the instructions and notes listed in this document for a detailed answer tothe above question.

Page 3: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

1 Installing the Microsoft Windows Software Development Kit (SDK)

Windows 7 DumpVersion V1.3, Item ID: 45020870 3

1 Installing the Microsoft Windows SoftwareDevelopment Kit (SDK)

Table 1-1

No. Procedure

1. Download the Microsoft Windows Software Development Kit (SDK) for yourOperating System into a temporary folder.SDK 8.1https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdkSDK 10https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

NoteThe following procedure is idenical for both versions.

2. Start the downloaded "sdksetup.exe" file.In the "Specify Location" window you select the "Download the Windows SoftwareDevelopment Kit for installation on a separate computer" option.Select a path in which you want to temporarily save installation files.

Click the "Next" button.And in the "Join the Customer..." window once again click the "Next" button.

Page 4: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

1 Installing the Microsoft Windows Software Development Kit (SDK)

Windows 7 DumpVersion V1.3, Item ID: 45020870 4

No. Procedure

3. In the new window select only "Debugging Tools for Windows".

Press the "Download" button.The Debugging Tools are now downloaded onto your computer for installation.

NoteMicrosoft .NET Framework 4.0 is also installed automatically.

Install the downloaded files on this computer or copy the files to a target computerand install them there.

Page 5: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

1 Installing the Microsoft Windows Software Development Kit (SDK)

Windows 7 DumpVersion V1.3, Item ID: 45020870 5

No. Procedure

4. Start the "sdksetup.exe" file.Retain the proposed installation path.

5. Click the "Next" button.And in the "Join the Customer..." window once again click the "Next" button.Likewise in the "License Agreement…" window you click the "Accept" button.

Page 6: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

1 Installing the Microsoft Windows Software Development Kit (SDK)

Windows 7 DumpVersion V1.3, Item ID: 45020870 6

No. Procedure

6. Select only "Debugging Tools for Windows" and click the "Install" button.

7. Close the next window with "Close".

8. The installation has now been completed.

Page 7: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 7

2 Start and Parameterize the "adplus.exe"Program

WARNING When you proceed as described below, there might be situations whereperformance is impaired as listed below:

· Loss of performance· Extremely high use of memory· Changed system timings· Unusable plant

The procedures should only be executed if recommended by the service staff.

Now check whether you have a 32-bit or 64-bit system.

Table 2-1

No. Procedure

1 Click "Start > Control Panel".Under View select "Small symbols".Click "System".From the system data in section “System” under “System type” you cansee whether you have a 32-bit or 64-bit operating system.

Page 8: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 8

2.1 PreparationsTable 2-2

No. Procedure

1 Create a directory in which you want to store the diagnostics datagenerated (c:\temp, for example).

2 Download the adplusconfig.xml file from this entry onto your computer and copythis file into the newly created directory. Configure this file corresponding to yourrequirements.

Notes on the important entries in the XML file:

<ProcessName> CcAlgRtServer.exe </ProcessName>

<Exception Code='AV'><Actions1> FullDump </Actions1><ReturnAction1> GN </ReturnAction1>

</Exception>

· The <ProcessName> entry indicates which process is to be monitored(CCAlgRtServer.exe, for example)

· Code=’AV’ : parameterization pertains to AccessViolation· <ReturnAction1> defines that the monitoring continues after creation of

the dump· FullDump defines that a complete memory dump is created

(alternatives: MiniDump, Log, void)

A full description of the parameters is given in the "adplus.doc" file in therelevant installation path.· 32-bit operating system

C:\Programs\Windows Kits\ 8.1\ Debuggers\x86· 64-bit operating system

C:\Programs (X86)\Windows Kits\ 8.1\ Debuggers\x64

Page 9: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 9

2.2 Start and Parameterize the "adplus.exe" ProgramTable 2-3

No. Procedure

1 Click the "Start" button on the Windows desktop.Enter "cmd" in the input field and confirm with "OK".Open the context menu of the "cmd.exe" file and select "Run asadministrator".Confirm the system query with "Yes".

2 Switch to the path where the "adplus.exe" file is located.· 32-bit operating systems

C:\Program Files\Windows Kits\ 8.1\ Debuggers\x86· 64-bit operating systems

C:\Program Files (X86)\Windows Kits\ 8.1\ Debuggers\x64

Page 10: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 10

No. Procedure

3 Start WinCC Runtime (Alarm Logging Runtime must be enabled in theStartup list).Wait until WinCC Runtime has completely started.

Start adplus.exe with the following parameters:adplus.exe -o c:\temp -c c:\temp\adplusconfig.xml

The folder c:\temp is an example (see table 2.2, No. 1).

4 Check at regular intervals in the c:\temp path whether .dmp files have beencreated.

· When the "adplus" program starts, a new directory is created inc:\temp (the name of the directory depends on the date/time).

· You must regularly check whether new .dmp files have been createdthere. These must be forwarded for analysis and once save can bedeleted from the directory.

NoteA new directory is created each time "adplus" starts.This should be taken into account when checking new files.

Page 11: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 11

2.3 Terminating Process Monitoring with the"adplus.exe" Program

When the process being monitored terminates, the "adplus.exe" programterminates too.

Proceed as follows if you want to terminate monitoring without terminating theprocess being monitored. This is necessary, for example, when you cannotterminate WinCC Runtime.

2.3.1 Procedure for terminating monitoring without terminating the processbeing monitored

Table 2-4

No. Procedure

1 If monitoring is enabled as described above, a second window (cdb.exe) isopened in addition to the cmd window. The debug information etc. is listedin this second window.

Page 12: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

2 Start and Parameterize the "adplus.exe" Program

Windows 7 DumpVersion V1.3, Item ID: 45020870 12

No. Procedure

2 Select this window and press "CTRL + C". This creates a manualminidump.

Now enter the ".detach" command in this window. This detaches themonitored process and terminates monitoring. You can now close the twowindows cmd.exe and cdb.exe without affecting the process beingmonitored.

Page 13: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

3 Entering the "adplus.exe" Program in the Startup List of the WinCC Project

Windows 7 DumpVersion V1.3, Item ID: 45020870 13

3 Entering the "adplus.exe" Program in theStartup List of the WinCC ProjectSince the command mentioned above is always executed first, when theapplication to be monitored is started, an additional entry can be made as analternative in the WinCC startup list of the WinCC project. This entry must bemoved to the end of the startup list.

Page 14: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

3 Entering the "adplus.exe" Program in the Startup List of the WinCC Project

Windows 7 DumpVersion V1.3, Item ID: 45020870 14

Table 3-1

No. Procedure

1 In the WinCC Explorer open "Project Properties > Startup list > Add".Enter the "adplus.exe" program with the complete path.Enter the required parameters under "Parameters".

2 Using the "Down" button you move the new entry to the bottom so that it isstarted last.

Note This works only with processes that are not executed in the System Account(which is why the command line environment must also be started withadministrator rights).

Page 15: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

4 Notes

Windows 7 DumpVersion V1.3, Item ID: 45020870 15

4 Notes· The "adplus.exe" tool from Microsoft needs the "Net Framework 4". If not

already installed on the computer to be analyzed, the "sdksetup.exe" setupinstalls it on the target system.

· The "adplus.exe" tool starts a process called "cdb.exe". This is a debuggingtool which connects with the process to be monitored and keeps a look out forexceptions.

· The configuration given above increases the memory requirement for the logfiles in c:\temp continuously, because the debugging information of the cdb.exeprocess is written continuously to these log files. Examinations are being madeas to how this can be stopped, so that the log files do not become enormous insize after a long running time.

· To stop monitoring of the processes, you must terminate the process to bemonitored. In this case it would suffice to disable the WinCC Runtime, becausethis also terminates the "CCAlgRtServer.exe" process. However, this alsomeans that after restarting the computer or WinCC, you have to restart the"adplus.exe" with the appropriate parameters.

· The above-mentioned application requires that the process to be monitoredhas already been started. The "adplus.exe" tool also has the option of beingstarted before the process to be monitored and then connecting automaticallyto it. It is not recommended to use this feature, because the "adplus.exe" toolwould in this case cause too much load on the CPU. An alternative solution isbeing looked for at the time to provide the same function but at not such agreat cost of resources.

· The files created during log monitoring (.log) can be deleted when there is noactive monitoring.

Page 16: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

5 Enabling and Using the "gflags" Tool

Windows 7 DumpVersion V1.3, Item ID: 45020870 16

5 Enabling and Using the "gflags" Tool

WARNING When you proceed as described below, there might be situations whereperformance is impaired as listed below:

· Loss of performance· Extremely high use of memory· Change of system timing· Inoperability of the plantThe procedures should only be executed if recommended by the servicestaff of the Siemens Technical Support.

GeneralThis option writes additional information in the user dump. (This enables andconfigures "PageHeaps" in the operating system.)This information might be useful if you have memory swell or memory overflows onyour system.

5.1 Enabling the "gflags" Tool

The "gflags" tool is installed automatically when you install the Microsoft WindowsSoftware Development Kit (SDK).The tool is in the following path:· 32-bit operating systems

C:\Programs\Windows Kits\ 8.0\ Debuggers\x86· 64-bit operating systems

C:\Programs (X86)\Windows Kits\ 8.0\ Debuggers\x64

Page 17: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

5 Enabling and Using the "gflags" Tool

Windows 7 DumpVersion V1.3, Item ID: 45020870 17

Table 5-1

No. Procedure

1 Click the "Start" button on the Windows desktop.Enter "cmd" in the input field and confirm with "OK".Open the context menu of the "cmd.exe" file and select "Run as administrator".Confirm the system query with "Yes".

2 Switch to the path where the "adplus.exe" file is located.· 32-bit operating systems

C:\Program Files\Windows Kits\ 8.0\ Debuggers\x86· 64-bit operating systems

C:\Program Files (X86)\Windows Kits\ 8.0\ Debuggers\x64

Page 18: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

5 Enabling and Using the "gflags" Tool

Windows 7 DumpVersion V1.3, Item ID: 45020870 18

No. Procedure

3 Now enter one of the commands below according to whether you want to enable or disable"gflags":The command for enabling "gflags" for the "script.exe" is:"gflags -p /enable script.exe /full"

NoteIn the case of memory overwrites you need the "/full" parameter.In the case of memory usage you do not need the "/full" parameter.Please check out the use of the "/full" parameter with our Technical Support.

The command for displaying the current settings of "gflags" is:"gflags -p"

The command for disabling "gflags" for the "script.exe" is:"gflags -p /disable script.exe"

The screenshot below shows how the commands given above are executed. In the first line"gflags" is enabled. In the second and third lines the change is queried.In the next line "gflags" is disabled and then the change is checked.

4 Restart the computer now to apply the settings in the Registry. As of now the additionalinformation is written in the dumps.

NoteIt is mandatory to disable "gflags" after completing the examination.

Page 19: User Dump for Windows 7/Windows 8.1/ Windows Server 2008 ... · Service & Support Answers for industry. Cover sheet How do you create memory dumps for diagnostics purposes in WinCC/PCS

6 Glossary

Windows 7 DumpVersion V1.3, Item ID: 45020870 19

6 Glossary

dmp/dump fileBackup of the memory dump of a running process.Using this backup it is possible to retrace the software behavior at a specific point intime (time of creation, for example).The information cannot be evaluated by end users.

Debugging informationApplications can generate additional analysis information. This information is generallyinvisible to the end user and can only be seen using the appropriate tools.

ExceptionExceptional situation in an application that can either be detected and remedied in theprogram or which leads to a crash.

Access ViolationIn the application there is unauthorized access to memory areas, which can lead toabortion of the application, for example.