missing line numbers in windbg !clrstack - windbg

I analyzing a dump of an IIS application that I created with procdump. I believe I have windbg setup correct and I can get a !clrstack with method names. However, there are no line numbers. Is this normal? Is there a way o see line numbers. What could I be missing.

Related

WinDbg scripting - how to delete a file?

I'm working with an existing framework of WinDbg scripts that go through a series of test scripts Test1.txt, Test2.txt, etc., which are generated by C++ code and which output results.
For example a chunk of one of the test scripts would be,
.if (($spat(#"${var}","18300.000000")==1))
{
.logappend C:\Tests\TestResults.txt
.printf "TestNumber=\t1\tExpected=\t18300.000000\tActual=\t%.6f\t******PASSED******\n",poi(poi(#$t2+#$t6)+0x10)
.logclose
}
I'm trying to add functionality that will create a file whose name displays the current # of the test being run, so that users can see their progress without needing to open a file.
My thought process was that I would set up the script generator, so that at the start of Test #N, it would add a line to the script to create a file 'currentlyRunningTestN.txt', and at the end of Test #N, it would add a line to the script to delete that file. However, I don't see any delete function in the WinDbg meta command glossary: https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/meta-commands, or in the list of supported C functions like printf. Am I just missing something, or is deleting files not supported by WinDbg (or equivalently renaming files, which would also serve my purpose?) If deleting/renaming don't work, is there another way to achieve the functionality I'm looking for?
With the .shell command, you can execute any DOS-like command. Although I never tried deleting a file, it should be possible.
As you may have noticed, WinDbg scripting does not always work on first attempt, please make sure your scripting will not result in a big data loss on your customer's PC whilst deleting files.

Files (that exist) not found when using Sun Grid Engine

I am using Matlab to do some image processing on a cluster that uses Sun Grid Engine. On my personal laptop the code runs fine but when I run it on the cluster I get several errors of files that cannot be found. For example a .nii (nifti) file that exists (I can read it when I run matlab interactively in the shell) is not found. An excerpt from the output log:
{^HError using load_nii_ext (line 97)
Cannot find file
"/path/imageFile.nii".
And I also get errors from an xml structured file (that needs to have a .mps extension to be readable by a postprocessing toolbox, which all worked fine on my own laptop). Another excerpt from the output log:
/path/pointSetFile.mps exists
{^HError using readpointsmps (line 24)
Failed to read XML file
/path/pointSetFile.mps.
In this second error message the first line is the output I get from including in the script,
if exist(strcat(folder, fileName), 'file') == 2
disp([strcat(folder, fileName) ' exists'])
end
So it's weird that 1) I can see the files, 2) I can open them manually with Matlab, 3) according to the matlab function exist() they do indeed exist, but when the functions xmlread() and read_niigz() want to open them they suddenly can't be found.
As extra information: I run the scripts with the flags -nodisplay -nodesktop -nosplash, and I currently run the scripts as 2 tasks with the SGE. Memory should be good, I give it 5GB and all my images combined are about 1.5GB.
I'm using absolute paths starting at the root /, have been reading the paths letter by letter about 200 times now and have no clue anymore what's going on.
I have solved the problems now.
#Xiangrui Li pointed out in the comments that the missing .nii files were due to interference with the unzipping, reading and deletion of the .nii and .nii.gz files. That was indeed the problem. Thanks!
I found that the second problem was due to umlauts in the filenames. Apparently there was a difference between how the system and matlab and even other processes involved encode the filenames. Removing the characters with umlauts solved the problem.

Siemens S5 to S7 XR.INI file

I'm trying to convert a program from S5 to S7. I've taken a look into the tutorials and documents that are available. But I cant seem to find any information about this problem:
The program is pretty complicated and I should need the XR.INI file to convert it with the S5 Converter program that came with Simatic S7. When I open the folder with the project I see all the files I need and that are described in the tutorial made by Siemens.
.ST.S5D
.XR.INI
.Z0.SEQ
I start the converter and open .ST.S5D. When I did this I get the error there is no .XR.INI file. But I can see it in the folder. Its called CERMST.INI. So I guess the name isnt correct?
In PG2000 I remade the XRF with CTRL Q but nothing changed. I also tried to rename the file to CERM.XR.INI because I saw somewhere these files can only be 6 characters long (not sure if this is true).
I tried first without the XRF. There were some errors because of the ASM command. In the tutorial I saw the converter cant handle these so I removed these functions from the program to rewrite manually later on. After this I had an error because I had no XRF. Error was:
Error No PLC type description found for called or addressed block
So I really need the .XR.INI file but the program can't find it, but its clearly in the folder. How can I fix this? How can I make a new .INI file?
Link to tutorial: http://www.sankotek.com/TR/Dokumanlar/STEP%207%20-%20From%20S5%20to%20S7.pdf
Thanks in advance!
Siemens S5 file extensions used also last two letters before file extension to mark file type, like xxxxxxXX.XXX where x is file name and X is file type for S5, without second dot in the middle like you have. File name length limit exists, I think it comes from DOS or some older operating system file length limit.
If you don't have XRF file then if i remember correctly compiler does not have compile order. Some blocks have not been compiled but are referenced in caller block that the compiler tries to compile. Compiler does not find called block in compiled blocks folder and wham... fatal error. When i had such troubles i compiled called blocks independenly before calling blocks. So you can do without XRF file. But try to include Z0.SEQ, that file has assignment list so you get nice variable names instead of just variable address numbers.
Also, stackoverflow is not the correct place to ask questions about Siemens S5-S7 conversion. You should post your questions in http://www.plctalk.net, they have guys there who used to program S5 plc-s.

Batch file doesn't read flags correctly

I've got a little batch file and it looks like this:
.\batchisp.exe –device at32uc3b1512 –hardware usb –operation erase f memory flash blankcheck loadbuffer G3Pro_USB.hex program verify start reset 0
The whole line is fine and works correctly if I run it straight in PowerShell. However, if I run the batch file, it runs this:
.\batchisp.exe ΓÇôdevice at32uc3b1512 ΓÇôhardware usb ΓÇôoperation erase f memory flash blankcheck loadbuffer G3Pro_USB.hex program verify start reset 0
Which does not work, because as you can see, the -'s have changed into ΓÇô's... Can anybody tell me why this is and how to fix it?
This is because the – marks are not - characters. They are actually endashes. These usually are caused by Word's automatic en/emdashing.
Powershell is smart enough to convert the endashes to dashes as "arguments", but cmd is not.
To fix this issue, replace – with -. A regex search/replace that catches all the alternative dash types that works in notepad++ is: [–—‒] to -.

Getting PottsWheel application for Matlab to create a new model creates an error

I have just installed PottersWheel (latest version) for Matlab (version R2014a) on 64-bit machine. When attempting to use the 'New Model' button I get an error which I have pasted below:
-------------------------------------------
Problem detected at 2014-10-17 14:06:01:
Attempt to reference field of non-structure array.
Line 128 of pwGetFieldWidths.p
Line 170 of pwModel2CellArray.p
Line 126 of pwSaveModel.p
Line 607 of pwCreateModelGUI.p
Line 175 of pwCreateModelGUI.p
Line 95 of gui_mainfcn.m
Line 60 of pwCreateModelGUI.p
Matlab 2014a (mexw64) PottersWheel 3.1.0
-------------------------------------------
Since apparently there is no way to access .p files as they are protected. Does anybody know how to fix this problem?
The .p files are obfuscated MATLAB functions (or kind of object files). So, you cannot edit them. The possibilities are:
You read the documentation carefully, and verify that your arguments obey the requirements;
If #1 fails, you contact the author that holds the source and ask him/her for advice and bug fixing.
If #2 fails, you look for an de-obfucscator/de-compiler.