mc-Things

mc-Products => mc-Studio => Topic started by: ashesman on February 14, 2017, 03:46:46 pm

Title: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 03:46:46 pm
Hi,

Sorry to make my first post a complaint!  What are the plans to improve mc-studio?  At the moment it is destroying my budget due to constantly crashing in many different ways!  Is there a new release or beta version available that may fix even some of these?

Here are some of the crashes I have seen so far:

- Access violation on opening a project
- "Cant read data from device" when stepping through the code.  Then need to restart debugging.
- If a crash happens during debugging while the device (mod120) was stopped at a break point it becomes useless and has to be power cycled.
- Turn power off to mod120 and ms-studio crasheswith a "mcSript has stopped working" windows message.
- Sometimes when trying to run I get a "Restart failed" message.
- Sometimes when trying to run code that has not changed since last time I debugged it I get "Can't set breakpoints"
- Sometimes when stopping debugging I get "Stop debugging failed"

I dont think these issues are related to connection problem or wireless issues, or my code!  All the other devices we have are talking nicely and I can always connect to the mod120 in the Devices screen, it is never not there.

Honestly I cannot use this IDE for longer than five minutes without one kind of crash or another!

Also, please please please implement find functionality!

Sorry!

Ashley
Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 14, 2017, 05:35:27 pm
We are working on mcStudio to get it better and more stable.

One of the things that is very annoying is that the old virtual device, used for debugging, is still active and is not working correctly. You should not use the virtual device. Arithmetic operations problems like dividing by zero and overflow is related to that. The reason that the virtual device is still there is that it is a lot of work to remove it, but it will be removed in the next version.

The problem with the logging file occurs when you try to open mcStudio twice. This can be by choice or because a previous error occurred that left mcStudio running in the background. I this happens please go to task manager and kill the process.

Quote
- If a crash happens during debugging while the device (mod120) was stopped at a break point it becomes useless and has to be power cycled.
I have never seen that error so I will add it to the list.

Quote
- Sometimes when trying to run I get a "Restart failed" message.
- Sometimes when trying to run code that has not changed since last time I debugged it I get "Can't set breakpoints"
- Sometimes when stopping debugging I get "Stop debugging failed"
All those cases are related to losing the connection. If the module is close to the gateway this means in almost all cases that the module resets. The most common cause is running out of memory. If that happens the module will reset.  Don't forget the modules have very limited resources and cannot handle every problem.

Quote
Also, please please please implement find functionality!
I suppose you mean Find in Documents Ctrl+F is not implemented. Most people use the Find: in the toolbar. It colors the text and with F3 and Shift-F3 you can navigate. See attachment. There "st" is typed into the Find box and all text containing st is highlighted. With mach case and Whole word you can control the type of searching.

Also in the script manual is a complete list of the short cuts if you want to use them.

Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 06:12:11 pm
Also, File Save As does not seem to work correctly.  The file is saved but the current file name does not update and then code editing area just ends up blank.

If you move a projects file system location you get the first error shown below.  After that you are screwed as every time you try open mc-studio it tries to reopen the project from the new location and crashes!  Now I cant open mc-studio at all!!!
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 07:36:41 pm
More problems: 

If I try open a project I get the exception attached.  If I go into the project and change the %20 used for the space in the file name to an actual space the project will open fine.  Unfortunately every time the project file is saved it returns to the same problem.

<?xml version="1.0" encoding="utf-8"?>
<ProjectSetting xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ProjectName>CLH Scales</ProjectName>
  <DeviceType>mcMod120</DeviceType>
  <LastDocumentName>CLH%20Scales.mcScript</LastDocumentName>
  <DocumentSettings>
    <DocumentSetting>
      <Name>CLH HX711 Weight</Name>
      <FileSpec>CLH%20Scales.mcScript</FileSpec>
      <Row>11</Row>
      <Col>17</Col>
      <BreakPointLineNumbers />
    </DocumentSetting>
  </DocumentSettings>
  <ManualCompile>false</ManualCompile>
</ProjectSetting>
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 09:25:26 pm
Also, if stop debugging fails, which it often does, then you can never get back to editing code.  It stays in debug mode forever as every time you click stop it fails...  There seems to be no timeout or forcing back to editing mode.  Only way out is to shut mc-studio and restart (after editing your project file as per my previous post).

Edit:  I did however notice that if you click run it will say run failed and then go back to editing mode!
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 09:30:27 pm
And another one for you after clicking run after successfully connecting to my real device in the device window.  Seems to still think it is using a virtual device.  (see attached)

Why does it default back to the virtual device when it loses your real device.  How confusing and misleading!
Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 14, 2017, 09:36:10 pm
I found in source control that I solved that problem. And yes %20 is translated to a single space.
The error in the attachment indicates that it searches for the file with %2520. I googled the problem and it is the result for a uri translation. It needs to translate twice to get into this situation.

I will look into the problem and will add code to replace the characters and all other exception, because there are more characters like  + _& etc.
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 09:36:27 pm
After freshly starting mc-studio, then connecting to my device.  I got the attached error.  I have been debugging on this device for an hour now and just saw this for the first time...
Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 14, 2017, 10:05:56 pm
Quote
Why does it default back to the virtual device when it loses your real device. 
I know that it is a problem as described in my previous answer. See below
Quote
The reason that the virtual device is still there is that it is a lot of work to remove it, but it will be removed in the next version.

Quote
It stays in debug mode forever as every time you click stop it fails...
Because mcStudio does not know in what state it is. There is a timeout of 5 seconds if a function fails but the mode does not change

Quote
I have been debugging on this device for an hour now and just saw this for the first time...
In almost all cases this means that the device is not reacting. Loading code is retried 5 times per 128 bytes.
I don't know why it is doing that but it could be that the spectrum is very full or jammed.



Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 14, 2017, 10:08:04 pm
I dot think RF problems.  We have many of these running now and they work fine once they are programmed.  Also, restarting mc-studio always fixes the problem so probably not RF related...
Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 14, 2017, 10:47:44 pm
Some information about the space problem.

I knew that I solved the problem with the space because it was in source control. It is now a different problem because spaces (and %20) are now translated to %2520 as you showed in the attachment. I really wanted to find the problem and after googling for an hour I found the problem. Previous versions of mcStudio are build on .Net framework version V4.0. The last version is build against a higher .Net version and the URI functions that are used are changed. See https://msdn.microsoft.com/en-us/library/hh367887(v=vs.110).aspx

Very tricky, anyway I will have it solved in the next version. For now just remove the space form the filename and it will work fine.


Title: Re: Mc-studio is seriously unstable!
Post by: Bartw on February 15, 2017, 05:01:35 am
I often get this crash when i am trying to connect to a Mc205

Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 15, 2017, 10:15:29 am
Are you using a windows on a Mac or a Windows PC?
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 15, 2017, 01:11:56 pm
Windows PC (and so is Bartw).  Running Windows 10.
Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 16, 2017, 01:01:16 am
Thanks. The Macs have a lot of issues with the FTDI drivers, that's why I asked.

I can only recreate this by removing the USB cable when writing. The driver just returns a FT_IO_ERROR. Looked into the FTDI documentation and that is not very clear. I have seen this problem in the past when there are ground loops. I worked for a company that has bought an opto-isolated USB hub to solve a number of disconnecting problems with devices with FTDI chips. That helped a lot. Also look at the quality of the cable, some cheap cables are not copper but iron with a copper  layer. (Test with a magnet)

It difficult to find that problem from here because I don't have any idea what this can be. Best thing do is check for ground loops and connect the device direct to the computer without a hub, so the quality of the hub is removed from the equation.

Sorry that I can give you a more clear answer.
Title: Re: Mc-studio is seriously unstable!
Post by: ashesman on February 16, 2017, 01:28:52 pm
My take on all this is that while I don't want to tell you how to write your software, but handling all exceptions gracefully and never letting the IDE get into a state where it has to be restarted, or crashes on a catchable situation would be a good thing.

Nearly all issues I saw were related to doing things that could have a clean solution.  If it loses connection to the device during debugging, don't get stuck forever, give the user the option to end the debugging session.

Cant open a file at startup, check for a null file handle before using it and start the IDE without opening a file with an error message.  But I am sure you guys already know all this stuff!!!

Cheers

Ashley


Title: Re: Mc-studio is seriously unstable!
Post by: mc-John on February 17, 2017, 12:08:35 pm
Yes we know but it is all a question of time and priority. There is actually a lot of error handling in the app but the multi threading makes it complex. The sheer size of the application does not help either.

Anyway we appreciate all user input, bug reports and proposals for improvements. Based on the comments we have changed the Find behavior. The current behavior is not very clear because Ctrl+F should be "Find" and not "Find in Documents". So the next version will assign Ctrl+Shift+F to "Find in Documents" and Ctrl+F "Find" brings you to the find text box and if there is text in the edit form selected it will copy copies selected text in that box. That text is than highlighted in the edit window and you can search forward and backward. The Find and Replace in Documents is now higher on the priority list. 

Thanks

John
Title: Re: Mc-studio is seriously unstable!
Post by: kbrooking on February 19, 2017, 04:05:31 pm
Yep, I feel the same way as the subject line. When it works its great. But, sometimes it seems I spend more time an energy trying to work around the bugs than I do on testing. Sometimes it takes so long to get a few test iterations working that I forget what I was testing.  :'(. However, I feel this platform has so much to offer that I'm sticking with it. Eventually the bugs will be resolved and be more stable for testing/debugging.
Title: Re: Mc-studio is seriously unstable!
Post by: guest103 on February 23, 2017, 11:00:12 pm
My take on all this is that while I don't want to tell you how to write your software, but handling all exceptions gracefully and never letting the IDE get into a state where it has to be restarted, or crashes on a catchable situation would be a good thing.

Nearly all issues I saw were related to doing things that could have a clean solution.  If it loses connection to the device during debugging, don't get stuck forever, give the user the option to end the debugging session.

Cant open a file at startup, check for a null file handle before using it and start the IDE without opening a file with an error message.  But I am sure you guys already know all this stuff!!!

Cheers

Ashley

Hey Ashley,

You're right, and I want to let you know that we just finished adding graceful global exception handling to mcStudio. I'll let you know right here when we do a new release.

- Eric