rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
472 stars 109 forks source link

cv2pdb returns error code 127 when handling a fairly large DLL file #21

Closed wyldckat closed 6 years ago

wyldckat commented 6 years ago

We started to use cv2pdb in the project blueCFD-Core a few days ago and it works very well... with only one exception, hence this report.

The build option -gdwarf has been used with g++ with over 300 different binaries (108 DLL and 228 EXE) and cv2pdb worked without problems on all of them, except for one.

This one is an 829 MB DLL file which results in cv2pdb to give an error code of 127, after what it seems to have generated a partial PDB file of 2.9 MB. Download link on DropBox for the file cv2pdb.bug.libfiniteVolume.7z (94 MB), which provides the file libfiniteVolume.dll that triggers this issue, is as follows: https://www.dropbox.com/s/68xaxtmmahxkqs1/cv2pdb.bug.libfiniteVolume.7z?dl=0

Currently our workaround has been to simply ignore the error and strip the debug data from the DLL with strip --strip-unneeded, (edit) which results in a DLL file with only 23 MB.

We are using:

I haven't managed to get the time needed to build cv2pdb myself from source code, therefore I haven't tried debugging it.

rainers commented 6 years ago

It seems this is just an out-of-memory problem due to the size of the DLL. cv2pdb currently expects it can hold 2 copies of the image in memory. With /LARGEADDRESSAWARE enabled, the DLL is processed without error. For even larger DLLs you will have to compile cv2pdb as a 64-bit executable (an appropriate configuration exists).

The new AppVeyor build should include this change.

wyldckat commented 6 years ago

Excellent! Many thanks for the quick reply and fix!

I've tested this just now and it's working perfectly with the latest build from AppVeyor.

I'll make a note regarding the need to build cv2pdb in 64-bit, if we start getting DLL files larger than 1GB.

(edit) For future reference, this was fixed in commit f75b963bf8f8e7b0659f929e75d03a0afc9aeb58.