Skip to content

UBSan abort in ext/sockets/sockets.c:373 #16267

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
socket_strerror(-2147483648);

Resulted in this output:

/php-src/ext/sockets/sockets.c:373:11: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/sockets/sockets.c:373:11

Such bugs look nonsensical to me. Shall I keep reporting them?

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions