UO_TRUNC obscure bug?
Brought to you by:
ricky-zheng
Hi I am facing a very obscure bug; it seems that when I use the UO_TRUNC flag when opening a file, this would disrupt the environment, i.e. I get an Hard Fault when calling the malloc system routine.
//fd_dst = uffs_open(dst, UO_RDWR|UO_CREATE|UO_TRUNC); after this, if I call a malloc, an hard fault would be generated
fd_dst = uffs_open(dst, UO_RDWR|UO_CREATE); // this seems to work fine
I have tried using both static and dynamic allocator and the behaviour is the same.
Currently I have disabled the use of the UO_TRUNC flag and all seem to work fine, I'll let you know if I have further informations.
Hi, my fault! The error was coming from a... stack overflow, so there is NO obscure bug