[PATCH 1/2] app/mldev: fix build with debug
David Marchand
david.marchand at redhat.com
Mon Mar 20 11:40:37 CET 2023
On Mon, Mar 20, 2023 at 11:26 AM David Marchand
<david.marchand at redhat.com> wrote:
> ../app/test-mldev/test_inference_common.c:952:48: note: using the range
> [-2147483648, 2147483647] for directive argument
> 952 | snprintf(str, sizeof(str) - 1, "%s.%d",
> | ^~~~~~~
> t->cmn.opt->filelist[req->fid].output, obj_idx);
> ../app/test-mldev/test_inference_common.c:952:17: note: ‘snprintf’
> output between 3 and 4108 bytes into a destination of size 4095
> 952 | snprintf(str, sizeof(str) - 1, "%s.%d",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> t->cmn.opt->filelist[req->fid].output, obj_idx);
[...]
>
> Fix unsigned integer format, and switch to dynamic allocations.
>
[...]
> @@ -943,14 +948,20 @@ ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
> dump_output_fail:
> if (t->cmn.opt->debug) {
> /* dump quantized output buffer */
> - snprintf(str, PATH_MAX, "%s.q.%d", t->cmn.opt->filelist[req->fid].output, obj_idx);
> - ML_OPEN_WRITE_GET_ERR(str, req->output, model->out_qsize, error);
> + if (asprintf(&dump_path, "%s.q.%d", t->cmn.opt->filelist[req->fid].output,
Sent the wrong patch... I forgot to add the change (fixing with %u)
when amending the commitlog.
> + obj_idx) == -1)
> + return;
> + ML_OPEN_WRITE_GET_ERR(dump_path, req->output, model->out_qsize, error);
> + free(dump_path);
> if (error)
> return;
>
--
David Marchand
More information about the dev
mailing list