Skip to content

malloc(): smallbin double linked list corrupted #34

@kobeyu

Description

@kobeyu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions