unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
@ 2021-10-17 20:49 Håkon Hægland
  2021-10-18  2:28 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Håkon Hægland @ 2021-10-17 20:49 UTC (permalink / raw)
  To: 51254

[-- Attachment #1: Type: text/plain, Size: 7354 bytes --]

I am trying to install emacs 27.2 from source on Ubuntu 21.10:

$ gcc --version
gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0

$ wget http://ftp.gnu.org/gnu/emacs/emacs-27.2.tar.gz
$ tar zvxf emacs-27.2.tar.gz
$ cd emacs-27.2
$ ./configure --prefix=/opt/emacs27.2
$ make
make -C lib all
make[1]: Entering directory '/home/hakon/test/install_emacs/emacs-27.2/lib'
  GEN      alloca.h
  GEN      dirent.h
  GEN      fcntl.h
  GEN      inttypes.h
  GEN      limits.h
  GEN      signal.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
  GEN      sys/select.h
  GEN      sys/stat.h
  GEN      sys/time.h
  GEN      sys/types.h
  GEN      time.h
  GEN      unistd.h
  CC       fingerprint.o
  CC       fcntl.o
  CC       fsusage.o
  CC       regex.o
  CC       sig2str.o
  CC       time_rz.o
  CC       acl-errno-valid.o
  CC       acl-internal.o
  CC       get-permissions.o
  CC       set-permissions.o
  CC       allocator.o
  CC       binary-io.o
  CC       c-ctype.o
  CC       c-strcasecmp.o
  CC       c-strncasecmp.o
  CC       careadlinkat.o
careadlinkat.c: In function ‘careadlinkat’:
cc1: warning: function may return address of local variable
[-Wreturn-local-addr]
careadlinkat.c:73:8: note: declared here
   73 |   char stack_buf[1024];
      |        ^~~~~~~~~
  CC       close-stream.o
  CC       count-leading-zeros.o
  CC       count-one-bits.o
  CC       count-trailing-zeros.o
  CC       md5.o
  CC       sha1.o
  CC       sha256.o
  CC       sha512.o
  CC       dtoastr.o
  CC       dtotimespec.o
  CC       filemode.o
  CC       filevercmp.o
  CC       gettime.o
  CC       nstrftime.o
  CC       pipe2.o
  CC       qcopy-acl.o
  CC       stat-time.o
  CC       tempname.o
  CC       timespec.o
  CC       timespec-add.o
  CC       timespec-sub.o
  CC       u64.o
  CC       unistd.o
  CC       utimens.o
utimens.c: In function ‘fdutimens’:
utimens.c:382:17: warning: ‘update_timespec’ accessing 16 bytes in a region
of size 8 [-Wstringop-overflow=]
  382 |       if (ts && update_timespec (&st, &ts))
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
utimens.c:382:17: note: referencing argument 2 of type ‘struct timespec **’
utimens.c:133:1: note: in a call to function ‘update_timespec’
  133 | update_timespec (struct stat const *statbuf, struct timespec *ts[2])
      | ^~~~~~~~~~~~~~~
utimens.c: In function ‘lutimens’:
utimens.c:595:17: warning: ‘update_timespec’ accessing 16 bytes in a region
of size 8 [-Wstringop-overflow=]
  595 |       if (ts && update_timespec (&st, &ts))
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
utimens.c:595:17: note: referencing argument 2 of type ‘struct timespec **’
utimens.c:133:1: note: in a call to function ‘update_timespec’
  133 | update_timespec (struct stat const *statbuf, struct timespec *ts[2])
      | ^~~~~~~~~~~~~~~
  CC       openat-die.o
  CC       save-cwd.o
  AR       libgnu.a
make[1]: Leaving directory '/home/hakon/test/install_emacs/emacs-27.2/lib'
make -C lib-src all
make[1]: Entering directory
'/home/hakon/test/install_emacs/emacs-27.2/lib-src'
  CCLD     etags
  CCLD     ctags
etags.c: In function ‘main’:
cc1: warning: ‘__builtin_memcpy’ writing 12 bytes into a region of size
between 0 and 7 [-Wstringop-overflow=]
In file included from ctags.c:2:
etags.c:1395:21: note: destination object of size [0, 7] allocated by
‘xmalloc’
 1395 |         char *cmd = xmalloc (2 * strlen (tagfile) + sizeof "sort -u
-o..");
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
etags.c:1401:14: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
 1401 |         *z++ = ' ';
      |         ~~~~~^~~~~
etags.c:1395:21: note: at offset 11 into destination object of size [0, 7]
allocated by ‘xmalloc’
 1395 |         char *cmd = xmalloc (2 * strlen (tagfile) + sizeof "sort -u
-o..");
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:519,
                 from ../lib/string.h:41,
                 from etags.c:120,
                 from ctags.c:2:
In function ‘stpcpy’,
    inlined from ‘main’ at etags.c:1400:6:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:86:10: warning:
‘__builtin_stpcpy’ writing 1 or more bytes into a region of size 0
overflows the destination [-Wstringop-overflow=]
   86 |   return __builtin___stpcpy_chk (__dest, __src, __glibc_objsize
(__dest));
      |
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ctags.c:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h: In function ‘main’:
etags.c:1395:21: note: at offset 11 into destination object of size [0, 7]
allocated by ‘xmalloc’
 1395 |         char *cmd = xmalloc (2 * strlen (tagfile) + sizeof "sort -u
-o..");
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:519,
                 from ../lib/string.h:41,
                 from etags.c:120,
                 from ctags.c:2:
In function ‘strcpy’,
    inlined from ‘main’ at etags.c:1402:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:79:10: warning:
‘__builtin_strcpy’ writing 1 or more bytes into a region of size 0
overflows the destination [-Wstringop-overflow=]
   79 |   return __builtin___strcpy_chk (__dest, __src, __glibc_objsize
(__dest));
      |
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ctags.c:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h: In function ‘main’:
etags.c:1395:21: note: at offset 12 into destination object of size [0, 7]
allocated by ‘xmalloc’
 1395 |         char *cmd = xmalloc (2 * strlen (tagfile) + sizeof "sort -u
-o..");
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CCLD     emacsclient
  CCLD     ebrowse
  CCLD     hexl
  CC       pop.o
  CCLD     movemail
  CCLD     make-docfile
  CCLD     make-fingerprint
make[1]: Leaving directory
'/home/hakon/test/install_emacs/emacs-27.2/lib-src'
make -C src VCSWITNESS='' all
make[1]: Entering directory '/home/hakon/test/install_emacs/emacs-27.2/src'
  GEN      lisp.mk
  GEN      globals.h
  CC       dispnew.o
  CC       frame.o
  CC       scroll.o
  CC       xdisp.o
  CC       menu.o
  CC       xmenu.o
  CC       window.o
  CC       charset.o
  CC       coding.o
  CC       category.o
  CC       ccl.o
  CC       character.o
  CC       chartab.o
  CC       bidi.o
  CC       cm.o
  CC       term.o
  CC       terminal.o
  CC       xfaces.o
  CC       xterm.o
  CC       xfns.o
  CC       xselect.o
  CC       xrdb.o
  CC       xsmfns.o
  CC       xsettings.o
  CC       gtkutil.o
  CC       emacsgtkfixed.o
  CC       dbusbind.o
  CC       emacs.o
  CC       keyboard.o
  CC       macros.o
  CC       keymap.o
  CC       sysdep.o
sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
 1821 | static unsigned char sigsegv_stack[SIGSTKSZ];
      |                      ^~~~~~~~~~~~~
make[1]: *** [Makefile:406: sysdep.o] Error 1
make[1]: Leaving directory '/home/hakon/test/install_emacs/emacs-27.2/src'
make: *** [Makefile:424: src] Error 2

[-- Attachment #2: Type: text/html, Size: 8734 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
  2021-10-17 20:49 bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope Håkon Hægland
@ 2021-10-18  2:28 ` Eli Zaretskii
  2021-10-18 11:41   ` Håkon Hægland
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-10-18  2:28 UTC (permalink / raw)
  To: Håkon Hægland; +Cc: 51254

> From: Håkon Hægland
>  <hakon.hagland@gmail.com>
> Date: Sun, 17 Oct 2021 22:49:08 +0200
> 
> I am trying to install emacs 27.2 from source on Ubuntu 21.10:
> 
> $ gcc --version
> gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
> [...]
>   CC       sysdep.o
> sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
>  1821 | static unsigned char sigsegv_stack[SIGSTKSZ];
>       |                      ^~~~~~~~~~~~~
> make[1]: *** [Makefile:406: sysdep.o] Error 1
> make[1]: Leaving directory '/home/hakon/test/install_emacs/emacs-27.2/src'
> make: *** [Makefile:424: src] Error 2

This is due to a change in your system headers.

There won't be any Emacs 27 releases, and the problem is fixed in the
current development sources, which will become Emacs 28.1.  So my
suggestion is to use the code we have there now:

  /* Storage for the alternate signal stack.
     64 KiB is not too large for Emacs, and is large enough
     for all known platforms.  Smaller sizes may run into trouble.
     For example, libsigsegv 2.6 through 2.8 have a bug where some
     architectures use more than the Linux default of an 8 KiB alternate
     stack when deciding if a fault was caused by stack overflow.  */
  static max_align_t sigsegv_stack[(64 * 1024
				    + sizeof (max_align_t) - 1)
				   / sizeof (max_align_t)];





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
  2021-10-18  2:28 ` Eli Zaretskii
@ 2021-10-18 11:41   ` Håkon Hægland
  2021-10-18 13:00     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Håkon Hægland @ 2021-10-18 11:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 51254

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

Thanks! I tried version 29.0.50 at https://github.com/emacs-mirror/emacs.git
and it compiles fine:

$ git clone https://github.com/emacs-mirror/emacs.git
$ cd emacs
$ ./autogen.sh
$ ./configure --prefix=/opt/emacs-29
$ make
$ sudo make install
$ /opt/emacs-29/bin/emacs --version
GNU Emacs 29.0.50
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.


On Mon, Oct 18, 2021 at 4:28 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Håkon Hægland
> >  <hakon.hagland@gmail.com>
> > Date: Sun, 17 Oct 2021 22:49:08 +0200
> >
> > I am trying to install emacs 27.2 from source on Ubuntu 21.10:
> >
> > $ gcc --version
> > gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
> > [...]
> >   CC       sysdep.o
> > sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
> >  1821 | static unsigned char sigsegv_stack[SIGSTKSZ];
> >       |                      ^~~~~~~~~~~~~
> > make[1]: *** [Makefile:406: sysdep.o] Error 1
> > make[1]: Leaving directory
> '/home/hakon/test/install_emacs/emacs-27.2/src'
> > make: *** [Makefile:424: src] Error 2
>
> This is due to a change in your system headers.
>
> There won't be any Emacs 27 releases, and the problem is fixed in the
> current development sources, which will become Emacs 28.1.  So my
> suggestion is to use the code we have there now:
>
>   /* Storage for the alternate signal stack.
>      64 KiB is not too large for Emacs, and is large enough
>      for all known platforms.  Smaller sizes may run into trouble.
>      For example, libsigsegv 2.6 through 2.8 have a bug where some
>      architectures use more than the Linux default of an 8 KiB alternate
>      stack when deciding if a fault was caused by stack overflow.  */
>   static max_align_t sigsegv_stack[(64 * 1024
>                                     + sizeof (max_align_t) - 1)
>                                    / sizeof (max_align_t)];
>

[-- Attachment #2: Type: text/html, Size: 2888 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope
  2021-10-18 11:41   ` Håkon Hægland
@ 2021-10-18 13:00     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2021-10-18 13:00 UTC (permalink / raw)
  To: Håkon Hægland; +Cc: 51254-done

> From: Håkon Hægland <hakon.hagland@gmail.com>
> Date: Mon, 18 Oct 2021 13:41:47 +0200
> Cc: 51254@debbugs.gnu.org
> 
> Thanks! I tried version 29.0.50 at https://github.com/emacs-mirror/emacs.git and it compiles fine:

Great, I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-18 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17 20:49 bug#51254: sysdep.c:1821:22: error: variably modified ‘sigsegv_stack’ at file scope Håkon Hægland
2021-10-18  2:28 ` Eli Zaretskii
2021-10-18 11:41   ` Håkon Hægland
2021-10-18 13:00     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).