Call to virtual function causes crash

Hello, Arduino 2.2.1. Got a sudden weird problem - declaring a function as virtual causes fatal crash at runtime when trying to call it even with empty function body. It's not a pure virtual function! After removing "virtual" from function declaration it works like a charm. Maybe someone can enlighten me, I do not understand it at all, thanks! No problems with free ram size of course.

Say what Arduino board this happens on and post a minimum sketch that shows the problem. So we can see it for ourselves.

TIA

a7

Happens to Mega, Uno and Nano - everywhere. Sketch is big enough, will try to extract minimum required snippet, thanks!

NO!!! Extract and post the minimum possible complete program that compiles an demonstrates the problem.

Please properly format code to fix the atrocious indentation. Then properly re-post it using Code Tags.

Ok, will do in a meantime, thanks for taking care - sent a raw example :frowning: Something is definitely wrong with virtual table anyway.

Solved. Crazy bug of mine due to hidden recursion in case of function declared as virtual. Sorry.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.