You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Daněk (Jira)" <ji...@apache.org> on 2021/11/19 08:58:00 UTC

[jira] [Comment Edited] (DISPATCH-2290) Use of uninitialized data

    [ https://issues.apache.org/jira/browse/DISPATCH-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446063#comment-17446063 ] 

Jiri Daněk edited comment on DISPATCH-2290 at 11/19/21, 8:57 AM:
-----------------------------------------------------------------

Actually, the code looks correct to me. https://stackoverflow.com/questions/70031993/memorysanitzer-warns-of-use-of-undefined-memory-in-struct-stat-i-do-check-the


was (Author: jdanek):
Actually, the code looks correct to me.

> Use of uninitialized data
> -------------------------
>
>                 Key: DISPATCH-2290
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-2290
>             Project: Qpid Dispatch
>          Issue Type: Bug
>    Affects Versions: 1.18.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> https://github.com/jiridanek/qpid-dispatch/runs/4253734843?check_suite_focus=true#step:28:10895
> {noformat}
> ==2028==WARNING: MemorySanitizer: use-of-uninitialized-value
>     #0 0x56b3c3 in qd_dispatch /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/src/dispatch.c:99:20
>     #1 0x4c2346 in main_process /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/router/src/main.c:92:16
>     #2 0x4c05d8 in main /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/router/src/main.c:369:9
>     #3 0x7f398fd39b74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
>     #4 0x43fdbd in _start (/__w/qpid-dispatch/qpid-dispatch/qpid-dispatch/build/router/qdrouterd+0x43fdbd)
>   Uninitialized value was created by an allocation of 'st' in the stack frame of function 'qd_dispatch'
>     #0 0x56ab90 in qd_dispatch /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/src/dispatch.c:77
> SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/src/dispatch.c:99:20 in qd_dispatch
> {noformat}
> {code}
>         struct stat st;
>         if (stat(python_pkgdir, &st)) {
>             qd_error_errno(errno, "Cannot find Python library path '%s'", python_pkgdir);
>             return NULL;
>         } else if (!S_ISDIR(st.st_mode)) {
>             qd_error(QD_ERROR_RUNTIME, "Python library path '%s' not a directory", python_pkgdir);
>             return NULL;
>         }
> {code}
> -The problem looks obvious. If {{stat}} function fails, dispatch tries to examine {{st.st_mode}}. Looks like a trivial coding mistake.-
> This issue highlights that we don't currently regularly run undefined-memory checker with qdrouterd.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org