FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bug in runtime.cs Runtime.Initialize() method. · Issue #445 · pythonnet/pythonnet · GitHub

Repository navigation

Bug in runtime.cs Runtime.Initialize() method. #445

Closed

Description

Environment

Almost any.

Details

Probably bugs in the source code.

  • Describe what you were trying to get done.
    Just code review.

file: runtime.cs, line ~281

#if PYTHON3
            IntPtr dllLocal = IntPtr.Zero;
            if (PythonDll != "__Internal")
            {
                // Current. !!!!!!! BUG HERE !!!!!!!
                NativeMethods.LoadLibrary(PythonDll); 

                // Brobably correct version
                dllLocal = NativeMethods.LoadLibrary(PythonDll); 
            }
            _PyObject_NextNotImplemented = NativeMethods.GetProcAddress(dllLocal, "_PyObject_NextNotImplemented");
#if !(MONO_LINUX || MONO_OSX)
            if (dllLocal != IntPtr.Zero)
            {
                // Another !!!! BUG !!!
                // _PyObject_NextNotImplemented - Pointer can stay invalid after Library dispose.
                // This code will be valid only if Windows preserve proc addresses on each DLL load
               // But it can be changed. For example Win7 x86 = ok,    Win10 x64 = oops, addresses drift.
                NativeMethods.FreeLibrary(dllLocal);
            }
#endif
#endif

Activity

  1. vmuriart commented on Mar 29, 2017

    Contributor

    Is this actually causing you an issue? I looked into this too a while back and couldn't make it produce an error even though the syntax looks wrong. If I remember right 'dllLocal' ends up getting assigned in Linux but not on windows.

    Since I couldn't reproduce an actual bug I left the code as is.

  2. den-run-ai commented on Mar 29, 2017

    Contributor

    @dmitriyse can you provide a use case or ideally a test when this issue is reproduced?

  3. den-run-ai commented on Jun 6, 2017

    Contributor

    closing due to inactivity, not reproducible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL