Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malloc(): smallbin double linked list corrupted #34

Open
kobeyu opened this issue Jun 27, 2023 · 1 comment
Open

malloc(): smallbin double linked list corrupted #34

kobeyu opened this issue Jun 27, 2023 · 1 comment

Comments

@kobeyu
Copy link

kobeyu commented Jun 27, 2023

Hi

I found that using malloc will trigger abort, can you help to confirm the problem, thanks.

#include<cstdlib>                                                                                                                            

int main(void) {
    const int size = 10;
    char *ptr = (char*)malloc(size);
    free(ptr);
}
  • compiler cmd: riscv64-unknown-linux-gnu-g++ -march=rv64gv main.cpp -std=c++17 -ldl -lpthread -static

  • gnu-toolchain:

  • Gem5:

    • commit 2909be3 (HEAD -> rvv-cpu, origin/rvv-cpu, origin/HEAD)
  • Cmd to run gem5

   GEM5=$GEM5_ROOT/build/RISCV/gem5.opt
   SE=$GEM5_ROOT/configs/example/se.py
   $GEM5 $SE -c $exec
  • Gem5 log:

gem5 Simulator System. https://www.gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version [DEVELOP-FOR-22.1]
gem5 compiled Jun 16 2023 22:18:40
gem5 started Jun 27 2023 10:44:31
gem5 executing on geralt, pid 2208142
command line: /home/msyu/simulator/plct-gem5/build/RISCV/gem5.opt /home/msyu/simulator/plct-gem5/configs/example/se.py -c > rvv_bench

Global frequency set at 1000000000000 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
build/RISCV/mem/dram_interface.cc:690: warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
build/RISCV/sim/simulate.cc:194: info: Entering event queue @ 0. Starting simulation...
build/RISCV/sim/mem_state.cc:443: info: Increasing stack size by one page.
VleffEndMicroInst numSrc: 8, numDestRegs: 0
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
VleffEndMicroInst numSrc: 8, numDestRegs: 0
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
malloc(): smallbin double linked list corrupted
build/RISCV/sim/syscall_emul.cc:85: warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
build/RISCV/sim/syscall_emul.cc:85: warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
build/RISCV/sim/debug.cc:89: warn: need to stop all queues
./run.sh: line 10: 2208142 Trace/breakpoint trap (core dumped) $GEM5 $SE -c $exec

@KellyQueen
Copy link

KellyQueen commented Nov 17, 2023

I have the same issue, but in my case, the C code only contains a helloworld

#include<stdio.h>
int main()
{
printf("This is a C program.\n");
return 0;
}

And the log is

gem5 version [DEVELOP-FOR-22.1]
gem5 compiled Nov 14 2023 12:18:33
gem5 started Nov 17 2023 06:50:53
gem5 executing on 8ce8695cf0bf, pid 17606
command line: build/RISCV/gem5.opt configs/example/se.py --cmd tests/test-progs/hello/bin/riscv/linux/rvv_vadd_static

Global frequency set at 1000000000000 ticks per second
build/RISCV/mem/dram_interface.cc:690: warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
build/RISCV/sim/simulate.cc:194: info: Entering event queue @ 0. Starting simulation...
build/RISCV/sim/mem_state.cc:443: info: Increasing stack size by one page.
VleffEndMicroInst numSrc: 8, numDestRegs: 0
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
VleffEndMicroInst numSrc: 8, numDestRegs: 0
VleffEndMicroInst::execute begin
VleffEndMicroInst::execute getRegOperand done
VleffEndMicroInst::execute getWritableRegOperand done
VleffEndMicroInst::execute new_vl sum done
VleffEndMicroInst::execute setRegOperand done
VleffEndMicroInst::execute end
malloc(): smallbin double linked list corrupted
build/RISCV/sim/syscall_emul.cc:85: warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
build/RISCV/sim/syscall_emul.cc:85: warn: ignoring syscall rt_sigaction(...)
(further warnings will be suppressed)
build/RISCV/sim/debug.cc:89: warn: need to stop all queues
Trace/breakpoint trap (core dumped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants