Closed Bug 1136858 Opened 11 years ago Closed 10 years ago

'using' a type which doesn't exist in an IPDL file causes a weird exception

Categories

(Core :: IPC, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jdm, Assigned: mprsai, Mentored)

Details

(Whiteboard: [lang=py][good first bug])

Attachments

(2 files)

I added `using mozilla::dom::SericeWorkerId from "mozilla/dom/ipc/IdType.h";` to PNecko.ipdl, and got this exception: > 0:07.48 Traceback (most recent call last): > 0:07.48 File "/Users/jdm/src/mozilla-central/config/pythonpath.py", line 56, in <module> > 0:07.48 main(sys.argv[1:]) > 0:07.48 File "/Users/jdm/src/mozilla-central/config/pythonpath.py", line 48, in main > 0:07.49 execfile(script, frozenglobals) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl.py", line 132, in <module> > 0:07.49 if not ipdl.typecheck(ast): > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/__init__.py", line 35, in typecheck > 0:07.49 There are no private exports. > 0:07.49 return TypeCheck().check(ast, errout) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 616, in check > 0:07.49 if not runpass(GatherDecls(builtinUsing, self.errors)): > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 608, in runpass > 0:07.49 tu.accept(tcheckpass) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 714, in visitTranslationUnit > 0:07.49 pinc.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 778, in visitInclude > 0:07.49 cd store; /Applications/Xcode.app/Contents/Developer/usr/bin/make private_export > 0:07.49 inc.tu.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 714, in visitTranslationUnit > 0:07.49 pinc.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 778, in visitInclude > 0:07.49 inc.tu.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 714, in visitTranslationUnit > 0:07.49 pinc.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 778, in visitInclude > 0:07.49 inc.tu.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 714, in visitTranslationUnit > 0:07.49 pinc.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.49 return visit(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 778, in visitInclude > 0:07.49 inc.tu.accept(self) > 0:07.49 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/ast.py", line 139, in accept > 0:07.50 return visit(self) > 0:07.50 File "/Users/jdm/src/mozilla-central/ipc/ipdl/ipdl/type.py", line 731, in visitTranslationUnit > 0:07.50 There are no private exports. > 0:07.50 if inc.tu.filetype == 'header': > 0:07.50 AttributeError: 'NoneType' object has no attribute 'filetype' It would be worth figuring out what happens if we null-check inc.tu instead.
Hi, I would like to work on this. So, the fix could be remplace "inc.tu.filetype == 'header'" with "inc.tu == null"?
Flags: needinfo?(josh)
Replacing that doesn't make sense, since it's a real check we want to keep. I'm curious about how the output changes if we do null-check inc.tu before checking the filetype property, however.
Flags: needinfo?(josh)
Haaa ok, now I understand the bug. :) Could you tell me how run the test you run to check the output with the changes?
Flags: needinfo?(josh)
Just add the incorrect code that I mentioned in the first comment to any IPDL file in the tree, and then run ./mach build.
Flags: needinfo?(josh)
Assignee: nobody → gioyik
Any progress, Giovanny?
Flags: needinfo?(gioyik)
Yes, I added what you comment in "netwerk/ipc/PNecko.ipdl" and I got this. I attach the log.
Attached file build.log
Flags: needinfo?(gioyik) → needinfo?(josh)
Attachment #8582131 - Attachment mime type: text/x-log → text/plain
Flags: needinfo?(josh)
Could you paste the output of `hg diff`?
Oh, if you still have the null check present in type.py, that looks like it's now hiding the original error. I guess we should make it show a proper error instead :)
Attached file diff.log
I attached the output of `hg diff`. Let me know what I can do :)
Assignee: gioyik → nobody
Hey I'm working on it
Assignee: nobody → mprsai.bugs
This appears to have been resolved since I filed it.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: