[so] Test? + Other things

Octavian Purdila so@cursuri.cs.pub.ro
Mon, 22 Nov 2004 16:06:28 +0200


On Sunday 21 November 2004 23:15, gavieritei@home.ro wrote:
> 1.
> a) dlsym (RTLD_NEXT, "read"); si la fel pentru write
> b) am incercat numai cu handle (dlopen+dlclose)
> Faceam chestia asta unde suprascriam functia read si respectiv write
>
> de fiecare data :
> cat: README: Bad address
> asta dupa ce facea niste r/w
>

Descriptorul e invalid, asta inseamna ca fie nu pasezi fd care trebuie 
functiei originale de read/write, fie nu dai inapoi rezultatul intors de 
read/write.

Cel mai probabil, problema nu e cu dlopen/dlsym/dlclose ci undeva in rutinele 
tale de read/write.
> 2.
> in alta ordine de idei am "incercat" testul de pe site.
> bash-2.05b# ./test README fis_out.txt 1000 1000
>
> dupa o multime de r/w, am constat ca de fapt fiind acelasi pid, IoStart si
> IoStop se cam suprascriu ... Adica:
> libtip.c: 113 LIB >>> read pid=4943...
> libtip.c: 117 LIB >>> read iostart=2519406...
> libtip.c: 124 LIB >>> read trimis mesaj _2__4943_2519406_...
> libtip.c: 145 LIB >>> read iostop=2519406...
> libtip.c: 152 LIB >>> read trimis mesaj _3__4943_2519406_...
>
> libtip.c: 170 LIB >>> write pid=4943...
> libtip.c: 174 LIB >>> write iostart=2519406...
> libtip.c: 182 LIB >>> write trimis mesaj _2__4943_2519406_...
> libtip.c: 204 LIB >>> write iostop=2519406...
> libtip.c: 212 LIB >>> write trimis mesaj _3__4943_2519406_...
>
> libtip.c: 113 LIB >>> read pid=4943...
> libtip.c: 117 LIB >>> read iostart=2519406...
> libtip.c: 124 LIB >>> read trimis mesaj _2__4943_2519406_...
> libtip.c: 145 LIB >>> read iostop=2519407...
> libtip.c: 152 LIB >>> read trimis mesaj _3__4943_2519406_...
>
> libtip.c: 170 LIB >>> write pid=4943...
> libtip.c: 174 LIB >>> write iostart=2519407...
> libtip.c: 182 LIB >>> write trimis mesaj _2__4943_2519406_...
> libtip.c: 204 LIB >>> write iostop=2519407...
> libtip.c: 212 LIB >>> write trimis mesaj _3__4943_2519406_...
>
> Daca se termina aici IOTIME o sa fie 0, la fel daca fac interogarea intre
> ioread si iostop, pentru ca acolo se citesc foarte putine
>

Incearca cu un fisier mai mare.

tavi