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

Build errors under Ubuntu 22.04 #1089

Closed
lread opened this issue May 2, 2022 · 0 comments · Fixed by #1090
Closed

Build errors under Ubuntu 22.04 #1089

lread opened this issue May 2, 2022 · 0 comments · Fixed by #1090

Comments

@lread
Copy link
Contributor

lread commented May 2, 2022

While looking at #1087, I noticed the following while running script/build -Werror --fast against planck master on Ubuntu 22.04:

In function 'maybe_load_user_file',
    inlined from 'maybe_load_user_file' at /planck/planck-c/engine.c:414:6:
/planck/planck-c/engine.c:418:9: error: 'JSObjectCallAsFunction' reading 8 bytes from a region of size 0 [-Werror=stringop-overread]
  418 |         JSObjectCallAsFunction(ctx, get_function("planck.repl", "maybe-load-user-file"), JSContextGetGlobalObject(ctx),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  419 |                                0, arguments, &ex);
      |                                ~~~~~~~~~~~~~~~~~~
/planck/planck-c/engine.c: In function 'maybe_load_user_file':
/planck/planck-c/engine.c:418:9: note: referencing argument 5 of type 'const struct OpaqueJSValue * const*'

And this note that arguments should be NULL when argumentCount is 0:

arguments
A JSValueRef array of arguments to pass to the function. Pass NULL if argumentCount is 0.

And things do pass after correcting this on Ubuntu 22, but still seg fault on Ubuntu 20.

Originally posted by @lread in #1087 (comment)

Since Ubuntu 22.04 has been officially released, probably a good idea to address.
I'll follow up with a PR.

lread added a commit to lread/planck that referenced this issue May 2, 2022
When calling `JSObjectCallAsFunction`, the `arguments` parameter should
be `NULL` when the `argumentCount` parameter is 0.

But... we were passing an empty array for the `arguments` parameter.

There is something new/different in Ubuntu 22.04 that raises a warning
around this.

Closes planck-repl#1089
lread added a commit to lread/planck that referenced this issue May 2, 2022
When calling `JSObjectCallAsFunction`, the `arguments` parameter should
be `NULL` when the `argumentCount` parameter is 0.

But... we were passing an empty array for the `arguments` parameter.

There is something new/different in Ubuntu 22.04 that raises a warning
around this.

Closes planck-repl#1089
mfikes pushed a commit that referenced this issue May 13, 2022
* Address build errors for Ubuntu 22.04

When calling `JSObjectCallAsFunction`, the `arguments` parameter should
be `NULL` when the `argumentCount` parameter is 0.

But... we were passing an empty array for the `arguments` parameter.

There is something new/different in Ubuntu 22.04 that raises a warning
around this.

Closes #1089

* CHANGELOG update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant