Hi.
I a have a problem with my process becoming defunct at exit.
Basically the process does the following:
Get the _physical_ memory address of a buffer
(physically contigous memory from a dma device driver).
Open /dev/mem and map this address to my address space.
Write the data to _raw_ disk device. (/dev/rdsk/xxx, scsi disk)
Close all, and unmap.
Exit.
I do not start any processes/threads or async io from my program.
The process reaches the exit call, but the parent process does not
seem to get SIGCHLD, and my process becomes defunct.
The problem only happens with the setup above. If I change my program
to write to a normal file or non raw disk device (/dev/dsk/xxx),
or if I allocate some memory and copy the data from the mapped
area to this memory and write the _copy_ to any file/device,
the problem dissappears. I.e. the problem seems to only occur with
the combination mapped /dev/mem and /dev/rdsk/xxx.
(The /dev/mem mapping will not exists in the final program,
the device driver should be able to do this.)
Has anyone _any_ idea of what this could be?
I do not think I am overwriting any memory/stack (like the parent pid),
making the exit call fail, as my (test) program is quite simple.
Could this be a bug in the rdsk driver?
--
Staale L. Hansen | Spacetec A.S, Prestvannv. 38,
Software Engineer | N-9005 Tromsoe, Norway
WWW: http://www.spacetec.no | Fax: +47 77 65 58 59