jakubovic / open-phd-guiding

Automatically exported from code.google.com/p/open-phd-guiding
0 stars 0 forks source link

Current trunk have bug with new errormsg while enumerate ASCOM Profiles #365

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Get Latest version
2. compile
3. run without equitment connected

ScopeASCOM::EnumAscomScopes() crashes, because there will be NULL-Pointer 
(0xCCCCCC) going into the varg-printf Statements for error-msg if no equitment 
connected.

With r1265 there is no Problem, so i think it's within r1266 changes of the new 
errormsg with ASCOM scopes.

regards,
Bjoern
bjoern.albrecht@baslerweb.com

Original issue reported on code.google.com by balbre...@bmasoft.de on 13 Nov 2014 at 9:36

GoogleCodeExporter commented 9 years ago
Hi Bjoern,

I am unable to reproduce this. Can you tell me specifically where in 
EnumAscomScopes() you saw the crash?

Thanks,
Andy

Original comment by andy.gal...@gmail.com on 13 Nov 2014 at 6:45

GoogleCodeExporter commented 9 years ago
just create a build on a fresh PC from trunk:
- if you start the debug build,in the gearDialog::Initialize() it calls List() 
and within it EnumAscomScopes()
- Within it it calls profile.Create(L"ASCOM.Utilities.Profile")
- In the bool DispatchObj::Create(OLECHAR *progid) it calls:
if (FAILED(CLSIDFromProgID(progid, &clsid)))
        return false;

At my PC it return false, and the clsid is set to clsid = 
{00000000-0000-0000-0000-000000000000}

Then it wants to throw an error:
            throw ERROR_INFO("ASCOM Camera: could not instantiate ASCOM profile class: " + ExcepMsg(profile.Excep()));

but Profile.Excep() is empty...

Then you want to Format the log/error-string with:
static wxString ExcepMsg(const EXCEPINFO& excep)
{
    return wxString::Format("(%s) %s", excep.bstrSource, excep.bstrDescription);
}

and bstrSource and bstrDescription is both 0xCCCCCCC, so it throws an Access 
Violation error and terminates...

Hope that helps to reproduce?
My Workstations are Windows 7 Ultimate 64Bit, i compile with Visual Studio 2013 
Prof.

I have reproduced it with two different machines.
If i go back to r1265 everything works - so i think, your new errorhandling 
doesn't fit to all situations ;-)

best regards,
Bjoern

Original comment by balbre...@bmasoft.de on 13 Nov 2014 at 8:15

GoogleCodeExporter commented 9 years ago
Hi Bjoern,

Thanks for the information. I believe this is a duplicate of Issue 364.  Just 
to confirm, can you tell me whether you have ASCOM installed?

Thanks,
Andy

Original comment by andy.gal...@gmail.com on 13 Nov 2014 at 9:49

GoogleCodeExporter commented 9 years ago
I have no ASCOM installed (and i think, if you want to do the user, it should 
be mentioned in the wiki or in the WinLibs Folder *g*)

But i think also, we should avoid this Kind of critical exception by having 
always initiated values in the "Profile.Excep"? (if they are NULL, the 
errormessage of course would be also an Msg like "() " ;-)
So perhaps it makes sense to look, where the Excep should be filled in this 
case of error?

best regards,
Bjoern

Original comment by balbre...@bmasoft.de on 14 Nov 2014 at 6:49

GoogleCodeExporter commented 9 years ago
Thanks, Bjoern.

No, ASCOM is not a prerequisite. The crash is a bug, pure and simple.

This is a dup of issue #364 which was recently fixed, so if you svn update you 
should be able to proceed (no need to install ASCOM!)

Original comment by andy.gal...@gmail.com on 14 Nov 2014 at 6:53

GoogleCodeExporter commented 9 years ago
Verified:
r1276 fixed it with the "static" Log-Msg :-)

Original comment by balbre...@bmasoft.de on 14 Nov 2014 at 6:57