After downloading latest openwrt, C program's free() function giving me segmentation fault

I have build an ipk from C file and was working good. But yesterday I downloaded latest openwrt and built the ipk from using same C file. But now the application not working and gives segmentation fault. If I remove free() function then it works but application memory increases every second and when memory full restart occurs.

But still if I build the application using my old openwrt its works good.

I you have the possibility, try to use valgrind. Your application either double free's or writes outside the boundaries of the allocated blocks.

1 Like

There have been major toolchain updates in master over the last three/ four weeks, gcc-8 to gcc-10, to finally gcc-11, musl (the libc) and more, you need to update your build environment as well (in lock-step). These newer versions might also force you to do minor adjustments/ fixes to your source.

1 Like