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

Do not correct exit applications with embedded server [CORE2679] #3082

Closed
firebird-issue-importer opened this issue Oct 13, 2009 · 22 comments
Closed

Comments

@firebird-issue-importer

Submitted by: @tonal

Attachments:
embeded.txt

Votes: 2

After run and exit WinDBG show 2 threads:

Thread 000:1138
WARNING: Stack unwind information not available. Following frames may be wrong.
00 ntdll!KiFastSystemCallRet
01 fbclient!THD_sleep+0xd (FPO: [1,0,0]) (CONV: cdecl)
02 fbclient!delete_process+0x5c (FPO: [0,0,0]) (CONV: cdecl)
03 fbclient!exit_handler+0x28 (FPO: [1,20,4]) (CONV: cdecl)
04 fbclient!gds__cleanup+0x29 (FPO: [0,0,0]) (CONV: cdecl)
05 fbclient!_CRT_INIT+0x167 (FPO: [3,0,0]) (CONV: stdcall)
06 fbclient!__DllMainCRTStartup+0xb7 (FPO: [Non-Fpo]) (CONV: cdecl)
07 fbclient!_DllMainCRTStartup+0x1d (FPO: [3,0,0]) (CONV: stdcall)
08 ntdll!RtlQueryInformationActivationContext+0x19f
09 ntdll!RtlExitUserProcess+0xe6
0a ntdll!RtlExitUserProcess+0x68
0b kernel32!ExitProcess+0x15
0c MSVCR90!amsg_exit+0x75
0d MSVCR90!get_pgmptr+0x196
0e MSVCR90!exit+0x11
0f PYTHON26!Py_Exit+0xf
10 PYTHON26!PyErr_PrintEx+0x22
11 PYTHON26!PyErr_Print+0xd
12 image00400000+0x1b39
13 image00400000+0x1bf5

Thread 001:1158:
WARNING: Stack unwind information not available. Following frames may be wrong.
00 ntdll!DbgBreakPoint
01 kernel32!BaseThreadInitThunk+0x12
02 ntdll!RtlInitializeExceptionChain+0x63
03 ntdll!RtlInitializeExceptionChain+0x36

Commits: 7d1ac11

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 13, 2009

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 13, 2009

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 3, 2009

Commented by: Davide Angeli (aaangeli)

I've got the same problem using the embedded 2.1.3 version in a win32 application written with Delphi. The application remains always in memory with a couple of threads still working. With version 2.1.2 there is no problem.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 9, 2010

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.1.4 [ 10361 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 9, 2010

Modified by: @hvlad

Version: 2.1.4 [ 10361 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 26, 2010

Commented by: Henri Gourvest (hgourvest)

the problem still occur on "Windows Embedded POSReady ".

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 26, 2010

Modified by: Henri Gourvest (hgourvest)

Attachment: embeded.txt [ 11691 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 26, 2010

Commented by: @hvlad

Henri,

why do you think it is the same issue ?

Are you run latest snapshot of 2.1.4 ?

I can said almost nothing lookng at your embedded.txt.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 26, 2010

Commented by: Antti Nivala (nivant)

Hi,

This looks like a potentially serious issue for us given that we are using Firebird Embedded in a Win32 application. We are currently using version 2.1.2 and considering updating to 2.1.3. I would like to know the following:

1. This seems to be a 2.1.3 issue only, and 2.1.2 does not seem to have the same problem. Is this correct?

2. Can this deadlock occur in the process exit stage after "normal use", or does it require some special circumstances such as using some specific API calls?

3. Do you recommend staying with 2.1.2 and going directly to 2.1.4 once it is available, in order to avoid this issue?

I'm posting these questions as a comment in Tracker because the information is probably useful to others, too.

-Antti

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 26, 2010

Commented by: @hvlad

1. Correct
2. It is related to the events usage. If your application not used events then its not affected by this bug.
3. If you not used events - try 2.1.3. Else you can try 2.1.4 - either wait for final release or use current snapshot build. Careful testing will not harm, as usual ;)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 27, 2010

Commented by: Henri Gourvest (hgourvest)

Vlad,

> why do you think it is the same issue ?
The problem occur when activating events and closing application using the embedded version.
It look like something related to this report.

> Are you run latest snapshot of 2.1.4 ?
yes, same problem in 2.1.3

it work fine on windows XP but fail on WEPOS.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 27, 2010

Commented by: @hvlad

> it work fine on windows XP but fail on WEPOS.
Could you provide process dump at point where it hungs ?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 27, 2010

Commented by: Antti Nivala (nivant)

Many thanks, Vlad!

As far as I understand, we don't use events in our application. I'm assuming that "using events" refers to the SQL commands such as EVENT INIT, EVENT WAIT, POST_EVENT and the API calls such as isc_event_block, isc_wait_for_event, isc_que_events. We don't use any of these so it seems this bug wouldn't affect us.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 27, 2010

Commented by: Henri Gourvest (hgourvest)

I uploaded the dump file here:
http://www.megaupload.com/?d=0H5FLFHA

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2010

Commented by: @hvlad

Henri,

What exact build of Firebird did you used when produced dump ?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2010

Commented by: Henri Gourvest (hgourvest)

Vlad,

2.1.4.18314
found here:
http://firebirdsql.org/download/snapshot_builds/win/2.1/

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2010

Commented by: @hvlad

Snapshots was refreshed and i can't match your dump with current binaries.
Create new dump or upload fbclient.dll and fbclient.pdb (both renamed from fbembed.*) for me, please.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 29, 2010

Commented by: Henri Gourvest (hgourvest)

Vlad,

This is
- the mini and full dump files
- corresponding firebird binaries and pdb
http://www.megaupload.com/?d=168KOPU5

thanks

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 29, 2010

Commented by: @hvlad

It seems Windows Embedded not terminated secondary threads when process exits and DLL's is unloaded.
Make sure that :
a) you canceled all events before detach
b) you detached from all databases before application exits
c) try to unload fbembed.dll explicitly before application exits (if you loaded it using LoadLibrary() API)

Engine performs cleanup at DLLMain() call and no threads syncronization is allowed at this time.
In Firebird 2.5 we have special new fb_shutdown() API which performs all necessary cleanup of the engine and application should call it before exit.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 4, 2011

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 12, 2016

Modified by: @pavel-zotov

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

QA Status: No test => Cannot be tested

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