Issue 6289 - CARS service crashes when stopping in windows
Summary: CARS service crashes when stopping in windows
Status: VERIFIED WORKSFORME
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.16
Hardware: All All
: Low normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-11 11:00 UTC by binoyme@gmail.com
Modified: 2021-07-23 13:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description binoyme@gmail.com 2009-09-11 11:00:03 UTC
Full_Name: Binoy Joseph
Version: 2.4.16
OS: Windows XP
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (210.210.79.19)


Hi,
I compiled OpenLDAP 2.4.16 in Windows and installed it as a service. It starts
successfully. But when I stop the service, slapd stops, but a Windows
Application error (unknown software exception) is thrown and the service does
not respond.

I commented the last line in daemon.c and it works fine.

slap_sig_shutdown( int sig )
{
  ..
  //(void) SIGNAL_REINSTALL( sig, slap_sig_shutdown );
}

Also, another doubt. The value of sig is always -1 here. Shouldn't it one of
these: SIG_DFL, SIG_ERR, SIGINT, SIGTERM... ?

Is it already fixed in the subsequent releases?
Comment 1 Hallvard Furuseth 2009-09-11 21:20:29 UTC
moved from Incoming to Software Bugs
Comment 2 Hallvard Furuseth 2009-09-11 21:21:02 UTC
binoy@cordys.com writes:
> slap_sig_shutdown( int sig )
> {
>   ..
>   //(void) SIGNAL_REINSTALL( sig, slap_sig_shutdown );
> }
> 
> Also, another doubt. The value of sig is always -1 here. Shouldn't it one of
> these: SIG_DFL, SIG_ERR, SIGINT, SIGTERM... ?

Actually no.  slapd/main.c does
  lutil_CommenceStartupProcessing( serverName, slap_sig_shutdown );
which causes liblutil/ntservice.c:lutil_ServiceCtrlHandler() to call
slap_sig_shutdown(-1).  (The handler is stored in stopfunc.)

Leaving the correction to a committer who knows Windows, but I assume
a minimal fix would be

    if (sig >= 0)
        SIGNAL_REINSTALL( sig, slap_sig_shutdown );

-- 
Hallvard

Comment 3 binoyme@gmail.com 2009-09-12 05:17:53 UTC
It was working earlier with OpenLDAP 2.2. But then we used MS Visual Studio
6 to compile.
Now we are using Visual Studio 2005. Is it anything to do with this?

-- 
Thanks and Regards,
Binoy Joseph
Comment 4 Howard Chu 2021-07-23 12:41:15 UTC
Unable to reproduce. Starting and stopping service works fine, no other events are in the Windows event log.