Created attachment 119599 [details] valgrind.spec SUMMARY get SRPM( https://cbs.centos.org/koji/buildinfo?buildID=17549 ),rebuild on mips. build completed,but check failed. STEPS TO REPRODUCE 1. get SRPM 2. modify valgrind.spec for mips64el 3. exec rpmbuild ... OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION glibc-2.20 gcc-4.9.3 binutils-2.25.1 + LD_SHOW_AUXV=1 + /bin/true AT_HWCAP: 0 AT_PAGESZ: 16384 AT_CLKTCK: 100 AT_PHDR: 0x120000040 AT_PHENT: 56 AT_PHNUM: 10 AT_BASE: 0xfff0e3c000 AT_FLAGS: 0x0 AT_ENTRY: 0x120001c60 AT_UID: 0 AT_EUID: 0 AT_GID: 0 AT_EGID: 0 AT_SECURE: 0 AT_RANDOM: 0xfffff7b1e5 AT_EXECFN: /bin/true AT_PLATFORM: loongson3a + cat /proc/cpuinfo system type : generic-loongson-machine machine : Unknown processor : 0 cpu model : ICT Loongson-3 V0.9 FPU V0.1 model name : ICT Loongson-3A R3 (Loongson-3A3000) @ 1199MHz BogoMIPS : 2388.44 cpu MHz : 1199.98 wait instruction : yes microsecond timers : yes tlb_entries : 1088 extra interrupt vector : no hardware watchpoint : yes, count: 0, address/irw mask: [] isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2 ASEs implemented : vz shadow register sets : 1 kscratch registers : 6 package : 0 core : 0 VCED exceptions : not available VCEI exceptions : not available processor : 1 cpu model : ICT Loongson-3 V0.9 FPU V0.1 model name : ICT Loongson-3A R3 (Loongson-3A3000) @ 1199MHz BogoMIPS : 2388.44 cpu MHz : 1199.98 wait instruction : yes microsecond timers : yes tlb_entries : 1088 extra interrupt vector : no hardware watchpoint : yes, count: 0, address/irw mask: [] isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2 ASEs implemented : vz shadow register sets : 1 kscratch registers : 6 package : 0 core : 1 VCED exceptions : not available VCEI exceptions : not available processor : 2 cpu model : ICT Loongson-3 V0.9 FPU V0.1 model name : ICT Loongson-3A R3 (Loongson-3A3000) @ 1199MHz BogoMIPS : 2388.44 cpu MHz : 1199.98 wait instruction : yes microsecond timers : yes tlb_entries : 1088 extra interrupt vector : no hardware watchpoint : yes, count: 0, address/irw mask: [] isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2 ASEs implemented : vz shadow register sets : 1 kscratch registers : 6 package : 0 core : 2 VCED exceptions : not available VCEI exceptions : not available processor : 3 cpu model : ICT Loongson-3 V0.9 FPU V0.1 model name : ICT Loongson-3A R3 (Loongson-3A3000) @ 1199MHz BogoMIPS : 2403.53 cpu MHz : 1199.98 wait instruction : yes microsecond timers : yes tlb_entries : 1088 extra interrupt vector : no hardware watchpoint : yes, count: 0, address/irw mask: [] isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2 ASEs implemented : vz shadow register sets : 1 kscratch registers : 6 package : 0 core : 3 VCED exceptions : not available VCEI exceptions : not available + ./vg-in-place /bin/true ==8437== Memcheck, a memory error detector ==8437== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==8437== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==8437== Command: /bin/true ==8437== VEX: Unsupported baseline Found: Loongson-baseline Cannot continue. Good-bye vex storage: T total 0 bytes allocated vex storage: P total 0 bytes allocated valgrind: the 'impossible' happened: LibVEX called failure_exit(). host stacktrace: ==8437== at 0x5808C954: show_sched_status_wrk (m_libcassert.c:355) ==8437== by 0x5808CB14: report_and_quit (m_libcassert.c:426) ==8437== by 0x5808CD70: panic (m_libcassert.c:502) ==8437== by 0x5808CD70: vgPlain_core_panic_at (m_libcassert.c:507) ==8437== by 0x5808CDAC: vgPlain_core_panic (m_libcassert.c:512) ==8437== by 0x580B281C: failure_exit (m_translate.c:740) ==8437== by 0x581AA540: vfatal (main_util.c:552) ==8437== by 0x581A4ED0: invalid_hwcaps (main_main.c:1825) ==8437== by 0x581A535C: check_hwcaps (main_main.c:2037) ==8437== by 0x581A5D30: LibVEX_FrontEnd (main_main.c:528) ==8437== by 0x581A6568: LibVEX_Translate (main_main.c:1173) ==8437== by 0x580B5304: vgPlain_translate (m_translate.c:1794) ==8437== by 0x581014F0: handle_tt_miss (scheduler.c:1056) ==8437== by 0x581014F0: vgPlain_scheduler (scheduler.c:1417) ==8437== by 0x58117448: thread_wrapper (syswrap-linux.c:103) ==8437== by 0x58117448: run_a_thread_NORETURN (syswrap-linux.c:156) sched status: running_tid=1 Thread 1: status = VgTs_Runnable (lwpid 8437) ==8437== at 0x4002F00: __start (in /usr/lib64/ld-2.20.so) ==8437== by 0x1FFF002CD8: ??? disable the %check,RPM packages can be packaged, but not good: [root@localhost ~]# valgrind ls ==11754== Memcheck, a memory error detector ==11754== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==11754== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==11754== Command: ls ==11754== VEX: Unsupported baseline Found: Loongson-baseline Cannot continue. Good-bye vex storage: T total 0 bytes allocated vex storage: P total 0 bytes allocated valgrind: the 'impossible' happened: LibVEX called failure_exit(). host stacktrace: ==11754== at 0x5808C954: ??? (in /usr/lib64/valgrind/memcheck-mips64-linux) ==11754== by 0x5808C888: ??? (in /usr/lib64/valgrind/memcheck-mips64-linux) sched status: running_tid=1 Thread 1: status = VgTs_Runnable (lwpid 11754) ==11754== at 0x4002F00: __start (in /usr/lib64/ld-2.20.so) ==11754== by 0x1FFF003028: ???
download https://sourceware.org/pub/valgrind/valgrind-3.15.0.tar.bz2 reference README,make and make install. it has same problem,does valgrind not support loongson ? or doesn't support mips64el ? [root@localhost valgrind-3.15.0]# valgrind ls ==2657== Memcheck, a memory error detector ==2657== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==2657== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==2657== Command: ls ==2657== VEX: Err : Unsupported baseline Found: Loongson-baseline Cannot continue. Good-bye vex storage: T total 0 bytes allocated vex storage: P total 0 bytes allocated valgrind: the 'impossible' happened: LibVEX called failure_exit(). host stacktrace: ==2657== at 0x58061BC8: show_sched_status_wrk (m_libcassert.c:388) ==2657== by 0x58061DA0: report_and_quit (m_libcassert.c:459) ==2657== by 0x5806200C: panic (m_libcassert.c:535) ==2657== by 0x5806200C: vgPlain_core_panic_at (m_libcassert.c:540) ==2657== by 0x58062050: vgPlain_core_panic (m_libcassert.c:545) ==2657== by 0x5807F1E8: failure_exit (m_translate.c:751) ==2657== by 0x58191160: vfatal (main_util.c:603) ==2657== by 0x5818B3C0: invalid_hwcaps (main_main.c:1851) ==2657== by 0x5818B97C: check_hwcaps (main_main.c:2068) ==2657== by 0x5818C558: LibVEX_FrontEnd (main_main.c:530) ==2657== by 0x5818CF34: LibVEX_Translate (main_main.c:1185) ==2657== by 0x580822BC: vgPlain_translate (m_translate.c:1813) ==2657== by 0x580D2C50: handle_tt_miss (scheduler.c:1139) ==2657== by 0x580D2C50: vgPlain_scheduler (scheduler.c:1505) ==2657== by 0x5813AE38: thread_wrapper (syswrap-linux.c:103) ==2657== by 0x5813AE38: run_a_thread_NORETURN (syswrap-linux.c:156) sched status: running_tid=1 --2657-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting --2657-- si_code=1; Faulting address: 0x148; sp: 0x1002eb7280 valgrind: the 'impossible' happened: Killed by fatal signal host stacktrace: ==2657== at 0x580D4BD8: vgPlain_is_in_syscall (syswrap-main.c:1642) ==2657== by 0x580616CC: print_thread_state (m_libcassert.c:326) ==2657== by 0x580619A4: show_sched_status_wrk (m_libcassert.c:422) ==2657== by 0x58061DA0: report_and_quit (m_libcassert.c:459) ==2657== by 0x5806200C: panic (m_libcassert.c:535) ==2657== by 0x5806200C: vgPlain_core_panic_at (m_libcassert.c:540) ==2657== by 0x58062050: vgPlain_core_panic (m_libcassert.c:545) ==2657== by 0x5807F1E8: failure_exit (m_translate.c:751) ==2657== by 0x58191160: vfatal (main_util.c:603) ==2657== by 0x5818B3C0: invalid_hwcaps (main_main.c:1851) ==2657== by 0x5818B97C: check_hwcaps (main_main.c:2068) ==2657== by 0x5818C558: LibVEX_FrontEnd (main_main.c:530) ==2657== by 0x5818CF34: LibVEX_Translate (main_main.c:1185) ==2657== by 0x580822BC: vgPlain_translate (m_translate.c:1813) ==2657== by 0x580D2C50: handle_tt_miss (scheduler.c:1139) ==2657== by 0x580D2C50: vgPlain_scheduler (scheduler.c:1505) ==2657== by 0x5813AE38: thread_wrapper (syswrap-linux.c:103) ==2657== by 0x5813AE38: run_a_thread_NORETURN (syswrap-linux.c:156) sched status: running_tid=1 Segment error
Fixed in a47a8b3e87590df048967574982d0a3db8f13450 [1]. [1] https://sourceware.org/git/?p=valgrind.git;a=commit;h=a47a8b3e87590df048967574982d0a3db8f13450
it's worked, but new problem came out... + ./vg-in-place --error-exitcode=1 /bin/true ==6577== Memcheck, a memory error detector ==6577== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==6577== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==6577== Command: /bin/true ==6577== vex mips->IR: unhandled instruction bytes: 0x7C 0x19 0xB7 0xEB ==6577== valgrind: Unrecognised instruction at address 0x4006abc. ==6577== at 0x4006ABC: _dl_start (rtld.c:336) ==6577== by 0x4002FCC: __start (in /usr/lib64/ld-2.20.so) ==6577== Your program just tried to execute an instruction that Valgrind ==6577== did not recognise. There are two possible reasons for this. ==6577== 1. Your program has a bug and erroneously jumped to a non-code ==6577== location. If you are running Memcheck and you just saw a ==6577== warning about a bad jump, it's probably your program's fault. ==6577== 2. The instruction is legitimate but Valgrind doesn't handle it, ==6577== i.e. it's Valgrind's fault. If you think this is the case or ==6577== you are not sure, please let us know and we'll try to fix it. ==6577== Either way, Valgrind will now raise a SIGILL signal which will ==6577== probably kill your program. ==6577== ==6577== Process terminating with default action of signal 4 (SIGILL) ==6577== Illegal opcode at address 0x4006ABC ==6577== at 0x4006ABC: _dl_start (rtld.c:336) ==6577== by 0x4002FCC: __start (in /usr/lib64/ld-2.20.so) ==6577== ==6577== HEAP SUMMARY: ==6577== in use at exit: 0 bytes in 0 blocks ==6577== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==6577== ==6577== All heap blocks were freed -- no leaks are possible ==6577== ==6577== For counts of detected and suppressed errors, rerun with: -v ==6577== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ./vg-in-place: line 31: 6577 Illegal instruction VALGRIND_LIB="$vgbasedir/.in_place" VALGRIND_LIB_INNER="$vgbasedir/.in_place" "$vgbasedir/coregrind/valgrind" "$@"
(In reply to Dapeng from comment #3) > it's worked, but new problem came out... > ==6577== > vex mips->IR: unhandled instruction bytes: 0x7C 0x19 0xB7 0xEB > ==6577== valgrind: Unrecognised instruction at address 0x4006abc. This is a different issue. The opcode says this is swc2: 0x0: swc2 $23,6524(sp) but I believe Loongson-3 has overridden COP2 instruction formats. I suggest you install regular MIPS64 Debian, then it will work without problems.
If there is a request to support Loongson specific instructions, please open a new ticket.