when intterupt hangs arduino

I have observed the following:

Pin 2 has an interrupt when shift to HIGH to LOW.

If I use a button to shift HIGH to LOW, or specially I connect a wire from Pin 2 into ground line... the arduino hangs (many times).

If the the shift HIGH to LOW is produced by, for example, a sensor, this does not happen.

So it seems there is a debouncing problem when using attach interrupt. Why? How can I solve it? perhaps using a capacitor? How?

Yes, you will be having massive bounce with that arrangement. If the interrupt routine takes longer to run than the period of the bounce, you may be nesting interrupts. This is bad.

I usually do my debouncing in hardware, using this circuit:

but where the inverter is actually the input pin. R1 = 10K, R2 = 470Ω, C = 100nF

Thanks a lot.

I will try.

You could also disable interrupts with the first interrupt, and not enable them until you are ready to process another interrupt.
That way a new interrupt does not interrupt the ongoing interrupt, so to speak.

ProfePaco:
Pin 2 has an interrupt when shift to HIGH to LOW.

If I use a button to shift HIGH to LOW, or specially I connect a wire from Pin 2 into ground line... the arduino hangs (many times).

Show us your code? Did you use FALLING or LOW interrupt?

CrossRoads:
That way a new interrupt does not interrupt the ongoing interrupt, so to speak.

An interrupt does not fire while an interrupt is being processed, but certainly they may happen in quick succession if you don't debounce.

Another issue is that he might be trying to do too much in the ISR.

Posting code gives better answers.