板子编译内核时选中ppp及slip user配置里选上pppd和chat 交叉编译通过 把编译好的内核及文件系统烧到板子里 启动进入uclinux 命令行照上面一样输入 报错 munmap of non-mmaped memory by process 21 (pppd): 0c2fcc60 google一斧子之后如下解释: "munmap of non-mmaped memory by process X (YYY) : ZZZZ" appears on the console
If you see the above error on the console when running a program or even during normal operation it means that the program in question is incorrectly freeing some memory.
The most common cause for this error is either calling free on memory that has already been freed or with an address that was not returned by malloc, strdup or similar functions. The program may have tried to free the same pointer twice or may be freeing an object that was not allocated.
If the program uses mmap/munmap then it is most likely unampping a different value to that returned by mmap.
Carefully check your programs dynamic memory usage. If that is correct then look for possible memory corruption. 什么?内存释放出错!晕倒,想这下麻烦大了,看了pppd的代码,发现main.c里面在调 用chat子进程时用的execv(argv[0], argv);下面一行execl("/bin/sh", "sh", "-c", program, (char *)0);则被宏定义条件关闭了,注释说On uClinux we don't have a full shell, just call chatprogram directly 我狂晕!看来是没有指定完整的路径, 子进程调用找不到chat程序,才导致释放内存出错。 在命令行中输入完整的路径 #pppd /dev/ttyS0 115200 debug connect "/usr/bin/chat '' ATZ OK AT+CGDCONT=1,"IP","CMNET" OK ATD*99***1# CONNECT ''" 不再出错了 窃喜:)