https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109109
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #12)
> So the problem happens here:
>
> static
> uint32_t
> trx_undo_free_page(
>
> trx_rseg_t* rseg,
> bool in_history,
>
> uint32_t hdr_page_no,
> uint32_t page_no,
>
> mtr_t* mtr,
>
>
> dberr_t* err)
> {
> do { if (__builtin_expect(!(ulint) (hdr_page_no != page_no), (0))) {
> ut_dbg_assertion_failed("hdr_page_no != page_no",
> "/home/abuild/rpmbuild/BUILD/mariadb-10.11.2/storage/innobase/trx/trx0undo.
> cc", 744); } } while (0);
>
> buf_block_t* undo_block = buf_page_get_gen(page_id_t(rseg->space->id,
> page_no),
> 0, RW_X_LATCH, nullptr,
> 10, mtr, err);
> if (__builtin_expect(!undo_block, (0))) {
> return 0xFFFFFFFFU;
> }
> buf_block_t* header_block = buf_page_get_gen(page_id_t(rseg->space->id,
> hdr_page_no), <---- HERE
> 0, RW_X_LATCH, nullptr,
> 10, mtr, err);
> if (__builtin_expect(!header_block, (0))) {
> return 0xFFFFFFFFU;
> }
> ...
>
> the function arguments are:
> #1 0x570e8874 in trx_undo_free_page (rseg=0x57a56c40 <trx_sys+16768>,
> in_history=false, hdr_page_no=807, page_no=817, mtr=0xef4ac434,
> err=0xef4ac3dc) at /tmp/trxundo.ii:181925
>
> and the construction of:
> page_id_t(rseg->space->id, hdr_page_no)
> ends in callee (buf_page_get_gen) with the argument:
>
> (gdb) p page_id
> $5 = {m_id = 0}
>
> while in good run it should be {m_id = 807} !
Ok, can you please print *rseg , rseg->space[0], *mtr and *err at the start of
the function, so that I can try to construct a self-contained testcase?
I assume both buf_page_get_gen return something non-NULL and it doesn't really
matter otherwise what for the reproducer, since e.g. all the further calls can
be noipa handled as completely dummy or even exit (0).