Bug #79751 [Opn]: "VirtualProtect() failed" entries in apache error.log

From: Date: Tue, 30 Jun 2020 13:18:21 +0000
Subject: Bug #79751 [Opn]: "VirtualProtect() failed" entries in apache error.log
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227743@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79751&edit=1

 ID:                 79751
 User updated by:    buschmann at nidsa dot net
 Reported by:        buschmann at nidsa dot net
 Summary:            "VirtualProtect() failed" entries in apache
                     error.log
 Status:             Open
 Type:               Bug
 Package:            Apache2 related
 Operating System:   Windows Server 2019 64bit
 PHP Version:        8.0.0alpha1
 Block user comment: N
 Private report:     N

 New Comment:

When setting opcache.jit_buffer_size=16M and a fresh start the error messages in error.log disappear
!!

But I have only  used the defaults, so maybe JIT=On and opcache.jit_buffer_size=0 don't play
well together...

BUT: I have also found, that not all opcache config parameters are reported by phpinfo:

In my config file I had set 

opcache.huge_code_pages=1

which is not reported as seen below.

BTW: seems OK with huge_pages=1 in a second test,
BUT in the documentation the flag should be marked as boolean, not string:
(from online manual)

 opcache.huge_code_pages string 

Here are the opcache data from phpinfo after fresh start, scripts reloads and some test with the
application, which seems working OK (huge pages disabled for now!):

Opcode Caching 	Up and Running
Optimization 	Enabled
SHM Cache 	Enabled
File Cache 	Disabled
JIT 	On
Startup 	OK
Shared memory model 	win32
Cache hits 	47
Cache misses 	299
Used memory 	22870456
Free memory 	10683976
Wasted memory 	0
Interned Strings Used memory 	2597400
Interned Strings Free memory 	547856
Cached scripts 	299
Cached keys 	538
Max keys 	983
OOM restarts 	0
Hash keys restarts 	0
Manual restarts 	0 

opcache.blacklist_filename	no value	no value
opcache.cache_id	no value	no value
opcache.consistency_checks	0	0
opcache.dups_fix	Off	Off
opcache.enable	On	On
opcache.enable_cli	Off	Off
opcache.enable_file_override	Off	Off
opcache.error_log	no value	no value
opcache.file_cache	no value	no value
opcache.file_cache_consistency_checks	On	On
opcache.file_cache_fallback	On	On
opcache.file_cache_only	Off	Off
opcache.file_update_protection	2	2
opcache.force_restart_timeout	180	180
opcache.interned_strings_buffer	4	4
opcache.jit	1205	1205
opcache.jit_bisect_limit	0	0
opcache.jit_blacklist_root_trace	16	16
opcache.jit_blacklist_side_trace	8	8
opcache.jit_buffer_size	16M	16M
opcache.jit_debug	0	0
opcache.jit_hot_func	127	127
opcache.jit_hot_loop	64	64
opcache.jit_hot_return	8	8
opcache.jit_hot_side_exit	8	8
opcache.jit_max_loops_unroll	8	8
opcache.jit_max_polymorphic_calls	2	2
opcache.jit_max_recursive_calls	2	2
opcache.jit_max_recursive_returns	2	2
opcache.jit_max_root_traces	1024	1024
opcache.jit_max_side_traces	128	128
opcache.jit_prof_threshold	0.005	0.005
opcache.log_verbosity_level	1	1
opcache.max_accelerated_files	980	980
opcache.max_file_size	0	0
opcache.max_wasted_percentage	5	5
opcache.memory_consumption	32	32
opcache.mmap_base	no value	no value
opcache.opt_debug_level	0	0
opcache.optimization_level	0x7FFEBFFF	0x7FFEBFFF
opcache.preferred_memory_model	no value	no value
opcache.preload	no value	no value
opcache.protect_memory	Off	Off
opcache.record_warnings	Off	Off
opcache.restrict_api	no value	no value
opcache.revalidate_freq	60	60
opcache.revalidate_path	Off	Off
opcache.save_comments	Off	Off
opcache.use_cwd	On	On
opcache.validate_permission	Off	Off
opcache.validate_timestamps	On	On


Previous Comments:
------------------------------------------------------------------------
[2020-06-30 11:30:44] cmb@php.net

> JIT 	On
> opcache.jit_buffer_size	0	0

That looks pretty strange to me.  Would you still get the
"VirtualProtect() failed" errors, if you set
opcache.jit_buffer_size=16M?

------------------------------------------------------------------------
[2020-06-30 09:18:28] buschmann at nidsa dot net

I have not changed any configuration for opcache/jit from the proven values of version 7.x.x (for
opcache mostly the buffer/string sizes).

JIT seems to be ON by default as is the case here.

Here are the complete config settings from Zend OPcache from phpinfo:
 
Opcode Caching 	Up and Running
Optimization 	Enabled
SHM Cache 	Enabled
File Cache 	Disabled
JIT 	On
Startup 	OK
Shared memory model 	win32
Cache hits 	0
Cache misses 	1
Used memory 	4242384
Free memory 	29312048
Wasted memory 	0
Interned Strings Used memory 	199520
Interned Strings Free memory 	2945736
Cached scripts 	1
Cached keys 	2
Max keys 	983
OOM restarts 	0
Hash keys restarts 	0
Manual restarts 	0 

opcache.blacklist_filename	no value	no value
opcache.cache_id	no value	no value
opcache.consistency_checks	0	0
opcache.dups_fix	Off	Off
opcache.enable	On	On
opcache.enable_cli	Off	Off
opcache.enable_file_override	Off	Off
opcache.error_log	no value	no value
opcache.file_cache	no value	no value
opcache.file_cache_consistency_checks	On	On
opcache.file_cache_fallback	On	On
opcache.file_cache_only	Off	Off
opcache.file_update_protection	2	2
opcache.force_restart_timeout	180	180
opcache.interned_strings_buffer	4	4
opcache.jit	1205	1205
opcache.jit_bisect_limit	0	0
opcache.jit_blacklist_root_trace	16	16
opcache.jit_blacklist_side_trace	8	8
opcache.jit_buffer_size	0	0
opcache.jit_debug	0	0
opcache.jit_hot_func	127	127
opcache.jit_hot_loop	64	64
opcache.jit_hot_return	8	8
opcache.jit_hot_side_exit	8	8
opcache.jit_max_loops_unroll	8	8
opcache.jit_max_polymorphic_calls	2	2
opcache.jit_max_recursive_calls	2	2
opcache.jit_max_recursive_returns	2	2
opcache.jit_max_root_traces	1024	1024
opcache.jit_max_side_traces	128	128
opcache.jit_prof_threshold	0.005	0.005
opcache.log_verbosity_level	1	1
opcache.max_accelerated_files	980	980
opcache.max_file_size	0	0
opcache.max_wasted_percentage	5	5
opcache.memory_consumption	32	32
opcache.mmap_base	no value	no value
opcache.opt_debug_level	0	0
opcache.optimization_level	0x7FFEBFFF	0x7FFEBFFF
opcache.preferred_memory_model	no value	no value
opcache.preload	no value	no value
opcache.protect_memory	Off	Off
opcache.record_warnings	Off	Off
opcache.restrict_api	no value	no value
opcache.revalidate_freq	60	60
opcache.revalidate_path	Off	Off
opcache.save_comments	Off	Off
opcache.use_cwd	On	On
opcache.validate_permission	Off	Off
opcache.validate_timestamps	On	On

------------------------------------------------------------------------
[2020-06-30 07:25:57] cmb@php.net

I think these log entries are from OPcache JIT.  Do you have JIT
enabled (see PHP info)?

------------------------------------------------------------------------
[2020-06-29 15:42:19] buschmann at nidsa dot net

when I set opcache.protect_memory=0 (verified in php_info

opcache.protect_memory	Off	Off)

the problem stays the same.

I don't know the internals, but the sripts in the web application are working in both
situations.

------------------------------------------------------------------------
[2020-06-29 08:49:49] nikic@php.net

Does the problem go away if you set opcache.protect_memory=0? This is an debugging setting, that
should not be enabled for production opcache use.

Of course, it still shouldn't cause failures...

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=79751


--
Edit this bug report at https://bugs.php.net/bug.php?id=79751&edit=1


Thread (26 messages)

« previous php.bugs (#227743) next »