Windows error 0x000001E7, 487

Detailed Error Information

INVALID_ADDRESS[1]

MessageAttempt to access invalid address.
Declared inwinerror.h

This appears to be a raw Win32 error. More information may be available in error 0x800701E7.

HRESULT analysis[2]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[2][1]
DescriptionThe default facility code.[2][1]
Error Code487 (0x01e7)

Possible solutions

3

WordPress Apache VirtualAlloc and VirtualFree failed, PHP out of memory

php
wordpress
apache

Not sure this is can help as WordPress does not use PHP native sessions, but can be, that some plugins are using.

My situation: Windows OS, PHP 7.0.6 - 7.0.11
VirtuaAlloc fails due the php session usage. http://php.net/manual/en/features.sessions.php I've removed/replaced all php session_ functions with mine own.

Howto reproduce: session_start(); do parse some huge xml (150MB or more) file do run multiple times same script at the same time on the Apache server.

answered on Stack Overflow Oct 14, 2016 by Slider • edited Oct 14, 2016 by Slider
2

CreateService get error: ERROR_INVALID_ADDRESS (0x000001e7)

c++
winapi
service

With the exception of the schSCManager and szPath variables, all of the other variables you are passing to CreateService() have not been initialized, they contain random values. That is especially important for the psz... variables, because they are pointers, so you are effectively passing random memory addresses to CreateService(). That is why you are getting an ERROR_INVALID_ADDRESS error.

You need to initialize your variables!

pszServiceName needs to point at a null-terminated string containing the desired service name.

pszDisplayName needs to point at a null-terminated string containing the desired service display name.

dwStartType needs to contain a valid start type integer value.

pszDependencies needs to either be NULL, or point at a double-null-terminated string containing a list of null-separated service names that your service depends on.

pszAccount needs to either be NULL or point at a null-terminated string containing the desired user account that the service runs under.

pszPassword needs to either be NULL or point at a null-terminated string containing the password for the pszAccount account.

Edit: You are better off simply getting rid of the variables altogether and pass the desired values directly to CreateService(). Try this:

#include "stdafx.h"

void __cdecl _tmain(int argc, TCHAR *argv[]) 
{ 
    wchar_t szPath[MAX_PATH+1];
    SC_HANDLE schSCManager = NULL;
    SC_HANDLE schService = NULL;

    if (GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath)) == 0)
    {
        wprintf(L"GetModuleFileName failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Open the local default service control manager database
    schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE);
    if (schSCManager == NULL)
    {
        wprintf(L"OpenSCManager failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    // Install the service into SCM by calling CreateService
    schService = CreateService(
        schSCManager,                   // SCManager database
        L"Win32_Service,                // Name of service
        L"My Service,                   // Name to display
        SERVICE_QUERY_STATUS,           // Desired access
        SERVICE_WIN32_OWN_PROCESS,      // Service type
        SERVICE_DEMAND_START,           // Service start type
        SERVICE_ERROR_NORMAL,           // Error control type
        szPath,                         // Service's binary
        NULL,                           // No load ordering group
        NULL,                           // No tag identifier
        NULL,                           // No Dependencies
        L"NT AUTHORITY\\LocalService",  // Service running account
        NULL                            // No Password of the account
        );
    if (schService == NULL)
    {
        wprintf(L"CreateService failed w/err 0x%08lx\n", GetLastError());
        goto Cleanup;
    }

    wprintf(L"Service is installed.\n");

Cleanup:
    // Centralized cleanup for all allocated resources.
    if (schService)
    {
        CloseServiceHandle(schService);
        schService = NULL;
    }
    if (schSCManager)
    {
        CloseServiceHandle(schSCManager);
        schSCManager = NULL;
    }
} 
answered on Stack Overflow Nov 15, 2013 by Remy Lebeau • edited Nov 15, 2013 by Remy Lebeau
1

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command

php
wordpress
windows
apache

I have exactly the same problem (except for I have my own code only - without Wordpress or other framework).

Wasted some time trying to find solution, but without success. Maybe this would help someone in further investigation.

Config:

Windows2008R2, 16GB RAM, Apache 2.4, PHP7 (using XAMPP for Windows 7.1.7-0)

Average load is 100 requests/sec.

<IfModule mpm_winnt_module>
    ThreadsPerChild        450
    MaxConnectionsPerChild   0
</IfModule>

Logs info:

After repeating

VirtualAlloc() failed: [0x00000008] Not enough storage is available to process this command.
VirtualFree() failed: [0x000001e7] Attempt to access invalid address

child process restarts with one of the codes:

AH00428: Parent: child process 6416 exited with status 3221225477 -- Restarting.
AH00428: Parent: child process 1976 exited with status 255 -- Restarting.

PHP log says there are memory issues (pointing random files, random lines and even Unknown):

PHP Fatal error:  Out of memory (allocated 2097152) (tried to allocate 24576 bytes) in Unknown on line 0

Actually I cannot figure out where 2097152 come from. PHP memory_limit is set to 256M.

Answer to similar topic mentioned sessions and my app utilizes them too, but not saying if it may cause the problem. My tmp folder has 1400 session files 40Mb total (max session file is 100K).

answered on Stack Overflow Nov 1, 2017 by DenisFrost

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0