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

rabin2 not working/crashing on PDB #6434

Closed
phmarek opened this issue Jan 5, 2017 · 21 comments · Fixed by #7997
Closed

rabin2 not working/crashing on PDB #6434

phmarek opened this issue Jan 5, 2017 · 21 comments · Fixed by #7997
Labels
debug-info rabin2 Windows Microsoft Windows platform support issues
Milestone

Comments

@phmarek
Copy link

phmarek commented Jan 5, 2017

Rabin2 (from radare2=1.1.0+dfsg-1) doesn't work for PDB files built from CL.EXE 19.00.24210 (free EWDK edition).

$ gdb --args rabin2 -P wdm_harvested.pdb
...
/usr/share/radare2/1.1.0/magic/riff, 61: Warning: Printf format is too long for type `lelong' in description `, %lu x'
/usr/share/radare2/1.1.0/magic/riff, 62: Warning: Printf format is too long for type `lelong' in description `%lu,'
pdb root has not initialized
pdb was not parsed

Program received signal SIGSEGV, Segmentation fault.
0x0000555555819300 in ?? ()
(gdb) bt
#0  0x0000555555819300 in ?? ()
#1  0x00007ffff745982f in ?? () from /usr/lib/x86_64-linux-gnu/libr_bin.so.1.1
#2  0x00007ffff77532fc in r_core_bin_info () from /usr/lib/x86_64-linux-gnu/libr_core.so.1.1
#3  0x0000555555558310 in ?? ()
#4  0x00007ffff3c042b1 in __libc_start_main (main=0x555555556750, argc=0x3, argv=0x7fffffffdfb8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fffffffdfa8) at ../csu/libc-start.c:291
#5  0x0000555555558a5a in ?? ()

On another file I had no segfault, but the same 4 messages and no output either.

crash.zip

@radare
Copy link
Collaborator

radare commented Jan 5, 2017 via email

@phmarek
Copy link
Author

phmarek commented Jan 5, 2017

Reproducer file is attached above. Within the ZIP file.

@radare radare added this to the 1.2.0 milestone Jan 16, 2017
@radare radare added the release label Jan 16, 2017
@radare
Copy link
Collaborator

radare commented Jan 16, 2017

the bug is in finish_pdb_parse

@radare radare closed this as completed in 75dd453 Jan 16, 2017
@radare
Copy link
Collaborator

radare commented Jan 16, 2017

I have fixed the crash, but the code is actually leaking. The problem here is that the list of elements is assuming some really bad things and its crashing when the list is constructed in a different order. I'll open an issue to fix this memory leak. But at least it's not crashing now :)

thanks!

@phmarek
Copy link
Author

phmarek commented Jan 16, 2017

Hmmm, thanks for the fix... but now rabin2 doesn't support -P any more?

$ ./rabin2 -P
Usage: rabin2 [-AcdeEghHiIjlLMqrRsSvVxzZ] [-@ addr] [-a arch] [-b bits]
              [-B addr] [-C F:C:D] [-f str] [-m addr] [-n str] [-N m:M]
              [-o str] [-O str] [-k query] [-D lang symname] | file

How would I dump PDB files now? The manual page still has -P.

@phmarek
Copy link
Author

phmarek commented Jan 16, 2017

$ git log -1
commit 75dd4536fa3980041b22cf9da2863f0c0bbe2142
Author: pancake <pancake@nopcode.org>
Date:   Mon Jan 16 10:40:09 2017 +0100

    Fix #6434 - Crash in PDB

@radare
Copy link
Collaborator

radare commented Jan 16, 2017

it does. see the output of rabin2 -h, rabin2 -P expects an argument. i'll just update the short help message. thanks for pointing out

@radare
Copy link
Collaborator

radare commented Jan 16, 2017 via email

@phmarek
Copy link
Author

phmarek commented Jan 16, 2017

Sorry, used the wrong shell script that didn't insert the arguments.

Still, I don't get the expected output...

$ ./rabin2 -j -P .../xxx.pdb
pdb root has not initialized
pdb was not parsed
{"pdb":false}

And without -j I get the first two lines, but then no more data.

@radare radare reopened this Jan 16, 2017
@radare
Copy link
Collaborator

radare commented Jan 16, 2017 via email

@phmarek
Copy link
Author

phmarek commented Jan 16, 2017

Well, it's a true output of CL.EXE, so I guess that it's contents should be okay...

@Maijin Maijin closed this as completed Jan 20, 2017
@phmarek
Copy link
Author

phmarek commented Jan 20, 2017

rabin2 is not crashing anymore, but it still won't give any useful output for me.

$ ./rabin2 -P ....pdb
pdb root has not initialized
pdb was not parsed

That's using 7775521.

@radare radare reopened this Jan 20, 2017
@radare
Copy link
Collaborator

radare commented Jan 20, 2017

again?? please read the comments of the issue. its not crashing but it is not properly parsed

@radare radare modified the milestones: 1.3.0, 1.2.0 Jan 20, 2017
@phmarek
Copy link
Author

phmarek commented Jan 20, 2017

Yeah, right.
It's not crashing.
And it's not properly parsing the file.

But it's a freshly generated file, and I didn't run any fuzzying tool... so I hoped for a dump of the contents.

@radare
Copy link
Collaborator

radare commented Jan 20, 2017 via email

@XVilka XVilka added the Windows Microsoft Windows platform support issues label Feb 28, 2017
@alvarofe
Copy link
Contributor

I may give a try this, never did PDB.

@alvarofe alvarofe self-assigned this Mar 10, 2017
@radare radare modified the milestones: 1.4.0, 1.3.0 Mar 10, 2017
@radare
Copy link
Collaborator

radare commented Mar 10, 2017 via email

@radare radare modified the milestones: 1.5.0, 1.4.0 Apr 16, 2017
@radare
Copy link
Collaborator

radare commented May 20, 2017

HELLO @h4ng3r !!! ARE YOU STILL HERE??

@h4ng3r h4ng3r removed their assignment May 20, 2017
@h4ng3r
Copy link
Contributor

h4ng3r commented May 20, 2017

@radare no time sorry, I just removed my assignment. I'll focus in my other assigned issues.

@XVilka
Copy link
Contributor

XVilka commented May 20, 2017

@radare I think this falls into Windows GSoC, just not for this release.

@XVilka XVilka modified the milestones: 1.6.0, 1.5.0 May 20, 2017
@XVilka
Copy link
Contributor

XVilka commented Jun 15, 2017

@xarkes this is for you, but later this summer.

@radare radare modified the milestones: 1.7.0, 1.6.0 Jul 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug-info rabin2 Windows Microsoft Windows platform support issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants