You should not return from main, or what to you expect to happen then. Add for example an endless loop at the end.
Also make sure you application has enough stack space, not sure how much log10 needs.
And finally a comment states that all globals should be zero, well given the code I would not expect any of them to be zero actually.
Daniel