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

Andrew Schwartzmeyer commented on MESOS-9097:
---------------------------------------------

commit 81597a038
Author: Andrew Schwartzmeyer 
Date:   Wed Jul 18 14:49:56 2018 -0700

    Windows: Added `nullptr` checks when using `libwinio_loop` pointer.
    
    It was discovered that the `Socket` constructor could dereference a
    null pointer (by way of `prepare_async()`) if the Windows IOCP event
    loop had not yet been initialized. So now we check for its
    initialization before each dereference, and return an error or fatal
    log event.
    
    In order to ensure that it is initialized in `test-linkee`, we call
    `process::initialize()`. This should be fixed in the future, per
    MESOS-9097.
    
    Review: https://reviews.apache.org/r/67976

> `libwinio_loop` must be initialized before `Socket` constructor is called
> -------------------------------------------------------------------------
>
>                 Key: MESOS-9097
>                 URL: https://issues.apache.org/jira/browse/MESOS-9097
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 1.7.0
>         Environment: Windows with \{{-DENABLE_LIBWINIO=ON}}
>            Reporter: Andrew Schwartzmeyer
>            Assignee: Akash Gupta
>            Priority: Major
>              Labels: libprocess, windows
>
> When building with {{-DENABLE_LIBWINIO}}, initializing the Windows event loop 
> (specifically the pointer {{process::libwinio_loop}}) becomes a prerequisite 
> to creating a {{Socket}}. If it has not been initialized, then when the 
> {{Socket}} constructor calls {{prepare_async()}}, a null pointer is 
> dereferenced, leading to a hang on Windows.
> This was discovered in the simple program {{test-linkee}} where a {{Socket}} 
> is created and used, but the entire libprocess event loop is unused. This is 
> temporarily fixed by calling {{process::initialize()}} early in 
> {{test-linkee}}, but this should probably not be required. Instead, 
> {{prepare_async()}} (or any use of {{libwinio_loop}} should probably 
> auto-initialize the event loop if required.
> For now, I am adding fatal checks before a null pointer dereference.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to