?
Solved

Help figuring out an application wide bug(Urgent)

Posted on 2005-04-17
23
Medium Priority
?
175 Views
Last Modified: 2010-05-02
I wrote a vb6 app that, well does a lot of things. It is a client based application. A brief overview :

It checks if broadband is available, if so uses that, if not uses modem.
It connects to a central server via vpn/mapped network drive.
It reads from a dm.ini file which tells it what ads to pull from the server.
It then dynamically creates an xml file which a flash player takes and plays the ads.
It runs 24/7, and has update times based on connection type.

My problem is that from time to time the program just hangs and there is no rhyme or reason that I can detect. We have 40 clients in the field and some work for months perfectly and then stop working. And it showed it has connected fine the very last time, disconnected etc.

I am using a timer that ticks every second to control the time. I can only think there is something with the timer.

it checks to see if broadband goes up, it also checks to see if it is a new hour to change the xml file(this is how we control scheduling for different times of the day.

I am open to any and all suggestions. Is there a better way to keep track of time ? Will wrapping the vb6 app around .net help ?(I dont know vb.net though).

We are getting ready to make a huge deal and we cant afford these hickups anymore.

Thank you. please respond soon!
0
Comment
Question by:intertise
  • 8
  • 6
  • 2
  • +2
18 Comments
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13801373
You can use datediff function to do the difference between now and another time, take a look at this :

http://freespace.virgin.net/s.cowan/vbhowto/how_to/mathematical/datediff.html

Not sure if you are using datediff or not already though because I dont see any of the code you have !
Maybe if you post the parts that you think it might be with regards to any coding you have or something along those lines then we could help you out better :)
0
 
LVL 1

Expert Comment

by:mushu999
ID: 13801448
Well. I think we need a lot more info. Does it hang for _everybody_ after the same length of time running, or different length of time running? Can you isolate if the hang is being caused by a hardware issue such as an interrupt conflict - perhaps IRQ sharing problems on a client computer? What version of Windows does everybody use (is it the same for everybody?) and have they _all_ been patched to the latest hotfixes/servicePacks? what other hardware do those "problem children" have attached to their computers?

Somehow, you need to determine if it is only certain users or not, in order to determine if it is a coding bug or a user problem (pebcak) or a hardware issue. Have you ever been able to duplicate the problem on your development box(es)?

In a recent huge (six month) project I did I had a similar bug. I compiled in a "hidden" log file that gets an entry every time a function or procedure was called and exited normally, then I had the client send me that log file back when the program crashed. It showed me what was happening nicely, similar to this pseudocode:

Public Sub Form_Load()
  Open "C:\debug.LOG" For Output As #1: Close #1 'create zero-byte file upon invocation
end sub

public sub main
  call sub1
' ... do stuff
end sub

private sub sub1
  Open "C:\debug.LOG" For Append As #1: Print #1, "private sub sub1 IN": Close #1
' ... do stuff
  Open "C:\debug.LOG" For Append As #1: Print #1, "private sub sub1 OUT": Close #1
end sub

Duplicate the "IN" and "OUT" code in every single sub/fuction you have. Since I immediately close the file after updating it (which forces a buffer flush) you will have a valid marker for the LAST entry and will at least be closer to knowing where in your code the problem lies. Then you can bracket that area with the same type of file debug prints of your variables, and have the client send that next log file to you, etc, etc, until you figure out what the problem is.

Having said all this, and having done years of communications coding, I suspect the issue is in your communications routines, and I assume you are using a third party library for those. I'd contact the support folks and ask them to help also. They might have a component update or a "tester" program you can try.
0
 

Author Comment

by:intertise
ID: 13802327
you are a life saver, right now i'm in the middle of 10 things, but i'll check out what you said.

I'll give you a million points if I can lol.

Please check back later.

Thank you again.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:intertise
ID: 13802343
well let me give you a bit more information.

we are an advertising company. We set up all the machines. They all have the exact same configuration. Windows XP Pro, normal modem/broadband etc etc.

We control the enviornment so it made my job a hell of a lot easier. It happens at, what seems to me to be, completely random intervals. Imagine 50 machines all doing the same thing. Diferent times(based on when we tell it to), but does the exact same thing, exact same version. One runs fine for 5 months and then hangs. One works for three weeks and hangs. And there is nothing I can see that would tel me what the problem is. There is no issue with time, say 12:01am, nor does it have anything to do with one being unique compared to the others. We have been operational for a year now. Obviously there has been many revisions since then, but a location with version 1.3 has worked flawlessly for 1 year, another only worked 4 months before it stopped working.

That being said there were bugs and flaws I found along the way, but what I mean to say is that there seems to me to be no rhyme or reason. It's as if the very last time it downloaded the ads it did it correctly, and when it was supposed to go into sleep mode it died. So that's why I thought it might have something to do with the timer.

This app runs 24 hours a day, and does things at different times. So I always need to know what time it is. Datediff does nothing for that.

And when I say does things at different times, they all do the same thing, just that that one timer controls everything, and based on the scenario it moves forward. It isnt that one is broadband and the other isnt, or what they download, etc...trust me I went through the damn checklist a million times, and there is nothing I can see that would lead me to beleive ah ha! this is it.

Any further suggestions my friend ?
0
 
LVL 1

Expert Comment

by:mushu999
ID: 13802621
Well, still a bit fuzzy on your whole system, but you're slowly giving more and more info...  :)

First off, realize that there _is_ a reason for this behavior and it isn't just "random" or magic. It may be in a completely unrelated area of the entire system and you're simply not aware of it yet...what I mean is, you need to get past the emotion and get back to logic. I suspect your checklist did not include certain areas, either from forgetting about them, or tassuming they had no bearing on your problem. That last one is a fatal mistake, which I frequently do myself. There is a whole area of computer science related to troubleshooting and bug analysis techniques.

The first thing you need is to get _More Information_ from your system. ("system" means the entire kit-and-kaboodle and not just your computer or program. I mean the whole thing, from the desktop box to the phone lines to the broadband lines to the Internet to your server...the whole system.) You absolutely must implement some type of logging system like I suggested above! Without getting any data you will have no way to troubleshoot the process!!

When you say "broadband" do you mean that each computer is at a separate location, geographically separated from your main server, and they connect to the Internet via DSL? Or are they Cable modems? Or are they POTS modems (RJ11 connectors)? Did you or your company write the communications module, or is it from Dart or IPworks or similar third-party company? Have you made sure that _you_ are fully patched and updated through the WindowsUpdate website and also through the office.microsoft.com website? Have you patched your version of Visual Basic 6 to the latest (and now the final) service pack?

Another area is testing for memory leaks. That can also be logged by your program. Grab the free memory, free disk space, and available virtual memory sizes at program launch, then at various intervals during the running of the program. Compare the final (crashed) values with the initial values. If they are significantly more or less then you might have a program in your code or in one of the third-party components you're using in your code.

I hope you understand where I'm trying to go with all this. You need to measure as many aspects of the running system as possible before you have any hope of locating such a wild bug. Oh yeah, one more thing: turn off all optimizations when you compile into a native executable to eliminate that as a potential source of problems. You might even try running it as P-code also -- it will certainly be much smaller in size! (But it runs a bit slower that way.)
0
 
LVL 1

Expert Comment

by:mushu999
ID: 13802625
One more thing: to keep the back-and-forth traffic down, I would appreciate it if you would go back through my prior two posts and answer one-by-one each of my questions in every paragraph. Then we can go from there. Thanks!
0
 

Author Comment

by:intertise
ID: 13802693
I will answer each paragraph. I think a lot of the misconception comes from my explanation. Is there an email I can send you a logic flowchart ? it's in ppt format. I will of course reward you here. In fact from all the things you have said I would do so now.

I think with a little extra bit of knowledge you could be one heck of an asset.

Btw...I have already started doing as you suggested, function wise. I know there is a problem somewhere in my code, I just have had the hardest time finding out where, as you said...I must be missing something.

Thank you again for all your help.
0
 

Author Comment

by:intertise
ID: 13806342
> I assume you are using a third party library for those.
I am using all native built in vb6 functions. I enumerate the network connections and if it is broadband simply connect to vpn.
>When you say "broadband" do you mean that each computer is at a separate location, geographically separated from your >main server, and they connect to the Internet via DSL? Or are they Cable modems?
I mean dsl/cable and modem for dialup geographically seperate locations connecting to a central server specified.
>Did you or your company write the communications module
I wrote the communication module
>Have you made sure that _you_ are fully patched and updated through the WindowsUpdate website.
Since we control all the pc's going out, we patch the systems to the best of anyones ability.
These systems are built specifically for our purpose. No user-end software. Just a windows xp machine patched and my app installed using installshield X.
>Have you patched your version of Visual Basic 6 to the latest (and now the final) service pack
No, but I will.
>Another area is testing for memory leaks.
will do so, and will turn optimization off as well.


0
 

Author Comment

by:intertise
ID: 13808698
I seem to have started noticing a pattern. Can it at all be related to my timer ?

My timer hits once a second...It seems that it connects and does everything correctly, disconnects correctly, and then goes into sleep mode. And then....nothing.

Also, it could also have to do with the timer and midnight ? I've noticed it died sometimes at 11:59:XX.

Iguess I dont understand the concept of Do Events and On Error Resume Next.

Think you can clue me in a bit more. With I could offer more than 500 lol.

Thx.

0
 
LVL 1

Expert Comment

by:mushu999
ID: 13812961
Yes, there are issues with the timer, MS has several knowledgebase articles about it. Any chance you can post your timer code?
0
 

Author Comment

by:intertise
ID: 13927900
sorry I didnt post sooner, will in a few minutes.
0
 
LVL 1

Expert Comment

by:mushu999
ID: 14384187
GPrentice00, what sort of recommendation are you looking for? I would have liked to find out if my comments or code helped this person, but apparently either they figured out the problem on thier own or used ideas from the posts to solve it and never came back. Sigh. Oh well...
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 14405234
Advice and suggestions are good, but it is hard to say that a hard solution would be reached from them without the further input.  Honestly, I was hoping my 'ping' message would wake up the asker and save some trouble...  
Failing a "What it turned out to be was...." its hard to say that a PAQ-search would benefit from assigning an answer to a comment here, but there is very good information here.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14433481
PAQed with no points refunded (of 500)

modulo
Community Support Moderator
0
 
LVL 1

Expert Comment

by:mushu999
ID: 14434237
Who is modulo and why did they get the answer? Just curious, that's all....
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 14436058
He is an admin and he is extremely clever !!!! LOL No J/K , no one answered the question and so the points got refunded and the question got kept because it may be of use for later on or something like that but I am sure it is explained in more detail in the help url that modulo posted above !!
0
 
LVL 1

Expert Comment

by:mushu999
ID: 14451845
Ok, I read the help & after that I read modulos message again and this time saw his signature. Duh.

I'm just thinking that frankly it's not right for EE to "keep" answers for other's future use without compensation. IMO this type of practice will make people less likely to want to help since it is a considerable time investment to attempt to help people. I would have awarded a few points to every person who tried to help, at least.
0
 
LVL 1

Expert Comment

by:mushu999
ID: 14451882
...and to add to my last comment, I have and will help when I think I can offer something useful to the person. It might sound weird, but only in certain instances or with certain questions do I actually want or expect "points" -- in most cases I wouldn't care.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question