libzmq
  1. libzmq
  2. LIBZMQ-335

CreateEvent() creates incompatibilities with Windows' services; crashes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
    • Environment:

      Windows 7

      Description

      Commit https://github.com/zeromq/libzmq/commit/318ba8836f1e86f23a876788f37406de7c52774c introduces a critical section into signaler.cpp;
      unfortunately, you now cannot use zmq in a windows service and a userland gui component b/c the gui component will crash as it err's on CreateEvent with access denied.

      To test this, create a windows service (as LocalSystem) and a userland program. Start the service, and then attempt to start the user program.

      1. hwclient.cc
        1 kB
        Steven McCoy
      2. hwserver.cc
        1.0 kB
        Steven McCoy

        Activity

        Hide
        Steven McCoy added a comment -

        Example client & server to wrap with srvany.exe.

        Show
        Steven McCoy added a comment - Example client & server to wrap with srvany.exe.
        Hide
        Tom Robinson added a comment -

        Steven,

        I'm not sure which parts you commented out but this is what I've commented out (basically the whole critical section wrapper) and it resolved the problem for me:

        https://github.com/Artesian/libzmq/commit/23a0ffdf5af7d7c62e729c708f71230c1f98387d

        However, the commented out code is presumably there for good reason so I don't know what else might break as a result.

        Show
        Tom Robinson added a comment - Steven, I'm not sure which parts you commented out but this is what I've commented out (basically the whole critical section wrapper) and it resolved the problem for me: https://github.com/Artesian/libzmq/commit/23a0ffdf5af7d7c62e729c708f71230c1f98387d However, the commented out code is presumably there for good reason so I don't know what else might break as a result.
        Hide
        Bill Tutt added a comment -

        Martin: No, your change deals with Unicode/SBCS/MBCS issues. Steven is complaining about the need for Global (as well as integrety level most likely).
        You clearly understand the Global thing, but I didn't know about the Integrity stuff until just now. (It was added in Vista.)

        See http://msdn.microsoft.com/en-us/library/bb250462.aspx#upm_ovwim for more information.

        Steven's user process is most likely running at the Medium integrity level, his service is most likely running at the High integrity level.

        This is also discussed briefly at http://stackoverflow.com/questions/113951/ipc-on-vista-service-and-application

        The excercise the StackOverflow question addresses appears to be: http://msdn.microsoft.com/en-us/windows7trainingcourse_win7session0isolation_topic4#_Toc243675537
        The excercise revolves around allowing the service and user application (system tray app, whatever...) to log to the same file.
        The same rationale applies to the Event object you're trying to create here.

        Yuck. I hope this helps.

        Show
        Bill Tutt added a comment - Martin: No, your change deals with Unicode/SBCS/MBCS issues. Steven is complaining about the need for Global (as well as integrety level most likely). You clearly understand the Global thing, but I didn't know about the Integrity stuff until just now. (It was added in Vista.) See http://msdn.microsoft.com/en-us/library/bb250462.aspx#upm_ovwim for more information. Steven's user process is most likely running at the Medium integrity level, his service is most likely running at the High integrity level. This is also discussed briefly at http://stackoverflow.com/questions/113951/ipc-on-vista-service-and-application The excercise the StackOverflow question addresses appears to be: http://msdn.microsoft.com/en-us/windows7trainingcourse_win7session0isolation_topic4#_Toc243675537 The excercise revolves around allowing the service and user application (system tray app, whatever...) to log to the same file. The same rationale applies to the Event object you're trying to create here. Yuck. I hope this helps.
        Hide
        Matthew Metnetsky added a comment -

        This should be closed as of GitHub Pull Request #404

        Show
        Matthew Metnetsky added a comment - This should be closed as of GitHub Pull Request #404
        Hide
        Martin Hurton added a comment -

        Fixed in 83537916f8e2c61161f06dc84dd21972bb65b5eb.

        Show
        Martin Hurton added a comment - Fixed in 83537916f8e2c61161f06dc84dd21972bb65b5eb.

          People

          • Assignee:
            Unassigned
            Reporter:
            Joshua Weaver
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: