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:monotonic_time(native) invalid #6165

Closed
crownedgrouse opened this issue Jul 23, 2022 · 2 comments · Fixed by #6213
Closed

erlang:monotonic_time(native) invalid #6165

crownedgrouse opened this issue Jul 23, 2022 · 2 comments · Fixed by #6213
Assignees
Labels
bug Issue is reported as a bug in progress team:VM Assigned to OTP team VM

Comments

@crownedgrouse
Copy link
Contributor

Describe the bug
Documentation of erlang:monotonic_time/1 says that argument must be of type erlang:time_unit() which includes native, but native is not allowed.

To Reproduce

17> erlang:monotonic_time(second).
-576460358
18> erlang:monotonic_time(native).
** exception error: bad argument
     in function  erlang:monotonic_time/1
        called as erlang:monotonic_time(native)
        *** argument 1: invalid time unit

Expected behavior
Either documentation or function is wrong. I would expect native argument to return erlang:monotonic_time/0 value ?

Affected versions
24.3 and 25 at least.

@crownedgrouse crownedgrouse added the bug Issue is reported as a bug label Jul 23, 2022
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jul 25, 2022
@rickard-green rickard-green self-assigned this Aug 8, 2022
@rickard-green
Copy link
Contributor

Thanks for the bug report! I've made a fix in the #6213 PR (not very well tested yet). The fix will be part of the next patch unless something unexpected happens.

rickard-green added a commit that referenced this issue Aug 15, 2022
* rickard/native_time_unit_fix/GH-6165/OTP-18197:
  [erts] Accept native time unit where documented as supported
lthor pushed a commit that referenced this issue Aug 18, 2022
…int-24

* rickard/native_time_unit_fix/GH-6165/OTP-18197:
  [erts] Accept native time unit where documented as supported
rickard-green pushed a commit that referenced this issue Aug 18, 2022
…int-25

* rickard/native_time_unit_fix/GH-6165/OTP-18197:
  [erts] Accept native time unit where documented as supported
@rickard-green
Copy link
Contributor

rickard-green commented Aug 18, 2022

Fixed in patches OTP 25.0.4 and OTP 24.3.4.3 which we released today.

kikofernandez pushed a commit that referenced this issue Sep 5, 2022
…int-23

* rickard/native_time_unit_fix/GH-6165/OTP-18197:
  [erts] Accept native time unit where documented as supported
u3s pushed a commit that referenced this issue Mar 18, 2024
…int-22

* rickard/native_time_unit_fix/GH-6165/OTP-18197:
  [erts] Accept native time unit where documented as supported
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 in progress team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants