Menu

#25 bug in shm_test.c

closed-fixed
nobody
Testcases (27)
5
2007-05-14
2007-05-11
Anonymous
No

Hi,

Found some bugs in testcases/kernel/mem/mtest07/shm_test.c:

1) in main():
chld_args is declared as
long chld_args[3];
instead of [4]
--> chld_args[3] is used to pass the reader / writer status to the created thread.

2) in shmat_rd_wr():
shmat() is called as follows:
shmat(shmkey, (void *)locargs[2], SHM_RND|SHMLBA)

while locargs[2] contains the shm segment size (which may be set to big values since it is a random size).

This should be changed to
shmat(shmkey, (void *)NULL, 0)

Attached a patch including other minor chnages, if interested.

Regards,
Nadia

Discussion

  • Nobody/Anonymous

    shm_test.c patch

     
  • Subrata Modak

    Subrata Modak - 2007-05-14
    • status: open --> closed-fixed
     
  • Subrata Modak

    Subrata Modak - 2007-05-14

    Logged In: YES
    user_id=1737361
    Originator: NO

    Done.
    Regards--
    Subrata