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

Firebird service crashes when stopping [CORE5516] #5785

Closed
firebird-issue-importer opened this issue Apr 10, 2017 · 4 comments
Closed

Firebird service crashes when stopping [CORE5516] #5785

firebird-issue-importer opened this issue Apr 10, 2017 · 4 comments

Comments

@firebird-issue-importer

Submitted by: Albertas Vyšniauskas (thezbyg)

When stopping Firebird service from Windows service manager, Firebird process crashes and an unexpected termination error is displayed.
The following Windows system log entry is produced:
The Firebird Server - FirebirdServer3.0 service terminated unexpectedly. It has done this 1 time(s).

In header src/remote/os/win32/wnet_proto.h WNET_connect is declared as a C function by using extern "C", but other code expects exceptions to be raised from that function.

For example, in file src\remote\server\os\win32\srvr_w32.cpp:
try
{
port = WNET_connect(protocol_wnet, NULL, server_flag, NULL);
}
catch (const Exception& ex)
{
SimpleStatusVector<> status_vector;
ex.stuffException(status_vector);
if (status_vector[1] == isc_net_server_shutdown)
break;
iscLogException("WNET_connect", ex);
}

As far as I understand, C functions marked should not throw exceptions, because it triggers undefined behavior.

I fixed this crash by deleting extern "C" from src/remote/os/win32/wnet_proto.h header file, but I am not sure if this fix is acceptable, because I do not know the reason why extern "C" is used in that file.

Commits: de09fa3 e182592

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 17, 2017

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 17, 2017

Commented by: @hvlad

Agree - WNET_xxx functions should not be declared as C functions.
While i can't reproduce a bug i committed proposed change.
Thank you.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 17, 2017

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

Fix Version: 3.0.3 [ 10810 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 17, 2017

Modified by: @pavel-zotov

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

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
Development

No branches or pull requests

2 participants