Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfRangeException raised when processing certain files #4

Closed
GoogleCodeExporter opened this issue Apr 15, 2015 · 6 comments
Closed

Comments

@GoogleCodeExporter
Copy link

Hi,

First thank you for this tool which looks really promising.

I use it to generate PDB files for my binaries in order to have valid stack 
traces under WinDBG.

First remark - it does not seems to like DLL files : I got the following fatal 
error when trying to produce a PDB file from a FILENAME.DLL :

Exception non gérée : System.IO.FileNotFoundException: Impossible de trouver 
le fichier 'c:\PATH\FILENAME.exe'.
Nom du fichier : 'c:\PATH\FILENAME.exe'
   à System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   à System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, In
t32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions op
tions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   à System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, F
ileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean b
FromProxy)
   à System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, F
ileShare share)
   à System.IO.File.Open(String path, FileMode mode, FileAccess access)
   à pdbbind.PdbBind.Bind(String exefname, String pdbfname, Int32 timestamp, Gui
d guid, Int32 age)
   à tds2pdbproto.PdbWriter.WritePdb(List`1 tglobals, ModuleInfo[] modules, Stri
ng pdbname, String exename)
   à tds2pdbproto.Program.Main(String[] args)

(basically, it says in French that it cannot find FILENAME.EXE instead of 
searching for FILENAME.DLL).

Well, it seems that using the ".EXE" extension for the library file worked. But 
for some files the program crashes with the following stack trace :

Exception non gérée : System.IndexOutOfRangeException: L'index se trouve en 
dehors des limites du tableau.
   à pdbbind.PdbBind.Bind(String exefname, String pdbfname, Int32 timestamp, Gui
d guid, Int32 age)
   à tds2pdbproto.PdbWriter.WritePdb(List`1 tglobals, ModuleInfo[] modules, Stri
ng pdbname, String exename)
   à tds2pdbproto.Program.Main(String[] args)

I was wondering if you're aware of this issue and if I could help you to fix it.

Thanks.

Adrien

Original issue reported on code.google.com by adrien.reboisson on 10 May 2012 at 12:12

@GoogleCodeExporter
Copy link
Author

No, but it is possible that the code has some rough edges.
(not tested that much, also not using it very much)

You can try to fix it yourself by grabbing the code and run it in VisualStudio 
Express 2010.

You can also send me your files, so I can take a look when I have some time 
(you have to wait more time...)

Original comment by andre.mussche on 10 May 2012 at 12:18

@GoogleCodeExporter
Copy link
Author

Believe me or not, your code is incredibly useful, at least for me :D

Here is the file that generates the exception. The following commands can be 
used to reproduce the issue :

tdstrp32.exe -s SMART.exe
tds2pdbproto.exe SMART.TDS

I understand that this project is not on the top of your priorities, but if you 
have some time, one day...

Anyway thank your for your work.

Adrien

Original comment by adrien.reboisson on 10 May 2012 at 12:45

Attachments:

@GoogleCodeExporter
Copy link
Author

I get an error when running your exe:
"SMART.exe is not a valid Win32 application."


Original comment by andre.mussche on 10 May 2012 at 1:14

@GoogleCodeExporter
Copy link
Author

Hi,

To avoid the FileNotFoundException exception, it changed the file extension 
from ".DLL" to ".EXE". You can rename it "SMART.dll" to exhibit the problem.

Thanks,

Adrien

Original comment by adrien.reboisson on 10 May 2012 at 2:32

@GoogleCodeExporter
Copy link
Author

fixed, see new download:
http://map2dbg.googlecode.com/files/tds2pdb101.zip

(note: the dll misses a .rdata section so it cannot bind the pdb to the dll)

Original comment by andre.mussche on 11 May 2012 at 7:51

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks for finding time to fix the problem !

Adrien

Original comment by adrien.reboisson on 11 May 2012 at 7:53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant