Thanks Mike & Maxim. You are so helpful. Regards, Wenxian
On 2 March 2016 at 22:33, Maxim Uvarov <[email protected]> wrote: > Has to be fixed with that commit: > > commit 50333e89b6c35edfa1221a4fbb74fc34bea6865d > Author: Hongbo Zhang <[email protected]> > Date: Tue Feb 23 17:25:12 2016 +0800 > > linux-generic: fix usage of function strncpy > > This is for https://bugs.linaro.org/show_bug.cgi?id=2030: > "Memory - illegal accesses (BUFFER_SIZE_WARNING) > Calling strncpy with a maximum size argument of 128 bytes on > destination > array "sysinfo->model_str[id]" of size 128 bytes might leave the > destination string unterminated." > > In fact in the following code there is operation like this: > sysinfo->model_str[id][len - 1] = 0 > to handle the last character of string, but is is also good to > eliminate > this coding warning. > > Signed-off-by: Hongbo Zhang <[email protected]> > Reviewed-by: Mike Holmes <[email protected]> > Signed-off-by: Maxim Uvarov <[email protected]> > > > If not, please create bug or provide fix. Please put cpu info proc file to > bugz so that we can reproduce that issue. > > Thank you, > Maxim. > > > On 03/02/16 15:54, Mike Holmes wrote: > >> >> >> On 2 March 2016 at 01:03, Wenxian Li <[email protected] <mailto: >> [email protected]>> wrote: >> >> Hi Experts, >> >> I met an ODP crash in linux generic. >> It crashes at requiring the CPU frequency. >> pos = strchr(sysinfo->model_str[id], '@'); >> *(pos - 1) = '\0'; >> >> My testbed is an ubuntu running on KVM, and the CPU model is: >> "model name: QEMU Virtual CPU version 2.0.0" >> >> There is no “@" in this string and pos is not a valid pointer. >> >> Did I meet any bug or limitation? Does anyone test ODP on KVM before? >> >> >> This is not a new problem, the cpu info mechanism has proven to be very >> brittle and fails every time it moves to a new platform. >> >> Hogbo had been trying to solve issues like this but he has returned to >> his member company. It may be that his fixes are in api-next already >> >> If not can you make a bug for it, of course you can try to fix it also :) >> >> https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane%20-%20linux-%20generic%20reference >> >> >> >> The detailed backtrace is: >> >> (gdb) bt >> #0 odp_cpuinfo_parser (file=file@entry=0x7a7950, >> sysinfo=sysinfo@entry=0x7ffff7b86610 <odp_global_data+16>) at >> arch/x86/odp_sysinfo_parse.c:27 >> #1 0x00007ffff7975842 in odp_system_info_init () at >> odp_system_info.c:198 >> #2 0x00007ffff796404d in odp_init_global (params=<optimized out>, >> platform_params=<optimized out>) at odp_init.c:34 >> #3 0x0000000000412720 in main_test (argc=10, argv=0x7fffffffe658) >> at ../../src/main_dpdk.cpp:4091 >> #4 0x0000000000411ca4 in main (argc=10, argv=0x7fffffffe658) at >> ../../src/main_dpdk.cpp:3876 >> >> >> user@vTRex:~/odp-linux/platform/linux-generic$ sudo cat /proc/cpuinfo >> processor: 0 >> vendor_id: GenuineIntel >> cpu family: 6 >> model: 6 >> model name: QEMU Virtual CPU version 2.0.0 >> stepping: 3 >> microcode: 0x1 >> cpu MHz: 2294.458 >> cache size: 4096 KB >> physical id: 0 >> siblings: 1 >> core id: 0 >> cpu cores: 1 >> apicid: 0 >> initial apicid: 0 >> fpu: yes >> fpu_exception: yes >> cpuid level: 4 >> wp: yes >> flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov >> pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni >> vmx cx16 x2apic popcnt hypervisor lahf_lm abm vnmi ept >> bogomips: 4588.91 >> clflush size: 64 >> cache_alignment: 64 >> address sizes: 40 bits physical, 48 bits virtual >> power management: >> >> Thanks, >> Wenxian >> >> _______________________________________________ >> lng-odp mailing list >> [email protected] <mailto:[email protected]> >> https://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> >> >> -- >> Mike Holmes >> Technical Manager - Linaro Networking Group >> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM >> SoCs >> "Work should be fun and collborative, the rest follows" >> >> >> >> _______________________________________________ >> lng-odp mailing list >> [email protected] >> https://lists.linaro.org/mailman/listinfo/lng-odp >> > > _______________________________________________ > lng-odp mailing list > [email protected] > https://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
