Hi Subhankar,
I'll forward this email to the mailing list, as I am not involved in the
maintanence of the LTP anymore, and it is actually the appropriate venue
for such questions.
-Robbie
Subhankar Katyayan <[EMAIL PROTECTED]> wrote on 09/10/2008
08:12:01 AM:
> Hi,
>
> The program which I have attached is taken from "sourceforge" and
> it's failing (segmentation fault) when I am trying to execute it.
> Could you please look into it and let me know why it's failing and
> how to resolve it.
>
> ./shmem -r 10 -w 4 -s 10 (W is the writer thread, if I give W as 4
> or more it fails)
>
> But at the same time if I am trying to execute it as follows:
>
> ./shmem -r 10 -w 3 -s 10 ( it works fine)
>
> When I tried to debug it using dbx on AIX, it's giving core in the
> following function....
>
> void * reader(void *parm)
>
> Below is the error message attached for your reference..
>
> midibm14:subh:/home/users/subh/demo #dbx a.out
> Type 'help' for help.
> reading symbolic information ...
> (dbx) r -r 5 -w 3 -s 10 (this works fine)
> a.out: Shared Memory Test Program
> Number of writers thread = 3
> Number of readers thread = 5
> Shared Memory Size in Bytes = 10
>
> Writer (0): shared memory checksum 0045
> Reader (0) of Writer (0): checksum 0045
> Reader (4) of Writer (2): checksum 0065
> Reader (3) of Writer (2): checksum 0065
> Reader (1) of Writer (0): checksum 0045
> Reader (2) of Writer (0): checksum 0045
> Reader (3) of Writer (0): checksum 0045
> Reader (4) of Writer (0): checksum 0045
> Writer (1): shared memory checksum 0055
> Reader (0) of Writer (1): checksum 0055
> Reader (1) of Writer (1): checksum 0055
> Reader (2) of Writer (1): checksum 0055
> Reader (3) of Writer (1): checksum 0055
> Reader (4) of Writer (1): checksum 0055
> Writer (2): shared memory checksum 0065
> Reader (0) of Writer (2): checksum 0065
> Reader (2) of Writer (2): checksum 0065
> Reader (1) of Writer (2): checksum 0065
> Main: Readers calculated segment successfully
> successful!
> execution completed
> (dbx) r -r 5 -w 4 -s 10 (this fails)
> a.out: Shared Memory Test Program
> Number of writers thread = 4
> Number of readers thread = 5
> Shared Memory Size in Bytes = 10
> Shmat Failed: Shared Memory Attach Error 11 : Too many open files
> Writer (0): shared memory checksum 0045
> Reader (0) of Writer (0): checksum 0045
> Reader (4) of Writer (2): checksum 0065
> Reader (3) of Writer (2): checksum 0065
> Writer (3): shared memory checksum 0000
> Segmentation fault in reader at line 48 in file "reader.c" ($t22)
> 48 cksum_r += *ptr++;
> (dbx)
> "Imagination is far better than Intelligence"
> Subhankar Katyayan
> ' 00 44 7530847376
>
>
>
> [attachment "shmem07.c.txt" deleted by Robert Williamson/Austin/IBM]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list