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

Deparsing stopped due to parse error + Deparsing hit an internal grammar-rule bug #215

Closed
skochinsky opened this issue Jan 26, 2019 · 4 comments

Comments

@skochinsky
Copy link

Description

Having above errors decompiling a specific file. "parse error" happens with 2.7 bytecode, "internal grammar-rule bug" with the 2.5 one.

How to Reproduce

Files were extracted from GenFds.exe from the UEFI Development Kit, versions UDK2010.SR1.UP1.P1 and UDK2014.

I used:

uncompyle6 -t FdfParser.pyc  >FdfParser.pyt

Output is

# file FdfParser.pyc
# Deparsing stopped due to parse error

and

# file FdfParser.pyc
# Deparsing hit an internal grammar-rule bug

I attached both extracted files and the output here: FdfParser_bug.zip. Source from the recent edk2 tree is added too but it probably does not match the .pyc files which are older. You can find the past versions in the edk2 tree by switching the git branch.

Expected behavior

No errors and output close to the original

Environment

uncompyle6 3.2.5 (just pulled today and did pip install -e .)
Python 2.7.10 from python.org (x86)
OS: windows 10 1809

rocky added a commit that referenced this issue Jan 26, 2019
@rocky
Copy link
Owner

rocky commented Jan 26, 2019

See if e1628d4 fixes this. If so, close this issue.

@skochinsky
Copy link
Author

Thank you! The UDK2010 (2.5 bytecode) now decompiles cleanly, however the 2014 one (2.7 bytecode) still produces this output:

Instruction context:
   
 801    2329  LOAD_FAST             0  'self'
           2332  LOAD_ATTR            10  'CurrentLineNumber'
           2335  LOAD_CONST            7  1
           2338  BINARY_ADD       
           2339  STORE_FAST            2  'RegionLayoutLine'
           2342  JUMP_BACK            21  'to 21'
->         2345  JUMP_BACK            21  'to 21'
           2348  POP_BLOCK        
         2349_0  COME_FROM            18  '18'


# decompile failed
# file FdfParser.pyc
# Deparsing stopped due to parse error

@rocky rocky closed this as completed in bfceeac Jan 28, 2019
@rocky
Copy link
Owner

rocky commented Jan 28, 2019

In the future please isolate to one issue per bug, rather than one issue for everything you happen to be working on.

Also, please reduce the size of the source code to just the function that is failing and further try removing statements extraneous source-code lines to get a small function that exhibits the behavior.

This is all spelled out in the instructions for how to report a bug.

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

3 participants
@rocky @skochinsky and others