MolecularMatters / raw_pdb

A C++11 library for reading Microsoft Program DataBase PDB files
BSD 2-Clause "Simplified" License
675 stars 91 forks source link

Qt6WebEngineCore.pdb error #60

Closed icyfox168168 closed 1 year ago

icyfox168168 commented 1 year ago

6.52 Qt6WebEngineCore.pdb encountered a crash while parsing this PDB using this library, and the PDB exceeded 1g in size

lukekasz commented 1 year ago

Can you provide a link to this PDB? The size of the PDB shouldn't be of any significance.

MolecularMatters commented 1 year ago

@icyfox168168 Can you please be a bit more specific? Which example did you run? Which line did it crash on? What was the actual error you were getting?

icyfox168168 commented 1 year ago

Qt\6.5.2\msvc2019_64\bin\Qt6WebEngineCore.pdb This is the path. QT has a downloader to download and requires registration to proceed

icyfox168168 commented 1 year ago

essVisibilityObserver> >,base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>,base::ObserverListThreadSafe::NotificationData>' | Register 335 | Register Offset 0x30 S_REGREL32: '__formal' -> 'std::_Exact_args_t' | Register 335 | Register Offset 0x38 S_REGREL32: '_This_arg' -> 'base::ObserverListThreadSafe' | Register 335 | Register Offset 0x40 S_REGREL32: '<_Rest_arg_0>' -> 'base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>' | Register 335 | Register Offset 0x48 S_REGREL32: '<_Rest_arg_1>' -> 'base::ObserverListThreadSafe::NotificationData' | Register 335 | Register Offset 0x50 S_END

S_GPROC32 Function 'base::internal::BindState<void (cdecl*)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool>::Create<void (cdecl)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::&)(bool),bool &>' | RVA 0x1A86DC0 S_LOCAL: 'void ()()' -> 'invoke_func' S_DEFRANGE_REGISTER: Register 0x 14A S_DEFRANGE_REGISTER: Register 0x 14E

D:\Users\x\Documents\GitHub\raw_pdb\bin\x64\Release\Examples.exe (进程 16100)已退出,代码为 -1073741819。

icyfox168168 commented 1 year ago
// run all examples
//ExamplePDBSize(rawPdbFile, dbiStream);
//ExampleContributions(rawPdbFile, dbiStream);
//ExampleSymbols(rawPdbFile, dbiStream);
//ExampleFunctionSymbols(rawPdbFile, dbiStream);
ExampleFunctionVariables(rawPdbFile, dbiStream, tpiStream);
//ExampleLines(rawPdbFile, dbiStream, infoStream);
//ExampleTypes(tpiStream);

MemoryMappedFile::Close(pdbFile);

printf("xxxxxxxxxxxxxxxxxx");
getchar();
lukekasz commented 1 year ago

I was able to reproduce this issue. This crashes because internal GetTypeName(...) calls in ExampleTypes.cpp return a nullptr and then the nullptr is appended to a std::string. By guarding against the nullptr, ExampleFunctionVariables no longer crashes.

I will have a more detailed look at this tomorrow and see if I can fix GetTypeName for this PDB and the other 632 PDBs in Qt 6.5.2 :-)

lukekasz commented 1 year ago

I've fixed this issue in https://github.com/MolecularMatters/raw_pdb/pull/62

Both Qt6WebEngineCore.pdb and Qt6WebEngineCored.pdb used for testing can be downloaded from here:

http://lukekasz.com/raw_pdb/Qt6WebEngineCore-pdbs.zip

icyfox168168 commented 1 year ago

Can I merge and update to the main project? I want to test it

icyfox168168 commented 1 year ago

S_GPROC32 Function 'base::internal::BindState<void (cdecl*)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool>::Create<void (cdecl)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::&)(bool),bool &>' | RVA 0x1A86DC0 S_LOCAL: 'void ()()' -> 'invoke_func' S_DEFRANGE_REGISTER: Register 0x 14A S_DEFRANGE_REGISTER: Register 0x 14E Still the same mistake

lukekasz commented 1 year ago

SGPROC32 Function 'base::internal::BindState<void (cdecl*)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver _),void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::_)(bool),bool>::Create<void (_cdecl)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (_cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::&)(bool),bool &>' | RVA 0x1A86DC0 SLOCAL: 'void ()()*' -> 'invoke_func' S_DEFRANGE_REGISTER: Register 0x 14A S_DEFRANGE_REGISTER: Register 0x 14E Still the same mistake

I don't quite understand, it no longer crashes and shows the types in the parameter list.

What do you mean by the same mistake?

lukekasz commented 1 year ago

Can I merge and update to the main project? I want to test it

Oh, maybe the issue is that you are testing on the main branch? The PR I linked has not been merged yet, so you need to test the PR branch.

icyfox168168 commented 1 year ago

https://github.com/lukekasz/raw_pdb/tree/arglist-mfunction-fix I used this branch for testing and found the same error before it was fixed. Did I make a download error?

lukekasz commented 1 year ago

https://github.com/lukekasz/raw_pdb/tree/arglist-mfunction-fix I used this branch for testing and found the same error before it was fixed. Did I make a download error?

Can you explain that the error is? You mention a crash in your original message, but then copy paste some output from ExampleFunctionVariables and it is unclear to me what the issue is with the output.

icyfox168168 commented 1 year ago
S_FRAMEPROC: Size 32 | Padding 0 | Padding Offset 0x0 | Callee Registers Size 8
S_INLINEES: Count 30
S_REGREL32: 'this' -> 'std::tuple<scoped_refptr<base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver> >,base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>,base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>::NotificationData>' | Register 335 | Register Offset 0x30
S_REGREL32: '__formal' -> 'std::_Exact_args_t' | Register 335 | Register Offset 0x38
S_REGREL32: '_This_arg' -> 'base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>' | Register 335 | Register Offset 0x40
S_REGREL32: '<_Rest_arg_0>' -> 'base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>' | Register 335 | Register Offset 0x48
S_REGREL32: '<_Rest_arg_1>' -> 'base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>::NotificationData' | Register 335 | Register Offset 0x50

S_END

S_GPROC32 Function 'base::internal::BindState<void (cdecl*)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool>::Create<void (cdecl)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::&)(bool),bool &>' | RVA 0x1A86DC0 S_LOCAL: 'void ()()' -> 'invoke_func' S_DEFRANGE_REGISTER: Register 0x 14A S_DEFRANGE_REGISTER: Register 0x 14E

lukekasz commented 1 year ago
S_FRAMEPROC: Size 32 | Padding 0 | Padding Offset 0x0 | Callee Registers Size 8
S_INLINEES: Count 30
S_REGREL32: 'this' -> 'std::tuple<scoped_refptr<base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver> >,base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>,base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>::NotificationData>' | Register 335 | Register Offset 0x30
S_REGREL32: '__formal' -> 'std::_Exact_args_t' | Register 335 | Register Offset 0x38
S_REGREL32: '_This_arg' -> 'base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>' | Register 335 | Register Offset 0x40
S_REGREL32: '<_Rest_arg_0>' -> 'base::internal::UnretainedWrapper<content::ProcessVisibilityTracker::ProcessVisibilityObserver,base::RawPtrMayDangle>' | Register 335 | Register Offset 0x48
S_REGREL32: '<_Rest_arg_1>' -> 'base::ObserverListThreadSafe<content::ProcessVisibilityTracker::ProcessVisibilityObserver>::NotificationData' | Register 335 | Register Offset 0x50

S_END

SGPROC32 Function 'base::internal::BindState<void (cdecl*)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver _),void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::_)(bool),bool>::Create<void (_cdecl)(void (cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver ),void (_cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::&)(bool),bool &>' | RVA 0x1A86DC0 SLOCAL: 'void ()()*' -> 'invoke_func' S_DEFRANGE_REGISTER: Register 0x 14A S_DEFRANGE_REGISTER: Register 0x 14E

Can you explain in words what the issue with this output is?

icyfox168168 commented 1 year ago

文件: D:\symbols\Qt6WebEngineCore.pdb 大小: 1633820672 字节 修改时间: 2023年9月14日, 1:30:33 MD5: 2387B7556DA2B9C7DBCF274DDD895D31 SHA1: 96BF0A4EE3F0AE17BE5728308EFFCDC547F417D8 CRC32: 02314F45 Unable to fully traverse pdb, I did not see SSL_read The program crashes, and ida can

lukekasz commented 1 year ago

It works correctly for me on the https://github.com/lukekasz/raw_pdb/tree/arglist-mfunction-fix branch

S_GPROC32 Function 'base::internal::BindState<void (__cdecl*)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver *),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool>::Create<void (__cdecl*)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver *),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*&)(bool),bool &>' | RVA 0x1A86DC0
    S_LOCAL: 'void (*)()*' -> 'invoke_func'
    S_DEFRANGE_REGISTER: Register 0x 14A
    S_DEFRANGE_REGISTER: Register 0x 14E
    S_LOCAL: 'void (*)(void content::ProcessVisibilityTracker::ProcessVisibilityObserver::*(BOOL)*, BOOL, content::ProcessVisibilityTracker::ProcessVisibilityObserver*)**' -> 'functor'
    S_DEFRANGE_REGISTER: Register 0x 14B
    S_DEFRANGE_REGISTER: Register 0x 156
    S_LOCAL: 'void content::ProcessVisibilityTracker::ProcessVisibilityObserver::*(BOOL)**' -> '<bound_args_0>'
    S_DEFRANGE_REGISTER: Register 0x 14C
    S_DEFRANGE_REGISTER: Register 0x 150
    S_LOCAL: 'BOOL' -> '<bound_args_1>'
    S_DEFRANGE_REGISTER: Register 0x 14D
    S_DEFRANGE_REGISTER: Register 0x 151
    S_INLINESITE: Parent 0x 9B0
        S_CALLEES: Count 1
        S_INLINESITE: Parent 0x CEC
            S_INLINESITE: Parent 0x D14
                S_INLINESITE: Parent 0x D28
                S_INLINESITE_END:
                S_INLINESITE: Parent 0x D28
                    S_INLINESITE: Parent 0x D54
                    S_INLINESITE_END:
                S_INLINESITE_END:
            S_INLINESITE_END:
        S_INLINESITE_END:
    S_INLINESITE_END:
    S_CALLEES: Count 1
    S_FRAMEPROC: Size 32 | Padding 0 | Padding Offset 0x0 | Callee Registers Size 8
    S_INLINEES: Count 14
    S_REGREL32: 'invoke_func' -> 'void (*)()*' | Register 335 | Register Offset 0x30
    S_REGREL32: 'functor' -> 'void (*)(void content::ProcessVisibilityTracker::ProcessVisibilityObserver::*(BOOL)*, BOOL, content::ProcessVisibilityTracker::ProcessVisibilityObserver*)**' | Register 335 | Register Offset 0x38
    S_REGREL32: '<bound_args_0>' -> 'void content::ProcessVisibilityTracker::ProcessVisibilityObserver::*(BOOL)**' | Register 335 | Register Offset 0x40
    S_REGREL32: '<bound_args_1>' -> 'BOOL' | Register 335 | Register Offset 0x48
    S_HEAPALLOCSITE: 'base::internal::BindState<void (__cdecl*)(void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool,content::ProcessVisibilityTracker::ProcessVisibilityObserver *),void (__cdecl content::ProcessVisibilityTracker::ProcessVisibilityObserver::*)(bool),bool>' | Offset 0x1A85DEA | Section 1 | Instruction Length 5
S_END

Here is the full output: http://lukekasz.com/raw_pdb/Qt6WebEngineCore-pdb-function-variables.zip

It seems to me that you are accidentally testing with the wrong branch or executable.

It makes sense that it would crash exactly on this line the main branch, since this is the case I fixed

    S_LOCAL: 'void (*)(void content::ProcessVisibilityTracker::ProcessVisibilityObserver::*(BOOL)*, BOOL, content::ProcessVisibilityTracker::ProcessVisibilityObserver*)**' -> 'functor'
icyfox168168 commented 1 year ago

The output file you provided can be found in S GPROC32 Function 'SSL Read '| RVA 0x3490F90 S LOCAL: 'ssl' St '->' ssl '