Closed Bug 575919 Opened 14 years ago Closed 9 years ago

symbolstore.py gets tripped up by paths on irrelevant drives

Categories

(Toolkit :: Crash Reporting, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: jruderman, Assigned: jimm)

Details

Attachments

(2 files)

Attached patch patch?Splinter Review
Yet another problem trying to use "make buildsymbols" on Windows :(

While processing pdbs, dump_syms.exe encounters such lovely paths as
f:\dd\public\sdk\inc (from browser\app\firefox.pdb)
f:\dd\vctools\crt_bld\self_x86\crt\prebuild\eh
d:\winmain.public.x86fre\sdk\inc

Two functions in symbolstore.py use os.path.isdir() on these paths.

Rather than simply returning false, os.path.isdir("f:") pops up a dialog:
  python.exe - No Disk
  There is no disk in the drive.
  Please insert a disk into drive \Device\Harddisk2\DR2.
  [Cancel] [Try Again] [Continue]

I have no idea why isdir does this.  I'm using a python from mozillabuild, fwiw.

I worked around this locally by having FixFilenameCase and GetVCSFilename only use isdir on files from the same drive as the srcdir.  I think both functions are only interested in source files, which should be on the same drive as the script, but I'm not completely sure.  Is this reasonable to check in?
Attachment #455095 - Flags: review?(ted.mielczarek)
Apparently this is what windows does to you if you try to access a file on a removable drive that doesn't have media present. I think your solution is reasonable, although I think I'd be a little happier if you instead used the srcdir value that was passed into the script as a cmdline param, and only tried to munge filenames that were in the srcdir, or at least on the same drive.
It would probably be nice if Windows Python was a little less stupid about this, too.
Attachment #455095 - Flags: review?(ted.mielczarek)
Ran into this today.
Comment on attachment 635839 [details] [diff] [review]
disable warning patch

Review of attachment 635839 [details] [diff] [review]:
-----------------------------------------------------------------

I hit this myself today, and this fixes it and is pretty clean. Let's land this. (Requires minor fixup to make the import hunk apply.)

::: toolkit/crashreporter/tools/symbolstore.py
@@ +511,5 @@
>                                      start = filename.find(self.srcdir)
>                                      if start != -1:
>                                          filename = filename[start:]
>                                          break
> +                            # print >> sys.stderr, "Processing FILE line ", filename

Get rid of this.

@@ +576,5 @@
>              return self.fixedFilenameCaseCache[file]
>  
>          result = file
>  
> +        ctypes.windll.kernel32.SetErrorMode(ctypes.c_uint(1)) 

nit: trailing space
Attachment #635839 - Flags: review+
I hit this again yesterday so I landed Jim's patch.
Assignee: nobody → jmathies
https://hg.mozilla.org/mozilla-central/rev/1ab62d770041
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: