frenetic-lang / pyretic

The Pyretic language and runtime system
http://frenetic-lang.org/pyretic/
159 stars 99 forks source link

virtualization code bug #3

Closed joshreich closed 11 years ago

joshreich commented 11 years ago

(As summarized by Nate) Here's what you can do to tickle the bug:

  1. Boot up Mininet in a simple non-trivial topology

sudo mn --controller=remote --topo=tree,2 --mac --switch=ovsk

  1. Start POX running the Pyretic code

export PATH=$PATH:/home/mininet/pox export PYTHONPATH=/home/mininet/pox:/home/mininet/pyretic pox.py pyretic/examples/virtualize.py \ --virttopo=pyretic/virttopos/bfs.py \ --program=pyretic/examples/hub.py

  1. Ping between hosts h1 and h3.

You should see the following error:

RuntimeError('maximum recursion depth exceeded while getting the str of an object',) /home/mininet/pyretic/frenetic/util.py(84)new() 83 def new(cls, _args, _kwargs): 85 return cls.real_base.new(cls, _args, _kwargs)

I'm not a reflection expert, but it looks to me that this may be trying to invoke the same constructor that it was just called with? I added some debugging code and cls is frenetic.netcore.restrict, and cls.realBase is "Record_restrict" and

monsanto commented 11 years ago

Is there more to this? The post ends with "and".

joshreich commented 11 years ago

odd, the last portion of the final session didn't paste. It was: "is being invoked in a tight loop."

thanks for looking into this and please make it your top priority. this is by far the most important issue on the list.

-josh On Jan 10, 2013, at 11:56 AM, Christopher Monsanto notifications@github.com wrote:

Is there more to this? The post ends with "and".

— Reply to this email directly or view it on GitHub.

monsanto commented 11 years ago

Just a note: I add

export PATH=$PATH:/home/openflow/pox
export PYTHONPATH=/home/openflow/pox:/home/openflow/pyretic

to .profile in the HOME directory.

and mininet is runnable with pyretic/mininet.sh, which will also run mn -c, which can prevent some nasty, hard to debug bugs

jnfoster commented 11 years ago

Oh, I'm on a different VM where the username is mininet not openflow.

I always run mn -c between runs.

monsanto commented 11 years ago

Issue seems to be that both Predicate and Data want to own __getitem__. This problem didn't exist before because we didn't use that bit of syntax sugar until now. I just rewrote the predicates and policies to not rely on the Data class (I was meaning to phase it out of that use anyway, notice some of the classes didn't inherit from it)

joshreich commented 11 years ago

I'd suggest

export PATH=$PATH:$HOME/pox export PYTHONPATH=$HOME/pox:$HOME/pyretic instead since it's not username specific.

On Jan 11, 2013, at 12:46 AM, Christopher Monsanto notifications@github.com wrote:

Just a note: I add

export PATH=$PATH:/home/openflow/pox export PYTHONPATH=/home/openflow/pox:/home/openflow/pyretic to .profile in the HOME directory.

— Reply to this email directly or view it on GitHub.

joshreich commented 11 years ago

Check out the mininet.sh script Chris threw together a while back (in ~/pyretic) - it saves some typing/remembering

On Jan 11, 2013, at 12:57 AM, Nate Foster notifications@github.com wrote:

I always run mn -c between runs.

joshreich commented 11 years ago

Oh, one other useful trick: if you want to run tcpdump in several node xterms, run the below once before launching the xterms

IFACE=ifconfig | head -n 1 | awk '{print $1}'; tcpdump -XX -vvv -t -n -i $IFACE not ether proto 0x88cc then just run this command from history and you'll get a nice dump w/o having to manually specify a separate interface for each xterm (e.g., h1-eth0, h2-eth0, …)

-Josh

On Jan 14, 2013, at 5:51 PM, Joshua Reich jreich@CS.Princeton.EDU wrote:

Check out the mininet.sh script Chris threw together a while back (in ~/pyretic) - it saves some typing/remembering

On Jan 11, 2013, at 12:57 AM, Nate Foster notifications@github.com wrote:

I always run mn -c between runs.