Closed Bug 541126 Opened 11 years ago Closed 11 years ago

IPDL: Check that protocol graph induced on (directed) manager relation is acyclic

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cjones, Unassigned)

Details

(Whiteboard: [good first bug])

Attachments

(1 file, 1 obsolete file)

I'm not really sure what would happen if it were cyclic, currently; probably send ipdlc into an infinite loop.  Pretty easy to check, but also not a high priority bug.
Cyclic manager/manages relations result in a stack overflow error in $srcdir/ipc/ipdl/ipdl/lower.py (specifically, _FindFriends.walkDownTheProtocolTree)

Patch in the works.
Attached patch implements a naive cycle detection algorithm. Example error message output:

/home/tom/opensource/electrolysis.hg/ipc/ipdl/test/ipdl/ok/cyclecheck_Parent.ipdl:3: error: cycle(s) detected in manager/manages heirarchy: `cyclecheck_Parent -> cyclecheck_Child -> cyclecheck_Grandchild -> cyclecheck_Parent'
Hello Thomas, wanted to pass on a couple of practical notes.  First, when you're ready to have a patch reviewed for committing, click "Details" next to the patch, find the "review" row next to your diff, set the dropdown to "?" and set the requestee appropriately.  (For me, you can just enter ":cjones".)  Second, there's an informal "Mozilla patch style" that most reviewers expect; you can emit patches in this format by setting the following in your ~/.hgrc file

[diff]
git = 1
showfunc = 1

[defaults]
diff = -p -U 8
qdiff = -p -U 8

and then generating your patch with

$ hg diff

(or |$hg qdiff| if you're using mercurial queues.)

Thanks for the patch!
Just updated my hgrc as per your recommendations. New patch should reflect it.

Shall push it through to you for review.

Thanks yet again!
Attachment #423469 - Attachment is obsolete: true
Attachment #423760 - Flags: review?(jones.chris.g)
Comment on attachment 423760 [details] [diff] [review]
Naive cycle detection patch, revision #2

Looks good.

Thanks again for the patch!
Attachment #423760 - Flags: review?(jones.chris.g) → review+
Pushed http://hg.mozilla.org/projects/electrolysis/rev/4cdebce7020a
Whiteboard: [good first bug] → [good first bug] [land m-c]
http://hg.mozilla.org/mozilla-central/rev/4f4a912c36f0
Whiteboard: [good first bug] [land m-c] → [good first bug]
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.