Determining who crashed first, driver or application?

I am getting a crash but there is no OOPS. I have an application and a driver that work together. I suspect that the application is crashing first but would like a way to definitively show this. Is there a way for the a driver to check on the status of an application?

Reply to
Bill
Loading thread data ...

Maybe.

JJS

Reply to
johnspeth

Error: Not enough information to process question. What OS are you using? what are the symptoms of your crash? What makes you think the application crashes? Why do you assume that a crashing application can break the driver?

--
:wq
^X^Cy^K^X^C^C^C^C
Reply to
Ico

Sorry about that.

What OS are you using? Linux 2.4

What are the symptoms of your crash? The driver keeps repeating via printk that it cannot get any buffers. I assume that the application has crashed since the buffer gets the buffers from the application (see below). If I remove the printk statements, it just hangs after awhile because it keeps asking for buffers and not getting any.

What makes you think the application crashes? Why do you assume that a crashing application can break the driver? The application is supposed to return ownership of buffers that are shared by the application and the driver. Since the driver runs out of buffers (100 are allocated and only 25 are needed at the speed I am running the application), I assume that the application has died since it should have returned buffers to the driver. Once the driver can't get any buffers, it can't do anything but indicate there are no buffers, which is does.

Thus, I would like to determine if the driver is running after the application crashes.

Reply to
Bill

'Just hangs' does not sound good. Did you design the driver to handle the case where it runs out of buffers ? Can it recover from this situation ?

It's hard to describe a driver's state as 'running'. Drivers usually don't get scheduled like an application in userspace, and are only active when there is work to be done (interrupt, workqueue, systemcall, etc). If your application is no longer running, it won't talk to your driver anymore, and thus that part of the driver probably won't "run". Depending on your setup, it might still receive interrupts from your hardware, so you'll have to decide what to do when it runs out of buffers.

You could add some code to your driver to export statistics about its inner workings using a /proc file for example. this might give you more insight in what is happening.

Regards,

Ico

--
:wq
^X^Cy^K^X^C^C^C^C
Reply to
Ico

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.