Please login or register.

Login with username, password and session length

Author Topic: ahcmd random crash  (Read 32519 times)

russh

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
ahcmd random crash
« on: June 14, 2006, 04:46:34 PM »

I'm trying to use ahcmd to control automation in a greenhouse.  unfortunately, ahcmd will randomly crash - with the dialog asking if i want to notify microsoft of the crash.  these are the details of the message:

AppName: ahcmd.exe    AppVer: 0.0.0.0    ModName: ole32.dll
ModVer: 5.1.2600.2726    Offset: 00120f57

I see that the actual offending code is in ole32.dll - so probably out of the control of the active home / ahcmd developer?  Am wondering if it's possible to get past this problem by directly linking the appropriate library into the ahcmd program rather than relying on the dll? or is there a more suitable version of ole32.dll that I should try to locate?

thanx
r
Logged

admeeral

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 15
Re: ahcmd random crash
« Reply #1 on: June 14, 2006, 05:12:06 PM »

This is the same problem that I reported.  It occurs in OLE32 but probably is triggered by an error in earlier code.  It appears to be that the software is trying to write to an unallocated memory location.

Admeeral
Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: ahcmd random crash
« Reply #2 on: June 14, 2006, 05:19:28 PM »

Firstly, achmd is not a Windows executable and can only be run from a Command or DOS prompt.  The syntax is achmd sendplc (send powerline control) [Housecode] on, (off, dim %, etc.)

It cannot be run by through the SDK, either.
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

russh

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: ahcmd random crash
« Reply #3 on: June 14, 2006, 05:46:14 PM »

OK well, maybee i didn't make it clear that i was running it from a dos prompt in a dos command window.
and I wasn't attempting to run the sdk either - i was running the ahcmd.exe that comes w/ the sdk.
When i mention "random" crash - this means that sometimes it works - actually - it works probably 70-80% of the time.  I'm pretty sure i've got the syntax correct since it actually works *most* of the time. and since it works *most* of the time, that makes me believe that i've probably got all the miscellaneous supporting stuff in place correctly.
The problem is that it randomly crashes, and the error message i reported in the first post is the error message associated with the crash.
I'm trying to find ways to help this little program run *all* the time - can anyone help with that?
Since the error message tells me that the actual module that's crashing is ole32.dll, which, i believe, is a microsoft dll, and this dll is associated with late (run-time) binding of external libraries and other objects, that possibly by compiling the ahcmd so that it doesn't use late binding, but rather actually links the library at compile time, this would circumvent the use of ole32.dll altogether, possibly circumventing the crash.  just a theory, and of course that means that somehow i'd need to get my hands on the correct library.
Alternatively, it occurred to me that possibly the ole32.dll that ahcmd runs successfully under is some particular version, and if so, then knowing what that version is might solve the problem.
thanx
r
Logged

admeeral

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 15
Re: ahcmd random crash
« Reply #4 on: June 15, 2006, 07:50:27 AM »

Dan Lawrence,

It does not matter whether you run ahcmd in a DOS window, or whether you embed the code into windows code - you get the same crash.

The call invokes the same DLL calls so your remark is misleading.

Since the crash occurs intermittently it may have to do with error handling within the SDK code.

Why don't you set up a test to just repeatively call the ahscript function within the debug and get the error.  If you have the

souce code it will point to the problem.  I do not have this code so I cannot do this.

Admeeral
Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: ahcmd random crash
« Reply #5 on: June 15, 2006, 08:18:34 AM »

I run achmd through the Command Prompt, and it NEVER crashes.

Occasionally a Windows error dialog box pops up, I simply close it.  Sendin error reports to Microsoft is a waste of time, they never reply or acknowledge them.

Every time I ever tried to run it through Windows, it would crash.
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

admeeral

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 15
Re: ahcmd random crash
« Reply #6 on: June 15, 2006, 11:05:31 AM »

I don't know what never means!   My estimate is that it about 1 in 80.
I will put a count in my system to get some statistics.

If a error message box comes up in an automated system that is an unacceptable error.  No one is around to close it!

I seriously doubt that the problem is in OLE32 - Microsoft tests very well.

Denying that there is a problem is the major reason that problems don't get fixed.
That comes from 49 years of programming experience.  Hope I make it to 50.

Admeeral
Logged

russh

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: ahcmd random crash
« Reply #7 on: June 15, 2006, 11:42:24 AM »

Dan - this is crazy!!!

on line 1 you say: "I run achmd through the Command Prompt, and it NEVER crashes."
and then on line 2 you say: "Occasionally a Windows error dialog box pops up, I simply close it.  Sendin error reports to Microsoft is a waste of time, they never reply or acknowledge them."

well, what do you think that error dialog box represents? - its a ... *crash*!  prior to XP, you would have seen the "blue screen of death" - if you took the time to click on the "details" link in that dialog, you'd see probably exactly the same problem i started this thread with.

*that* is the problem i'm trying to address.  Admeeral is completely correct - an automation system that crashes is an anathema to the whole notion of automation.  what good is an automated system if you must check it every time it runs to make sure it didn't crash?  you might as well just dispense with the automation and go there and do the job yourself manually.

So - to recap, in your post, you admit that ahcmd *does* randomly crash - *in your own personal experience*.  Will you or whoever has the skills and access please help us find a way to make it *not* crash?  I'm not asking for full access to anyone's code, not asking that you (or whoever) go in and find that bug and fix it (altho that would be a good idea) - merely make the appropriate library available so that it can be linked into the executable - thereby (hopefully) getting around this particular problem.

thanx
r
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: ahcmd random crash
« Reply #8 on: June 15, 2006, 10:14:53 PM »

russh,

Not knowing how your program works, I don't know if this will be helpful, but here I go anyway.  ;)

Could your program call a windows script like JScript or VBScript?  If so, you can bypass ahcmd by writing a script that uses the COM automation object "X10.ActiveHome".  For an example in JScript, download my program BXVC at:
http://www.wgjohns.com/bxvc.htm
(you don't need to download the voice engine or the full version if you don't actually want to run it).
BXVC is written as a HTA (hypertext application).  Just open the .hta file in notepad or wordpad to see the code.

Hope this helps,
-Bill-
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

russh

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: ahcmd random crash
« Reply #9 on: June 16, 2006, 01:24:44 AM »

Hi Bill
Thanx a bunch! - I breezed right past the samples when i originally got the sdk.
built a little vb program that does sendPLC for me, just tested it & it ran 100 times in succession without fail.
I pretty much just cloned the one activehomeVB example.
Unfortunately my x10 stuff is strictly about hands-off automation - as in controlling the hardware in a greenhouse, so your really cool voice-activated stuff is not for me right now, but it sounds great.
Hey Admeeral - can you figure this approach out? - if not let me know & i'll try to help.
r
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: ahcmd random crash
« Reply #10 on: June 16, 2006, 01:32:53 AM »

russh,

Glad I could help  ???  or at least point you in a better direction!  :)

-Bill-
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

admeeral

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 15
Re: ahcmd random crash
« Reply #11 on: June 16, 2006, 09:53:38 AM »

Thanks for your input Bill.

The SDK is defective and I was hoping that the originator would recognise that fact and fix the problem.
I just wish people would test their software adequately before releasing it.  A simple program to excercise all the command
options and run for 100,000 cycles would be real easy to do.

I have a temprary work around for my system
I invoke ahcmd from my program and do not wait for completion.
Every time it croaks it leaves behind an unclosed DOS window.  The program continues.
UGLY but will work for awhile.

I'll try your approach as soon as I get a chance.

admeeral
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.