Author Topic: Re-Post "mc-Studio not starting"  (Read 122 times)

mcThings

  • We Connect Things To The Internet... That Can't Be Plugged In.
  • Administrator
  • Jr. Member
  • *****
  • Posts: 68
    • View Profile
    • www.mcthings.com
Re-Post "mc-Studio not starting"
« on: June 01, 2016, 05:58:20 pm »
kersing4din General19a1
mc-Studio ‘not starting’
0
Installed mc-Studio V0.6-884 on Win10 Pro 64-bits. Double click on the desktop icon does not make anything happen. Trying to run it a second time results in an error concerning the logfile being used by another process. Task manager shows a background process mcStudio, not an application.
Restarting the PC doesn't solve this, still no application window on the screen.Like


danee
danee3d
I seem to have the same issue. Have changed the logging in settings.xml to 1 but in the logfile only 1 entry is shown; timestap — mcStudio Started —
When you start the second time there is an error that the logfile is locked and when you discard that error, briefly the mcstudio window is drawn and disappears immediatly.
Win8 pro 64bits, I was able to get mcStudio running in a vmware Win8 pro 64bits vm running on this system.
(Beeing able to start mcStudio twice would be a nice to have feature btw)Like

mcJohn
mcJohnAdmin3d
There is a logfile created by mcStudio and it cannot opened twice. So you always have to kill the process to continue. There are a lot of complications to run mc-Studio two instances so I don't think we will implement this any time soon. What we try is to make mc-Studio itself more multi-tasking line we did with the device connecting form. We try to remove a much as blocking operations as posible
The startup problem is a race condition between multiple running threads. We are looking to reproduce it so we can solve it. Can you check if the process take a lot of cpu cycles and are those cycles running in one or multiple cores.Like

kersing
kersing2d
Process uses 0% CPU. Process analyses shows three threads and ‘One of more threads of mcStudio are waiting for completion of network-I/O’. (Translated from Dutch message so the message may differ slightly).Like

veleek
veleek2d
mcJohn, the main issue is that launching mcStudio doesn't work. We're not trying to run two instances, we're just trying to run one and it ‘fails to launch’ resulting in the indicated error when we re-launch it.
Please provide feedback on our actual problem.Like
2d
More detail to help troubleshooting. If I disable my Wi-Fi when I launch the app, I get the following error message: Error when there is no internet connection.
When I re-enable the Wi-Fi, the app window never loads as indicated above. Examining the process with Task Manager seems to indicate that there are some threads blocked waiting for network IO to complete, TaskManager WaitChains. I've got the Windows Phone Emulators installed which does some funky stuff with your network adapters (sends everything through a virtual switch and stuff), so maybe there's something going on there around what mcStudio is trying to do?
REALLY looking forward to messing around with my modules, so looking forward to getting a fix for this soon!Like

danee
danee2d
Hmm The Windows Phone Emulator does some funky stuff with your network adaptors… I have VM player installed which installs virtual network adaptors, so I switched of the VMWare Virtual Ethernet Adaptors and presto: mcStudio launches succesfully!Like
2d
To add to that, after enabling the adaptors again mcStudio still works.
Is it possible that at first run mcStudio tries to read available network adaptors and silently fails when there are virtual adaptors?Like

mcJohn
mcJohnAdmin2d
That it run on VMWare and not on bare metal is an indication that it is a race condition. Because it does not consume CPU time it must be waiting for the virtual gateway. That is the only case where I wait without showing the main form. I will have a look how I can solve it.Like

kersing
kersing2d
VMware Workstation installed on this system. When I disable the VMware virtual network adapters (VMware Network Adapter VMnet1 and VMNet8) McStudio starts and shows a UI. With the adapters enabled no UI.
Does McStudio do a network scan at startup that fails when the host only/NAT adapters for virtual machines are present on the host?Like

mcJohn
mcJohnAdmin2d
Yes it does an adapter scan so it can handle multiple IP addresses. Previous we did not have that with was a big problem with VMWare and HyperV. But if something goes wrong it throws an error, it does not wait.
There is a complicated start sequence to connect to the gateway. This is because the physical gateways have limited resources and cannot open both a server socket and client socket. For that reason we have build the following discover system.
The gateway broadcast a UDP packet to indicate that there is a gateway. This contains its IP address and version information.
mc-Studio receives this UDP message and makes it available in the gateway/device form.
If the user want to connect to the gateway mcStudio will UPD its own IP address to the gateway and the gateway makes a tcp/ip connection to mc-Studio.
The Virtual gateway does exactly the same. I had problems running on a very fast PC in release mode and no problems in debug mode or on a slow PC. The problem was that the virtual gateway send the connection request before a tcp/ip thread was in accept connection request. I added a wait of 20mS between the UPD receive and the connection request in the virtual gateway and the problem disappeared.
What I expect is that the timing on a virtual adapter is different compared to a bare metal ip connection.
Going to test with the VMWare caseLike

kersing
kersing1d
Keep in mind I'm not running McStudio in a VM, I'm running on bare metal (Workstation host) and McStudio fails if the VMware network adapters required for VM connectivity are enabled. For the time being I disabled the adapters and McStudio has no issues on startup. No other changes to make it run on an Intel i7 quad core system. System is wired to gigabit switch.
Based on these symptoms I suspect the adapter scan causes issues when the VMware adapters are enabled, not the virtual gateway. If you can extract that part of the code I'll happily run some tests. (Got Visual Studio 2015 installed)Like

veleek
veleek1d
Same here. I can run any tests you want me to and I can help debug in whatever way you want.
So here's the big question, is there any reason mcStudio isn't open source? You wouldn't necessarily need to accept code changes from external users, but it would make it super easy to debug issues like this for you!Like
1d
Kersing, I was able to try out you workaround and disabled the network adapter, and everything appears to work.
Here is the list of network adapters that I have, NetworkConnections. It appears to be ONLY the last one in the list (highlighted yellow) that actually causes any problems. Disabling or enabling that one alone allows me to launch mcStudio.Like

danee
danee1d
As I said yesterday, disabling the virtual network adaptors made mcStudio start, and after enabling them again mcStudio kept working.
@kersing @veleek does mcStudio keep working for you if you enable the virtual adaptors again?Like

kristofferis
kristofferis1d
I also have VMware Network Adapter VMnet1 and VMNet8 but i have no issue when i start mcStudio but i am using Windows 7.Like

kersing
kersing1d
@danee, no after enabling the adapters McStudio stops showing the user interface.Like

veleek
veleek19h
@danee, Nope, when I re-enable the one specific adapter, restarting mcStudio gives me the same failure.Like

mcJohn
mcJohnAdmin19h
I have an idea what it could be. I get a list of adapter IP addresses. See code that I downloaded but I think is correct. It gives me a list of IP addresses. When a physical gateway sends its address over UDP I send my address for the correct sub-net mask back. The the gateway connect to it. This solved problems for people with multiple adapters. Because the virtual gateway follows the same procedure it should work but I found that I took a short cut. I always send my first adapter back. There is even a comment that said that we are listing on all adapters so subnet mask is not a problem. Wel maybe it is. If the virtual gateway does not show up the form is not displayed because the program works not without a virtual GW Three other threads are created by then so this looks like our problem.
I will change the code in the next version (available within a few weeks) and if the gateway does not show up within a few seconds I will give a better error message with additional information. CaptureLike
19h
Must be available within a few daysLike

Share on Facebook Share on Twitter