Bug #436

ud process core dumps when cache reallocates the buffer and output buffer is different (for tpcall) than input buffer

Added by Madars over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:08/07/2019
Priority:Normal (Code 4)Due date:
Assignee:-% Done:

100%

Category:-
Target version:-

Description

Program terminated with signal 11, Segmentation fault.
#0  0x00007f7b6ba42fe3 in validate_entry (p_ub=p_ub@entry=0x7f7b6a3a8010, bfldid=bfldid@entry=0, occ=occ@entry=0, mode=mode@entry=1) at /home/user1/endurox/libubf/ubf_impl.c:913
913    /home/user1/endurox/libubf/ubf_impl.c: No such file or directory.
Missing separate debuginfos, use: debuginfo-install endurox-7.0.1-1.x86_64
(gdb) where
#0  0x00007f7b6ba42fe3 in validate_entry (p_ub=p_ub@entry=0x7f7b6a3a8010, bfldid=bfldid@entry=0, occ=occ@entry=0, mode=mode@entry=1) at /home/user1/endurox/libubf/ubf_impl.c:913
#1  0x00007f7b6ba49f18 in Bprint (p_ub=0x7f7b6a3a8010) at /home/user1/endurox/libubf/ubf.c:1632
#2  0x0000000000400d9b in main ()
(gdb) 

History

#1 Updated by Madars over 4 years ago

so needs test case when request and cached merged response has different ubf buffers.

#2 Updated by Madars over 4 years ago

        p_ub = (UBFH *)idata; <<< why not odata?

        if (NULL==(p_ub_cache = (UBFH *)tpalloc("UBF", NULL, 1024)))
        {
            NDRX_CACHE_ERROR("Failed to realloc input buffer %p to size: %ld: %s",
                    idata, *olen, tpstrerror(tperrno));
            EXFAIL_OUT(ret);
        }

        /* we cannot do this way, because stored format is different than UBF... */

        if (EXSUCCEED!=buf_type->pf_prepare_incoming(buf_type, exdata->atmi_buf,
                exdata->atmi_buf_len, (char **)&p_ub_cache, &olen_merge, flags))
        {
            /* the error shall be set already */
            NDRX_LOG(log_error, "Failed to prepare data from cache to buffer");
            EXFAIL_OUT(ret);
        }

#3 Updated by Madars over 4 years ago

seems like we need to prepare incoming form ibuf to obuf. then reallocate the obuf and merge with cache data.

#4 Updated by Madars over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#5 Updated by Madars over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF