Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erlang 26 regression: erlang:list_to_pid fails on 32-bit x86, ERTS_MAX_INTERNAL_PID_SERIAL is 0? #7460

Closed
leahneukirchen opened this issue Jul 1, 2023 · 2 comments
Labels
bug Issue is reported as a bug not a bug Issue is determined as not a bug by OTP

Comments

@leahneukirchen
Copy link

Describe the bug

The symptom of the bug is that erlang:list_to_pid doesn't work anymore, except for <0.N.0> (<0.0.0> is unit-tested...).

To Reproduce

2> erlang:list_to_pid("<0.0.1>").
               ** exception error: bad argument
     in function  list_to_pid/1
        called as list_to_pid("<0.0.1>")
        *** argument 1: not a textual representation of a pid

Expected behavior

It should return the PID <0.0.1>.

Affected versions

I can reproduce this on OTP 26.0.2/erts-14.0.2.

It worked on OTP 25/erts-13.2.2 and on 64-bit platforms.

Additional context

It turns out that ERTS_MAX_INTERNAL_PID_SERIAL is 0 now, is this intentional?

@rickard-green
Copy link
Contributor

This is not a bug.

It turns out that ERTS_MAX_INTERNAL_PID_SERIAL is 0 now, is this intentional?

Yes. 32-bit emulators does not as of OTP 26 create pids for local processes with non-zero serial values.

list_to_pid/1 is intended to create a pid of a process that exist on the system. Since no local process on a 32-bit system can have a pid with a non-zero serial value it would be pointless with a list_to_pid/1 that could create such pid. Also note that list_to_pid/1 is purely intended for debugging and also clearly documented as such.

@rickard-green rickard-green added the not a bug Issue is determined as not a bug by OTP label Jul 1, 2023
@leahneukirchen
Copy link
Author

Thanks for the quick clarification, then I'll make sure that the Elixir test using this calls it with a 0 as serial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug not a bug Issue is determined as not a bug by OTP
Projects
None yet
Development

No branches or pull requests

2 participants