Closed Bug 534992 Opened 13 years ago Closed 10 years ago

UnboundLocalError: local variable 'cleanroot' referenced before assignment in toolkit/crashreporter/tools/


(Toolkit :: Crash Reporting, defect)

Not set





(Reporter: bc, Assigned: dustin)




(1 file)

$ make buildsymbols
echo building symbol store
building symbol store
rm -f -rf ./dist/crashreporter-symbols
rm -f -f "./dist/"
/work/mozilla/builds/1.9.1/mozilla/firefox-debug/config/nsinstall -D ./dist/crashreporter-symbols
/usr/bin/python /work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/ \
	  -a i386 --vcs-info                                          \
	  -s /work/mozilla/builds/1.9.1/mozilla               \
	  ./dist/host/bin/dump_syms                                                \
	  ./dist/crashreporter-symbols                                   \
	  ./dist/bin >                                        \
Processing file: ./dist/bin/BadPlugin.dSYM
2009-12-15 14:22:54.883 dump_syms[26510:613] Loading DWARF dSYM file from /work/mozilla/builds/1.9.1/mozilla/firefox-debug/dist/bin/BadPlugin.dSYM/Contents/Resources/DWARF/BadPlugin
Unexpected error:  <type 'exceptions.UnboundLocalError'>
Traceback (most recent call last):
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 755, in <module>
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 751, in main
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 462, in Process
    return self.ProcessDir(file_or_dir)
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 479, in ProcessDir
    if not self.ProcessFile(fullpath):
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 707, in ProcessFile
    res = Dumper.ProcessFile(self, dsymbundle)
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 528, in ProcessFile
    (filename, rootname) = GetVCSFilename(filename, self.srcdirs)
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 361, in GetVCSFilename
    fileInfo = HGFileInfo(file, srcdir)
  File "/work/mozilla/builds/1.9.1/mozilla/toolkit/crashreporter/tools/", line 294, in __init__
    HGRepoInfo.repos[srcdir] = HGRepoInfo(path, rev, cleanroot)
UnboundLocalError: local variable 'cleanroot' referenced before assignment
make: *** [buildsymbols] Error 1

works with make buildsymbols SYM_STORE_SOURCE_DIRS=
This typically happens when your source directory isn't cloned directly from the web based repository (e.g. but from a clone of a local directory.

From looking at the script, specifying SRCSRV_ROOT would be better, but having an overall better error message would be good.

e.g. something like "This is either not a clone of the web based repository, or you have not specified the SRCSRV_ROOT variable" would cover some cases (although I've also seen it when hg can't actually be run).
Duplicate of this bug: 695914
Attached patch m534992.patchSplinter Review
We see this error for clone failures, too, e.g., bug 695914.  This patch fixes the glaring Python error, replacing it with a better error message that (hopefully) covers all of the possibilities.

This specifically does *not* address your suggestion in the previous comment to handle the broken case in this bug.  That fix is over my head.  If you'd like, I'll be happy to move this patch back to 695914, since that's about all it fixes.

>>> h = HGFileInfo('toolkit/crashreporter/tools/', '/Users/dustin/tmp/mozilla-central')
Could not determine repo info for /Users/dustin/tmp/mozilla-central.  This is either not a clone of the web-based
repository, or you have not specified SRCSRV_ROOT, or the clone is corrupt.
dustin@lorentz ~/tmp/mozilla-central $
Assignee: nobody → dustin
Attachment #568260 - Flags: review?(ted.mielczarek)
Comment on attachment 568260 [details] [diff] [review]

Review of attachment 568260 [details] [diff] [review]:

This is better than the existing error, so that's fine. It would probably be nice to handle this case usefully, but I guess 99% of the time when this is being run it's on RelEng systems, and you'd rather get the error than have some incorrect fallback anyway.
Attachment #568260 - Flags: review?(ted.mielczarek) → review+
Dustin, still driving this?  I just hit this error due to cloning from another repo on disk instead of from hgweb and had to debug this a second time.  If the only thing left to do here is to push the r+'d patch to mozilla-inbound, I can do that.
Please do - I just haven't gotten around to it yet.
Assignee: dustin → jhford
Assignee: jhford → coop
Closed: 10 years ago
Resolution: --- → FIXED

Coop - bugs typically aren't marked as fixed until they land on m-c.
Assignee: coop → dustin
Flags: in-testsuite-
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.