unable to locate the deadlock

Hi,

I am having a deadlock situation.I have a Analog Input board and when I am
running at higher
sampling frequency the board should give a time-out error but instead of
that the PC hangs.

We were able to guess that it may be ISR which is creating problem, but by
inserting a printf
statement inside the ISR the problem is not occurring again.

I have used gdb tool too but using gdb the problem is not occurring again.

Can anyone please help me to know is there any tool I can use to locate
these type of bug.


Thx inadvance,
Mankan Srinivas

Never put a printf inside an ISR!

One thing you could try, if performance considerations permit,
is setting up a thread that waits in an InterruptWait() call,
and using InterruptAttachEvent to cause a SIGEV_INTR event to
be generated when the hardware interrupts. This is an
alternative to using an actual ISR. This will free you from
the fierce restrictions that obtain in ISRs.

By the way, “deadlock” has a very specific meaning, referring
to a situation of blocking caused by mutual dependencies on a
lock-protected resource. What you have sounds like it may be
something different.

dB


“Mankan” wrote ~ Tue, 10 Jun 2003 10:24:04 -0400:

Hi,

I am having a deadlock situation.I have a Analog Input board and when I am
running at higher
sampling frequency the board should give a time-out error but instead of
that the PC hangs.

We were able to guess that it may be ISR which is creating problem, but by
inserting a printf
statement inside the ISR the problem is not occurring again.

I have used gdb tool too but using gdb the problem is not occurring again.

Can anyone please help me to know is there any tool I can use to locate
these type of bug.


Thx inadvance,
Mankan Srinivas
\

Just an aside, printf is not ISR safe …

Regards.

David Bacon <dbacon@qnx.com> wrote:

Never put a printf inside an ISR!

One thing you could try, if performance considerations permit,
is setting up a thread that waits in an InterruptWait() call,
and using InterruptAttachEvent to cause a SIGEV_INTR event to
be generated when the hardware interrupts. This is an
alternative to using an actual ISR. This will free you from
the fierce restrictions that obtain in ISRs.

By the way, “deadlock” has a very specific meaning, referring
to a situation of blocking caused by mutual dependencies on a
lock-protected resource. What you have sounds like it may be
something different.

dB


“Mankan” wrote ~ Tue, 10 Jun 2003 10:24:04 -0400:
Hi,

I am having a deadlock situation.I have a Analog Input board and when I am
running at higher
sampling frequency the board should give a time-out error but instead of
that the PC hangs.

We were able to guess that it may be ISR which is creating problem, but by
inserting a printf
statement inside the ISR the problem is not occurring again.

I have used gdb tool too but using gdb the problem is not occurring again.

Can anyone please help me to know is there any tool I can use to locate
these type of bug.


Thx inadvance,
Mankan Srinivas
\