public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Tons of cygserver errors
@ 2014-04-01 14:25 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-02  8:53 ` Corinna Vinschen
  0 siblings, 1 reply; 11+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-04-01 14:25 UTC (permalink / raw)
  To: cygwin

Hi,

Event Log on my PC is full (literally) of these, recorded every 5 seconds or so, and
usually coming in in pairs (2 of the same, then 5 sec pause, then another 2, and so on)

Could someone please explain what do they mean?  I am not running with Admin
privs (although, cygserver is).  My apps do use SYSV shmem and sems.

The description for Event ID 0 from source cygserver cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

cygserver: PID 1916: cygserver: error getting signal_arrived to server (6)

Thanks,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-01 14:25 Tons of cygserver errors Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-04-02  8:53 ` Corinna Vinschen
  2014-04-02 16:26   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 1 reply; 11+ messages in thread
From: Corinna Vinschen @ 2014-04-02  8:53 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

On Apr  1 14:20, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> Hi,
> 
> Event Log on my PC is full (literally) of these, recorded every 5 seconds or so, and
> usually coming in in pairs (2 of the same, then 5 sec pause, then another 2, and so on)
> 
> Could someone please explain what do they mean?  I am not running with Admin
> privs (although, cygserver is).  My apps do use SYSV shmem and sems.


For the records:  This:

> The description for Event ID 0 from source cygserver cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
> 
> If the event originated on another computer, the display information had to be saved with the event.
> 
> The following information was included with the event: 

is always the same text and there's really no reason to quote that at
all.  The reason it shows up in the logs is that the Microsoft event
viewer expects to find a pointer to a string resource in some DLL, but
there is none.  The only important part of the log is the freetext
comment added at the end.  This is what the Cygwin application actually
logged:

> cygserver: PID 1916: cygserver: error getting signal_arrived to server (6)

It means the pointer to the "signal_arrived" event object is invalid.
"signal_arrived" is used internally to notify wait functions that a
POSIX signal arrived for the process and to implement EINTR, for
instance.  When you're using XSI IPC functions, the signal_arrived
handle is used in cygserver to make the IPC functions interruptible.
For that, it creates a local copy of signal_arrived using
DuplicateHandle 

For some reason the handle given to cygserver is invalid.  Why, I
have no idea, and your report is missing information, so here we go
again:

  http://cygwin.com/problems.html
  http://cygwin.com/acronyms/#STC


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Tons of cygserver errors
  2014-04-02  8:53 ` Corinna Vinschen
@ 2014-04-02 16:26   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-03  8:28     ` Corinna Vinschen
  0 siblings, 1 reply; 11+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-04-02 16:26 UTC (permalink / raw)
  To: cygwin

> there's really no reason to quote that at all

Maybe, but how would I know that you did not need that?

> It means the pointer to the "signal_arrived" event object is invalid.
> "signal_arrived" is used internally to notify wait functions that a
> POSIX signal arrived for the process and to implement EINTR, for
> instance.  When you're using XSI IPC functions, the signal_arrived
> handle is used in cygserver to make the IPC functions interruptible.
> For that, it creates a local copy of signal_arrived using
> DuplicateHandle
> 
> For some reason the handle given to cygserver is invalid.  Why, I
> have no idea, and your report is missing information, so here we go
> again:

I can’t provide any further information at this point because I do not
understand what and where to look for.  But I have a slight clue that
there is a race in cygserver (and that's not unusual, from my experience).

There is a main process that has sems open / shm attached.  That process
fork()s and exec()s script every now and then.  If the main process
does not spawn any children, there is nothing in the log.  Once it starts
doing that, I see the errors coming in, and in good time correlation with
the spawning schedule.  The spawned processes are very short lived,
merely it's a fork, then exec a shell script with just an exit statement.

I suppose that when cygserver tries to read a handle, the child process
(which by posix rules had inherited the shm and sems, but should have
dropped them altogether at the point of exec()) is already gone, so the
handle is invalid.  Which is why it is the error "6" all way.

How realistic does that sound?

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-02 16:26   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-04-03  8:28     ` Corinna Vinschen
  0 siblings, 0 replies; 11+ messages in thread
From: Corinna Vinschen @ 2014-04-03  8:28 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]

On Apr  2 16:26, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > there's really no reason to quote that at all
> 
> Maybe, but how would I know that you did not need that?

That's why I said "for the records" :)

> > It means the pointer to the "signal_arrived" event object is invalid.
> > "signal_arrived" is used internally to notify wait functions that a
> > POSIX signal arrived for the process and to implement EINTR, for
> > instance.  When you're using XSI IPC functions, the signal_arrived
> > handle is used in cygserver to make the IPC functions interruptible.
> > For that, it creates a local copy of signal_arrived using
> > DuplicateHandle
> > 
> > For some reason the handle given to cygserver is invalid.  Why, I
> > have no idea, and your report is missing information, so here we go
> > again:
> 
> I can’t provide any further information at this point because I do not
> understand what and where to look for.  But I have a slight clue that
> there is a race in cygserver (and that's not unusual, from my experience).
> 
> There is a main process that has sems open / shm attached.  That process
> fork()s and exec()s script every now and then.  If the main process
> does not spawn any children, there is nothing in the log.  Once it starts
> doing that, I see the errors coming in, and in good time correlation with
> the spawning schedule.  The spawned processes are very short lived,
> merely it's a fork, then exec a shell script with just an exit statement.
> 
> I suppose that when cygserver tries to read a handle, the child process
> (which by posix rules had inherited the shm and sems, but should have
> dropped them altogether at the point of exec()) is already gone, so the
> handle is invalid.  Which is why it is the error "6" all way.
> 
> How realistic does that sound?

Still, you're missing the cygcheck log, and a simple testcase would
be helpful.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Tons of cygserver errors
  2014-04-07 11:45   ` Corinna Vinschen
@ 2014-04-07 14:31     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 0 replies; 11+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-04-07 14:31 UTC (permalink / raw)
  To: cygwin

> I created a fix and I'm just building cygwin 1.7.29 with it.

That's a good news, and thanks for the quick fix!  I'll let you
know if the issue is resolved on my end, too.

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-07  9:57 ` Corinna Vinschen
@ 2014-04-07 11:45   ` Corinna Vinschen
  2014-04-07 14:31     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 1 reply; 11+ messages in thread
From: Corinna Vinschen @ 2014-04-07 11:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2134 bytes --]

On Apr  7 11:57, Corinna Vinschen wrote:
> On Apr  5 02:35, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > >> I can’t push this through your list spam filter.  Another attempt...
> > 
> > I was trying a few times, and finally deleted the strace attachment.  Let's see if this will go through.
> > Excuse me for being a bit straightforward, but the spam filter this list is using is *really* stupid!
> > 
> > > Still, you're missing the cygcheck log,
> > 
> > Cygcheck log was attached to an earlier message from today (thread: exe.stackdump is always empty).
> > 
> > > and a simple testcase would be helpful
> > 
> > Here you go:
> > [...]
> > Windows event log immediately recorded 10 new events, like so:
> > 
> > Error	4/4/2014 10:02:34 PM	cygserver	0	None
> > Error	4/4/2014 10:02:33 PM	cygserver	0	None
> > Error	4/4/2014 10:02:32 PM	cygserver	0	None
> > Error	4/4/2014 10:02:31 PM	cygserver	0	None
> > Error	4/4/2014 10:02:30 PM	cygserver	0	None
> > Error	4/4/2014 10:02:29 PM	cygserver	0	None
> > Error	4/4/2014 10:02:28 PM	cygserver	0	None
> > Error	4/4/2014 10:02:27 PM	cygserver	0	None
> > Error	4/4/2014 10:02:26 PM	cygserver	0	None
> > Error	4/4/2014 10:02:25 PM	cygserver	0	None
> > 
> > (each having exactly the same message: cygserver: PID 1944: cygserver: error getting signal_arrived to server (6))
> 
> Thanks, I can reproduce the issue.  I'll investigate.

Ok, I see what happens.  At fork time, cygserver gets called to fixup
the information on XSI shared memory regions.  When this fixup call is
made, the handle value sent to cygserver is invalid.  It's, in fact, the
value of this object in the parent process, while the object doesn't
exist at this point in the forked child.  The child value is set to NULL
just a little bit later and created as soon as it's required, but this
happens too late for the aforementioned fixup call.

I created a fix and I'm just building cygwin 1.7.29 with it.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-05  2:36 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-07  0:59 ` Christopher Faylor
@ 2014-04-07  9:57 ` Corinna Vinschen
  2014-04-07 11:45   ` Corinna Vinschen
  1 sibling, 1 reply; 11+ messages in thread
From: Corinna Vinschen @ 2014-04-07  9:57 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]

On Apr  5 02:35, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> >> I can’t push this through your list spam filter.  Another attempt...
> 
> I was trying a few times, and finally deleted the strace attachment.  Let's see if this will go through.
> Excuse me for being a bit straightforward, but the spam filter this list is using is *really* stupid!
> 
> > Still, you're missing the cygcheck log,
> 
> Cygcheck log was attached to an earlier message from today (thread: exe.stackdump is always empty).
> 
> > and a simple testcase would be helpful
> 
> Here you go:
> [...]
> Windows event log immediately recorded 10 new events, like so:
> 
> Error	4/4/2014 10:02:34 PM	cygserver	0	None
> Error	4/4/2014 10:02:33 PM	cygserver	0	None
> Error	4/4/2014 10:02:32 PM	cygserver	0	None
> Error	4/4/2014 10:02:31 PM	cygserver	0	None
> Error	4/4/2014 10:02:30 PM	cygserver	0	None
> Error	4/4/2014 10:02:29 PM	cygserver	0	None
> Error	4/4/2014 10:02:28 PM	cygserver	0	None
> Error	4/4/2014 10:02:27 PM	cygserver	0	None
> Error	4/4/2014 10:02:26 PM	cygserver	0	None
> Error	4/4/2014 10:02:25 PM	cygserver	0	None
> 
> (each having exactly the same message: cygserver: PID 1944: cygserver: error getting signal_arrived to server (6))

Thanks, I can reproduce the issue.  I'll investigate.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-07  2:33   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-04-07  3:12     ` Christopher Faylor
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Faylor @ 2014-04-07  3:12 UTC (permalink / raw)
  To: cygwin

On Mon, Apr 07, 2014 at 02:33:18AM +0000, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
>cgf wrote:
>>You seem to have no problem asking for help with cygserver without
>>insulting cygserver in the process.  Possibly you're even interested in
>>improving cygserver.
>
>I was trying to submit a bug report in good faith (and many tries, for
>that matter), yet the only way to do that was through this list.  But
>the list was bouncing my posts, which I had finally cut short of the
>strace output, which I thought was a valuable piece of information, and
>which you guys would not receive now, thanks to the filter...

Uh, yeah.  I (and likely everyone else) got this.  It is a pretty simple
scenario.  Your valid email was blocked.  You were mad about it and
rather than follow the advice in the bounce message, you complained to
the mailing list.  I reiterated what you could do to help improve the
situation but now you've chosen to state the obvious, cutting the parts
of my email which told you how you could help rectify the situation.

My point was that you seem to be willing to help diagnose the problem
with cygserver but unwilling to diagnose the problem with the spam
filter.

You're wasting bits complaining here.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Tons of cygserver errors
  2014-04-07  0:59 ` Christopher Faylor
@ 2014-04-07  2:33   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-07  3:12     ` Christopher Faylor
  0 siblings, 1 reply; 11+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-04-07  2:33 UTC (permalink / raw)
  To: cygwin

> You seem to have no problem asking for help with cygserver without
> insulting cygserver in the process.  Possibly you're even interested in
> improving cygserver.

I was trying to submit a bug report in good faith (and many tries, for that matter),
yet the only way to do that was through this list.  But the list was bouncing
my posts, which I had finally cut short of the strace output, which I thought
was a valuable piece of information, and which you guys would not receive now,
thanks to the filter...

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Tons of cygserver errors
  2014-04-05  2:36 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
@ 2014-04-07  0:59 ` Christopher Faylor
  2014-04-07  2:33   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-07  9:57 ` Corinna Vinschen
  1 sibling, 1 reply; 11+ messages in thread
From: Christopher Faylor @ 2014-04-07  0:59 UTC (permalink / raw)
  To: cygwin

On Sat, Apr 05, 2014 at 02:35:59AM +0000, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
>>> I can’t push this through your list spam filter.  Another attempt...
>
>I was trying a few times, and finally deleted the strace attachment.
>Let's see if this will go through.  Excuse me for being a bit
>straightforward, but the spam filter this list is using is *really*
>stupid!

Sigh.  We >just< went through this.

You seem to have no problem asking for help with cygserver without
insulting cygserver in the process.  Possibly you're even interested in
improving cygserver.  I suggest that you might try thinking the same way
about mailing list service that you're using here: if you have spam that
is blocked inappropriately start a dialog with cygwin-owner/postmaster.

And, for all of the pile on people who want to re-whine about how hard
it is to send email to cygwin-owner or postmaster or that there is no
possible way for you to know that you should send email there please
don't bother.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Tons of cygserver errors
@ 2014-04-05  2:36 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  2014-04-07  0:59 ` Christopher Faylor
  2014-04-07  9:57 ` Corinna Vinschen
  0 siblings, 2 replies; 11+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2014-04-05  2:36 UTC (permalink / raw)
  To: cygwin

>> I can’t push this through your list spam filter.  Another attempt...

I was trying a few times, and finally deleted the strace attachment.  Let's see if this will go through.
Excuse me for being a bit straightforward, but the spam filter this list is using is *really* stupid!

> Still, you're missing the cygcheck log,

Cygcheck log was attached to an earlier message from today (thread: exe.stackdump is always empty).

> and a simple testcase would be helpful

Here you go:

$ cat sem.c
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/wait.h>

int main(void)
{
    int ids = semget(0xdeadbeef, 1, IPC_CREAT | 0777);
    int idm = shmget(0xdeadbeef, 4096*100, IPC_CREAT | 0777);
    char* addr = shmat(idm, 0, 0);
    int i;
    struct sembuf sb;
    sigset_t blocked;
    struct sigaction sa;

    sigfillset(&blocked);
    sigdelset(&blocked, SIGCHLD);
    memset(&sa, 0, sizeof(sa));
    sa.sa_flags = SA_NOCLDSTOP;
    sa.sa_handler = SIG_DFL;
    sigaction(SIGCHLD, &sa, 0);
    sigprocmask(SIG_BLOCK, &blocked, 0);

    for (i = 0;  i < 10; i++)  {
      pid_t pid = fork();
      if (!pid) {
          execl("/usr/bin/true", "true", NULL);
      } else {
          int status;
          printf("%d\n", i);
          sb.sem_num = 0;
          sb.sem_op  = 0;
          sb.sem_flg = 0;
          semop(ids, &sb, 1);
          waitpid(pid, &status, 0);
          sleep(1);
          *addr = (char) i;
      }
    }
    return 0;
}

$ gcc -Wall sem.c

$ ./a.exe
0
1
2
3
4
5
6
7
8
9

Windows event log immediately recorded 10 new events, like so:

Error	4/4/2014 10:02:34 PM	cygserver	0	None
Error	4/4/2014 10:02:33 PM	cygserver	0	None
Error	4/4/2014 10:02:32 PM	cygserver	0	None
Error	4/4/2014 10:02:31 PM	cygserver	0	None
Error	4/4/2014 10:02:30 PM	cygserver	0	None
Error	4/4/2014 10:02:29 PM	cygserver	0	None
Error	4/4/2014 10:02:28 PM	cygserver	0	None
Error	4/4/2014 10:02:27 PM	cygserver	0	None
Error	4/4/2014 10:02:26 PM	cygserver	0	None
Error	4/4/2014 10:02:25 PM	cygserver	0	None

(each having exactly the same message: cygserver: PID 1944: cygserver: error getting signal_arrived to server (6))

Strace is also attached.

Please let me know if you need anything else.

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-07 14:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-01 14:25 Tons of cygserver errors Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-04-02  8:53 ` Corinna Vinschen
2014-04-02 16:26   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-04-03  8:28     ` Corinna Vinschen
2014-04-05  2:36 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-04-07  0:59 ` Christopher Faylor
2014-04-07  2:33   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-04-07  3:12     ` Christopher Faylor
2014-04-07  9:57 ` Corinna Vinschen
2014-04-07 11:45   ` Corinna Vinschen
2014-04-07 14:31     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).