678: Failed patch results in Python traceback for diff

Thomas.D*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 10, 2009
What's the URL of the page containing the problem?

r/#/diff/1/

What steps will reproduce the problem?
1. Submit a review request with diff using a stale Perforce tree.

What is the expected output? What do you see instead?

Expected some sort of error message about a rejected diff.  Instead, the
diff contained the following text:



The patch to '//depot/project/.../Makefile' didn't apply cleanly. The
temporary files have been left in '/tmp/reviewboard.0bt2yV' for debugging
purposes. `patch` returned: patch: **** Only garbage was found in the patch
input.

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/reviewboard/diffviewer/views.py",
line 82, in view_diff
    files = get_diff_files(diffset, None, interdiffset, highlighting)
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 599, in get_diff_files
    enable_syntax_highlighting)
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 518, in generate_files
    lambda: get_chunks(filediff.diffset,
  File "/usr/lib/python2.4/site-packages/reviewboard/djblets/util/misc.py",
line 49, in cache_memoize
    data = lookup_callable()
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 521, in <lambda>
    enable_syntax_highlighting))
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 322, in get_chunks
    new = get_patched_file(old, filediff)
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 238, in get_patched_file
    return patch(filediff.diff, buffer, filediff.dest_file)
  File
"/usr/lib/python2.4/site-packages/reviewboard/diffviewer/diffutils.py",
line 116, in patch
    raise Exception(_("The patch to '%s' didn't apply cleanly. The
temporary " +
Exception: The patch to '//depot/project/.../Makefile' didn't apply
cleanly. The temporary files have been left in '/tmp/reviewboard.0bt2yV'
for debugging purposes.
`patch` returned: patch: **** Only garbage was found in the patch input.


What operating system are you using? What browser?

OS is Linux on both client and server.
Browser is Firefox 3.0.x.

Please provide any additional information below.

NA
#1 Thomas.D*********@gmai***** (Google Code) (Is this you? Claim this profile.)
On further inspection, the diff itself seems to be inaccessible and a new Python
traceback is displayed for every attempt to access it.  This is evidenced by a new
temporary filename in the traceback.

This leads me to be concerned about inadvertently (or maliciously) filling up /tmp
with tracebacks as folks try to access the diff.
chipx86
#2 chipx86
Would be nice to start providing real error pages for these. Probably post-1.0.
  • +Confirmed
  • -Priority-Medium
    +Priority-High
    +Component-DiffViewer
    +Milestone-Release1.5
david
#3 david
Christian fixed this now :D
  • -Confirmed
    +Fixed