Opened 11 years ago

Closed 11 years ago

#2509 closed defect (fixed)

Changing IP address crashes OMEdit

Reported by: Adam Dershowitz <dersh@…> Owned by: Adeel Asghar
Priority: high Milestone: 1.9.1
Component: OMEdit Version: trunk
Keywords: Cc:

Description

I am using the Mac version of OMEdit on a laptop. If I have OMEdit opened and change the IP address it can no longer connect to the OpenModelica compiler and it exits.
For example if I move the computer from home to office, or even just unplug the ethernet cable, and I have OMEdit opened, and I try to do anything it will fail to connect and will crash.
I would guess that whatever connection is being used between OMEdit and omc is based on the IP address, so a change makes it unable to find the existing instance of omc.

Change History (18)

comment:1 by Lennart Ochel, 11 years ago

Component: BackendOMEdit
Owner: changed from probably noone to Adeel Asghar
Status: newassigned

comment:2 by Adam Dershowitz <dersh@…>, 11 years ago

I was just looking into this. It seems that OMEdit is doing a lookup and connecting to omc via the actual IP address of my machine. So, a changed IP address will break this connection.
If instead it connected to omc via 127.0.0.1 I think that this problem would go away.
Is there a way either for the user, or in the code, to change the connection address?

comment:3 by Adeel Asghar, 11 years ago

Does this happen with other OM clients as well?
AFAIK OMEdit doesn't use any IP address but it might be that the CORBA implementation on MAC is triggering this issue.

The only place where OMEdit makes a network request is when it tries to fetch the latest news from openmodelica.org but you can enable/disable this feature in Options/preferences Show Latest News.

comment:4 by Adam Dershowitz <dersh@…>, 11 years ago

I just verified that OMShell also has the problem. With OMShell when it looses the connection, and times out, it then offers to restart omc. If I click OK it then starts a new instance of omc.
I do see a network connection internal to the machine from OMEdit (or OMShell) to omc (at the moment port 53540->53541).
So yes, this is likely the COBRA connection using an "internal" port to pass data.

comment:5 by Adrian Pop, 11 years ago

This is a no-bug in my opinion. How many times people change IP address?
However, I guess the issue is in Compiler/runtime/corbaimpl.cpp
where we have this:

  const char *dummyArgv[] = {
    "omc",
    "-NoResolve",
    "-IIOPAddr",
    "inet:127.0.0.1:0",
    "-ORBgiopMaxMsgSize",
    "2147483647" /*,  "-ORBDebugLevel", "10", "-ORBIIOPBlocking" */
  };

So it seems we are listening to 127.0.0.1 so it should not be a problem.
All other clients are just taking the CORBA object id from file and connect
to the given ip/port. So I don't quite get it why this happens for you.

Version 0, edited 11 years ago by Adrian Pop (next)

comment:6 by Adam Dershowitz <dersh@…>, 11 years ago

People with laptops change them every time they move the laptop from location to location. With desktops you are correct that they rarely change. I bring my laptop between home and work most days, and if I have an OMEdit session running, it quits.
But, the code that you have above does use 127.0.0.1, which is strange. When I look in my Activity Monitor at opened files and ports, I see a connection between OMEdit and omc that is listed using my machinename.companyname.com on one port in OMEdit and another port in omc.

comment:7 by Adrian Pop, 11 years ago

Oh, I thought was "localhost" that changed IP address.
Then this is a bug. I'll have a look at how the corba connection is
done from clients as that might use the hostname which can change IP
address.

comment:8 by Adam Dershowitz <dersh@…>, 11 years ago

Sorry if I wasn't clear about it.
Yes, for example right now it is listed as:
name.company.com:54121->name.company.com:54120
Let me know if any other details might be helpful to help you track it down.

comment:9 by Adrian Pop, 11 years ago

Ok, from OMCProxy.cpp in OMEdit:

    int argc = 2;
    static const char *argv[] = {"-ORBgiopMaxMsgSize", "2147483647"};
    CORBA::ORB_var orb = CORBA::ORB_init(argc, (char **)argv);

I guess we need:

    "-NoResolve",
    "-IIOPAddr",
    "inet:127.0.0.1:0",

as argv for ORB_init in OMEdit & OMShell and the other clients.

in reply to:  9 comment:10 by Adeel Asghar, 11 years ago

Replying to adrpo:

Ok, from OMCProxy.cpp in OMEdit:

    int argc = 2;
    static const char *argv[] = {"-ORBgiopMaxMsgSize", "2147483647"};
    CORBA::ORB_var orb = CORBA::ORB_init(argc, (char **)argv);

I guess we need:

    "-NoResolve",
    "-IIOPAddr",
    "inet:127.0.0.1:0",

as argv for ORB_init in OMEdit & OMShell and the other clients.

If the server is running on localhost then the client by default should use localhost. If this is the problem then it is very strange.

But I can try it and we will see what happens.

comment:11 by Adeel Asghar, 11 years ago

Try r20947.

comment:12 by Adam Dershowitz <dersh@…>, 11 years ago

Typically, I do also change between ethernet and wifi when I have the problem. I would not think that would mattersince it seems to be using the actual machine name and that changes, but I figured I would put it out there, since it is another data point.

comment:13 by Adam Dershowitz <dersh@…>, 11 years ago

No luck. The same problem with r20947.

comment:14 by Adrian Pop, 11 years ago

Try r20948 as Adeel did a small mistake in r20947.

comment:15 by Adam Dershowitz <dersh@…>, 11 years ago

Nope. I get the same results with r20948 The connection is still being made by domain name to domain name, and it fails if the IP changes.

comment:16 by Adeel Asghar, 11 years ago

It should work now in r20949. Use r20950.

comment:17 by Adam Dershowitz <dersh@…>, 11 years ago

That fixed it! I have switched interfaces, and IP address, without OMEdit closing. And, I see the connection at the moment as localhost:57375->localhost:57264 even if I make a network chnage.

comment:18 by Adam Dershowitz <dersh@…>, 11 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.