linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexi Jordanov" <a_jordanov@prosyst.bg>
To: linux-c-programming@vger.kernel.org
Subject: strange SIGSEGV
Date: Tue, 25 Mar 2003 12:00:29 +0200	[thread overview]
Message-ID: <005701c2f2b5$5d8d0300$0266a8c0@psb> (raw)
In-Reply-To: 3E65B4EE.8080803@tscheinig.com

Hello to all,

I have a strange problem with listening for file change notification.
Everything is fine in my handler fuction till the moment when I try to send
this information through pipes:

This works fine:
===========
static void handler(int sig, siginfo_t *si, void *data)
{
 fprintf(stderr, "Got an event: %d.\n", si->si_fd);
}

This cause SIGSEGV:
===============
static void handler(int sig, siginfo_t *si, void *data)
{
 fprintf(stderr, "Got an event: %d.\n", si->si_fd);
 if (write(event_pipe[1], &si->si_fd, sizeof(int)) != sizeof(int))
 {
  fprintf(stderr, "Write failed (handler) - %s.\n", errstr);
  fflush(stderr);
 }
}

I try to start debugger to look for the problem, but all that I was found
was:
==================================================
Program received signal SIGSEGV, Segmentation fault.
0x00000004 in ?? ()
(gdb) where
#0  0x00000004 in ?? ()
#1  0x90c3c9ec in ?? ()
Cannot access memory at address 0x5d8bc031
(gdb)

The problem appears when I try to watch simultaneously two times one and the
same directory. But I don't think that this is 100% true, because I don't
have problem with other directories.

Can somebody advise me how to deal with this problem?!

Regards, Alex


  reply	other threads:[~2003-03-25 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-05  7:02 structure size Mohammed Khalid Ansari
2003-03-05  8:27 ` Helmut Djurkin
2003-03-25 10:00   ` Alexi Jordanov [this message]
2003-03-05  9:06 ` (F)structure size Steven Smith
2003-03-12 22:49 ` getlogin(), prints ((NULL)) when printing multiple times in a row J.
2003-03-12 23:14   ` Glynn Clements
2003-03-13  0:18     ` getlogin(), prints ((NULL)) solved.. thnkx.. glen J.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005701c2f2b5$5d8d0300$0266a8c0@psb' \
    --to=a_jordanov@prosyst.bg \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).