Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebird2Control.cpl crashes in Windows 8 [CORE4020] #4351

Closed
firebird-issue-importer opened this issue Dec 29, 2012 · 21 comments
Closed

Firebird2Control.cpl crashes in Windows 8 [CORE4020] #4351

firebird-issue-importer opened this issue Dec 29, 2012 · 21 comments

Comments

@firebird-issue-importer

Submitted by: André Ziegler (andre.ziegler)

Attachments:
callstack and variables.jpg
screenshot-1.jpg
screenshot-2.jpg

Under Windows 8, the Firebird2Control.cpl crashes all the time, so it is not possible to manage the Firebird settings.

Debugging it, shows that the crash occurs in fbpanel.cpp, line 55:

pInfo->dwSize = sizeof(NEWCPLINFO); // important

and I don't understand why sizeof causes an access violation.

Commits: 71ac4c2 ed8c087 d948dff FirebirdSQL/fbt-repository@7150e60 FirebirdSQL/fbt-repository@21c08a0

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 31, 2012

Modified by: André Ziegler (andre.ziegler)

Attachment: callstack and variables.jpg [ 12273 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 4, 2013

Commented by: @reevespaul

Thanks for the report. I'll look into it.

But I don't think this is critical. The applet doesn't open and an error is logged.

In the meantime you can use instsvc from the command-line.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 4, 2013

Modified by: @reevespaul

assignee: Paul Reeves [ paul_reeves ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 4, 2013

Modified by: @reevespaul

priority: Critical [ 2 ] => Minor [ 4 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 6, 2013

Commented by: André Ziegler (andre.ziegler)

it also happens with the trunk version (see second attachment). And I think minor is too low. For users who don't know how to change the settings, this is an issue which impact them.

Also the Stability Report with Reliability Monitor (action center) reduces at the users only see rundll32.exe crashes and think they have windows bugs.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 6, 2013

Modified by: André Ziegler (andre.ziegler)

Attachment: screenshot-1.jpg [ 12275 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2013

Commented by: @reevespaul

Actually I think this is a windows bug :-)

Somewhere along the line MS changed the cpl applet api. The implementation of OnAcquire was changed and a new method OnNewAcquire was added which takes the same parameters as the old OnAcquire. OnAcquire now takes CPLINFO instead of NEWCPLINFO.

Obviously previous versions of windows managed to work with legacy implementations of the cpl applet interface and now W8 doesn't.

At least, that is my current hypothesis. But it beats me why sizeof() fails here.

Anyway be assured we will get this fixed before the next release of 2.5.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2013

Commented by: André Ziegler (andre.ziegler)

it is a bug in the firebird code.

Andrew Richards from MSFT (http://blogs.msdn.com/b/andrew_richards/) found the cause. The declaration of the function CControlPanel::CPlApplet has a bug. The lparams are declared as LONG, but they had to be declared as LPARAM. The long causes a truncation of the data and this causes the access violation. The fix is to change the function to this:

LONG APIENTRY CControlPanel::CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)

Now I can run it without any issue.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2013

Commented by: André Ziegler (andre.ziegler)

working CPL in WIndows 8

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 7, 2013

Modified by: André Ziegler (andre.ziegler)

Attachment: screenshot-2.jpg [ 12276 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 8, 2013

Commented by: @reevespaul

LPARAM seems to have fixed the problem.

Thanks André.

Still not sure why this problem has only just appeared, though. Logically the x64 applet builds for XP, W2K3,W2K8 and W7 should all fail too.

Anyway, here is the reason for the problem:

// ----- Extract from CPL.H --------

//typedef LRESULT (APIENTRY *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
typedef LONG (APIENTRY *APPLET_PROC)(HWND hwndCpl, UINT msg, LONG lParam1, LONG lParam2);

// ----- End extract. -------------------

This file is from VC6, unmodified, AFAICT, and dated 24 April 1998. The original firebird cpl applet was built with VC6 for (I think) Fb 1.0, or perhaps 1.5. Anyway it was based on some stub code for cpl applets and, judging by a brief google search, this is not the only cpl applet to carry this legacy code.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 8, 2013

Commented by: André Ziegler (andre.ziegler)

I'm not sure why it now fails. Andrew told me something about changes in Memory layout (ASLR, LFH) in Windows 8. This triggered this bug.

I've checked the oldest CPL.h I can find on my Win7 is from 2006 (C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include) and also shows lparam.

Btw, the code also contains other dead parts (other oninquire function that is never called). And can you also include the Firebird2Control.pdb inside the official debug files?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 8, 2013

Commented by: André Ziegler (andre.ziegler)

ok, I see it is fixed in the 2.5 branch :) The trunk is also effected. Can you fix it there, too?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2014

Commented by: André Ziegler (andre.ziegler)

will this fix be part of Firebird 2.5.3?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 17, 2014

Commented by: @reevespaul

Yes - it will be automatically included when the branch is tagged for the next release. In any case we always do at least one release candidate before final release so there will be time to double check.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Dec 8, 2014

Commented by: André Ziegler (andre.ziegler)

ok, it seams to be part of 2.5.3, but the PDB is missing for Firebird2Control.cpl in Firebird-2.5.3.26780-0_x64_pdb.zip. Hopefully I don't get a crash again for the Firebird2Control.cpl

I created a request to host a symbol server to get them easier:

CORE4635

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 23, 2015

Commented by: André Ziegler (andre.ziegler)

the issue is fixed and the CPL also works in Windows 10. Set the status as "fixed" to indicate that it now works.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 4, 2015

Commented by: Sean Leyne (seanleyne)

Andre has commented that the issue is fixed.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 4, 2015

Modified by: Sean Leyne (seanleyne)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.5 [ 10670 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 12, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Cannot be tested

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 22, 2015

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants