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

mpsliban.c:105:10: error: ‘vmParams’ may be used uninitialized [-Werror=maybe-uninitialized] #291

Open
gnusupport opened this issue Nov 2, 2024 · 11 comments
Assignees

Comments

@gnusupport
Copy link

lii6gc: lii6gc/hot/mps.d
lii6gc: lii6gc/hot/mps.o
In file included from mps.c:98:
In function ‘mps_lib_memcpy’,
    inlined from ‘VMArenaCreate’ at arenavm.c:683:9:
mpsliban.c:105:10: error: ‘vmParams’ may be used uninitialized [-Werror=maybe-uninitialized]
  105 |   return memcpy(s1, s2, n);
      |          ^~~~~~~~~~~~~~~~~
In file included from mps.c:35:
arenavm.c: In function ‘VMArenaCreate’:
arenavm.c:603:8: note: ‘vmParams’ declared here
  603 |   char vmParams[VMParamSize];
      |        ^~~~~~~~
cc1: all warnings being treated as errors
gmake[3]: *** [comm.gmk:628: lii6gc/hot/mps.o] Error 1
gmake[3]: Leaving directory '/home/data1/protected/Programming/git/mps/mps-release-1.118.0/code'
gmake[2]: *** [comm.gmk:399: target] Error 2
gmake[2]: Leaving directory '/home/data1/protected/Programming/git/mps/mps-release-1.118.0/code'
gmake[1]: *** [comm.gmk:370: mps.a] Error 2
gmake[1]: Leaving directory '/home/data1/protected/Programming/git/mps/mps-release-1.118.0/code'
make: *** [Makefile:32: build-via-make] Error 2

I am on Debian GNU/Linux Bookworm, is there anyway to get this done? I must use it for Emacs with MPS

@gnusupport
Copy link
Author

I did this in arenavm.c:

  char vmParams[VMParamSize] = {0};

just to continue compiling the release 1.118.0

so maybe that is the correction?

@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

It looks like you are building the MPS as a developer when you might be trying to integrate and deploy it in Emacs. Please see Getting started or Building the Memory Pool System and try building with the simple cc command for integration.

@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

I believe I have seen this warning before and we have a fix, which is needed for development. I will look for it.

@gnusupport
Copy link
Author

I cannot know which files are needed for Emacs to compile it with mps, so I do not know if I should just transfer mps.h somewhere else and what to do with it.

After my correction, above mentioned, it worked, and I installed mps with sudo make install.

Emacs found it so far, is being built, we will see how it works with it.

@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

Please let us know! I've been using Emacs since 1988 and I'm quite interested in this integration.

Also, if you have suggestions for how we can make the documentation clearer (or more obvious) please let us know.

@rptb1 rptb1 self-assigned this Nov 2, 2024
@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

I am on Debian GNU/Linux Bookworm

We must check that this is in our automated build platforms.

@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

I am on Debian GNU/Linux Bookworm

We must check that this is in our automated build platforms.

GitHub doesn't provide a Debian Bookworm build runner. It may not really be necessary if the compiler versions in Ubuntu are similar.

@gerd-moellmann
Copy link

Maybe I should give some info, because I'm sort of the culprit.

First of all, I'm using (my github version of) Emacs with MPS GC for
months now on macOS/arm64 without problems, and it's a really nice
improvement over Emacs' mark-sweep GC in interactive use. The whole
thing feels snappier.

At some point, I ported what I had to the master branch of GNU/Emacs,
where Helmut Eller, Pip Cet, and Eli Zaretskii helped improve the code,
and ported it to GNU/Linux and Windows, IIRC. The code can be found in
the branch scratch/igc on savannah.gnu.org or a mirror.

Pip Cet agreed to take over over further development at some point.
In case someone wonders, I've had my share of maintaining Emacs in
the past (Emacs 21), wanted to do other things, and I'm only using
macOS these days anyway, so I wouldn't be of much help with the rest.

I think there are remainining problems on Linux with signal handlers.
Something like accessing MPS-managed Lisp objects in a SIGPROF
handler, and hitting a memory barrier, which triggers a signal again.
Sorry, I don't remember the details,

Haven't seen a lot of activity in scratch/igc lately, but maybe it
picks up speed again at some point.

I can only say that I'm quite happy with what I have here. Thanks for
MPS :-)!

@rptb1
Copy link
Member

rptb1 commented Nov 2, 2024

I am hoping to investigate MPS + Emacs in more detail soon. My time is unfortunately very limited. I will be asking you for details I'm sure!

@gnusupport
Copy link
Author

Please let us know! I've been using Emacs since 1988 and I'm quite interested in this integration.

Also, if you have suggestions for how we can make the documentation clearer (or more obvious) please let us know.

https://lists.gnu.org/archive/html/emacs-devel/2024-08/msg00135.html
https://lists.gnu.org/archive/html/emacs-devel/

You can participate in emacs-devel mailing list, and how I understand it, the mps is used in the scratch/igc branch to improve Emacs garbage collection. Personally, I suffer with delays due to frequent garbage collection.

Todo list for scratch/igc

- Generate the code to mirror the object graph in a loaded dump in MPS.

- Implement weak hash tables.

- Write the code to handle marker lists, undo list etc.

- Maybe implement weak-ptr for the old GC.

- Make native compilation work on macOS. (Might be fixed with Helmut's
  exact root approach, but can't check because Homebrew libgccjit 14.1
  makes problems when configuring (libgcc_s.dylib not found)).

above is from emacs/admin/IGC-TODO

Then you can read this file:

https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/igc.org?h=scratch/igc

as maybe you could help developing it to work well for Emacs.

@gerd-moellmann
Copy link

I'm afraid these documents are meanwhle seriously out of date. Everything in IGC-TODO has already been done, except for the weak-ptr, which got removed. Just saying. It's probably best to ask on emacs-devel.

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

No branches or pull requests

3 participants