Open kitaharazy opened 2 years ago
I feel like this is a bug. because the memory indeed is freed by realloc.
We should report this bug to the developers. This benchmark has been run by many tools, none of them found this bug.
We should report this bug to the developers. This benchmark has been run by many tools, none of them found this bug.
Sure, I found the webpage: https://www.spec.org/spec/contact.html
As what they say:
Please direct general technical questions regarding SPEC benchmark products to SPEC's staff at support@spec.org. We can provide assistance only with issues directly related to running the benchmark software. Examples of support that SPEC cannot provide include: hardware installation issues; hardware problems; non-SPEC software installation issues; non-SPEC software problems; hardware or software specific tuning.
Should we directly drop a mail to support@spec.org, or we need to find the developers of SPECCPU?
Trigger the bug
In short, in realloc, we gonna call
void Free(void *ptr, void *end)
in/home/roland/github/violet/src/safe_tcmalloc/tcmalloc/span.h:165
,during the while loop,
PL_tmps_stack[330]->sv_any
isend-0x10
,and it will be poisioned by Free,
cur->addr == &PL_tmps_stack[330]->sv_any
.After being poisioned,
PL_tmps_stack[330]->sv_any
will be accessed in the following codes, so there is a segfault.In case 500, there are several global vars, such as
(SV **)PL_tmps_stack
,PL_tmps_ix
,PL_tmps_max
, these three vars are related to this bug.About PL_tmps_stack[330], PL_tmps_stack[330]->sv_any will be poisioned during realloc PL_tmps_stack[]
the backtrace:
in backtrace,
&PL_tmps_stack[0] = 0x56c33fbb2c80
,&PL_tmps_stack[330] = 0x56c33fbb36d0
,&PL_tmps_stack[330]->sv_any = 0x56c33eba82e8
,PL_tmps_stack[330]->sv_any = 0x56c33fbb38f0
(before being poisioned)In
do_free_with_size_class<false, (tcmalloc::tcmalloc_internal::Hooks)0> (size_class=0, ptr=PL_tmps_stack)
span_->GetEscapeTable()->Free(ptr);
will finally be called as:Therefore, as for
PL_tmps_stack[330]->sv_any = 0x56c33fbb38f0
, it is in the range of (ptr , end = obj_size+ptr) , and will be poisioned in the loop at tcmalloc/span.h:165debug script
First you will stop at
Renew()
beforerealloc
is called, then usewatch PL_tmps_stack[330]->sv_any
andcontinue
, you will stop atdelete_escape(cur);
in safe_tcmalloc/tcmalloc/span.h:188