[ 
https://issues.apache.org/jira/browse/DISPATCH-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Daněk resolved DISPATCH-2290.
----------------------------------
    Fix Version/s: 1.18.0
         Assignee: Jiri Daněk
       Resolution: Not A Problem

The report is a misfire caused by missing libc interceptors in MemorySanitizer. 
See the SO question for details on that.

For msan to work correctly, ideally everything in the program (openssl, 
cyrussasl, python, proton) should be compiled with msan. This is a tall order.

Running Valgrind to check for uninitialized memory use in GHA is possible, it 
takes 1 hour wall time the way sharding and -j2 is set up now. That amounts to 
something like 160 minutes of CPU time. The tests are not excessively flaky, 
even with Valgrind. This means nightly or weekly Valgrind run in some suitable 
CI is a possibility. (The valgrind suppressions file has gone out of date since 
Valgrind was last used in qdrouterd, so it would need to be brought back from 
obsolescence.)

> 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
>            Assignee: Jiri Daněk
>            Priority: Major
>             Fix For: 1.18.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to