public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* shmat returning NULL with 0 sized segment
@ 2000-12-25  1:13 Dave Gilbert
  2000-12-26  9:31 ` Christoph Rohland
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Gilbert @ 2000-12-25  1:13 UTC (permalink / raw)
  To: linux-kernel

Hi,
  I'm trying to debug a weird problem with Xine - its screwing up its use
of shared memory for regions I haven't sussed yet.  One odd consequence is
that it has apparently successfully managed to allocate a 0 byte chunk of
shared memory; shmat is then called with shmaddr=0 and shmflg=0; the
result of shmat is 0

  Is this what shmat is supposed to do in this (admittedly odd)
circumstance? The error behaviour is defined in the man page as returning
-1 on error.

(Linux/Alpha 2.4.0-test8)

Back to trying to find out why it decided to allocate a  0 byte chunk....

Dave


-- 
 ---------------- Have a happy GNU millennium! ----------------------   
/ Dr. David Alan Gilbert      | Running GNU/Linux on       |  Happy  \ 
\   gro.gilbert @ treblig.org |  Alpha, x86, ARM and SPARC |  In Hex /
 \ ___________________________|___ http://www.treblig.org  |________/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: shmat returning NULL with 0 sized segment
  2000-12-25  1:13 shmat returning NULL with 0 sized segment Dave Gilbert
@ 2000-12-26  9:31 ` Christoph Rohland
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Rohland @ 2000-12-26  9:31 UTC (permalink / raw)
  To: Dave Gilbert; +Cc: linux-kernel

Dave Gilbert <gilbertd@treblig.org> writes:

>   I'm trying to debug a weird problem with Xine - its screwing up its use
> of shared memory for regions I haven't sussed yet.  One odd consequence is
> that it has apparently successfully managed to allocate a 0 byte chunk of
> shared memory; shmat is then called with shmaddr=0 and shmflg=0; the
> result of shmat is 0
> 
>   Is this what shmat is supposed to do in this (admittedly odd)
> circumstance? The error behaviour is defined in the man page as returning
> -1 on error.

Yes, this should be competely legal and wanted. Some programs use
shmget (..,0,..) to test if the segment is there. Apparently Xine does
this while setting the IPC_CREATE flag. This is legal on 2.4 (wasn't
in 2.2) and gives you a 0 byte segment.

shmat will give you then the legal address 0 like mmap would.

Greetings
                Christoph

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2000-12-26  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-25  1:13 shmat returning NULL with 0 sized segment Dave Gilbert
2000-12-26  9:31 ` Christoph Rohland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox