Skip to content

Commit

Permalink
Fixed GH-12494: Zend/tests/arginfo_zpp_mismatch.phpt causes a segfaul…
Browse files Browse the repository at this point in the history
…t withJIT + --repeat 2
  • Loading branch information
dstogov committed Oct 23, 2023
1 parent 52aa0d9 commit e0ca4dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/opcache/zend_shared_alloc.c
Expand Up @@ -252,7 +252,7 @@ int zend_shared_alloc_startup(size_t requested_size, size_t reserved_size)
free(ZSMMG(shared_segments));
ZSMMG(shared_segments) = tmp_shared_segments;

ZSMMG(shared_memory_state).positions = (int *)zend_shared_alloc(sizeof(int) * ZSMMG(shared_segments_count));
ZSMMG(shared_memory_state).positions = (size_t *)zend_shared_alloc(sizeof(size_t) * ZSMMG(shared_segments_count));
if (!ZSMMG(shared_memory_state).positions) {
zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return ALLOC_FAILURE;
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/zend_shared_alloc.h
Expand Up @@ -95,7 +95,7 @@ typedef struct _handler_entry {
} zend_shared_memory_handler_entry;

typedef struct _zend_shared_memory_state {
int *positions; /* current positions for each segment */
size_t *positions; /* current positions for each segment */

This comment has been minimized.

Copy link
@iluuu1994

iluuu1994 Oct 23, 2023

Member

@dstogov This doesn't look ABI-compatible. Can we assume this field isn't used from any extensions?

This comment has been minimized.

Copy link
@dstogov

dstogov Oct 23, 2023

Author Member

@dstogov This doesn't look ABI-compatible. Can we assume this field isn't used from any extensions?

This is a private data structure allocated dynamically. It shouldn't be used by anyone.

size_t shared_free; /* amount of free shared memory */
} zend_shared_memory_state;

Expand Down

0 comments on commit e0ca4dc

Please sign in to comment.