Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc
> Date: Fri, 20 Jan 2023 21:39:56 +0100 > Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > From: Gabriel Ravier > > >> - using wide APIs with Windows is generally considered to be a best > >> practice, even when not strictly needed (and in this case I can't see > >> any problem wit

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Alejandro Colomar via Gcc
Hi Zack, On 1/21/23 03:38, Alejandro Colomar wrote: Hi Zack, On 1/20/23 20:25, Alejandro Colomar wrote: [CC += GCC]  // pun not intended :P Hi Zack, On 1/20/23 19:04, Zack Weinberg wrote: On Fri, Jan 20, 2023, at 8:40 AM, Alejandro Colomar wrote: The historical design of `sockaddr_storage`

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Alejandro Colomar via Gcc
Hi Zack, On 1/20/23 20:25, Alejandro Colomar wrote: [CC += GCC]  // pun not intended :P Hi Zack, On 1/20/23 19:04, Zack Weinberg wrote: On Fri, Jan 20, 2023, at 8:40 AM, Alejandro Colomar wrote: The historical design of `sockaddr_storage` makes it impossible to use without breaking strict al

gcc-11-20230120 is now available

2023-01-20 Thread GCC Administrator via Gcc
Snapshot gcc-11-20230120 is now available on https://gcc.gnu.org/pub/gcc/snapshots/11-20230120/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 11 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

Re: [PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2023-01-20 Thread Ian Lance Taylor via Gcc
On Fri, Jan 20, 2023 at 2:54 AM Björn Schäpers wrote: > > From: Björn Schäpers > > It's the right thing to do, since the PC shouldn't go out of the > uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. > This is a preparation for a following patch. > > Tested on x86_64-linux and i686-w

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Alejandro Colomar via Gcc
On 1/20/23 21:46, Bastien Roucariès wrote: Le vendredi 20 janvier 2023, 20:38:32 UTC Alejandro Colomar a écrit : Hi Bastien, On 1/20/23 21:32, Bastien Roucariès wrote: [...] diff --git a/bits/socket.h b/bits/socket.h index aac8c49b00..c0c23b4e84 100644 --- a/bits/socket.h +++ b/bits/socket.

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Bastien Roucariès
Le vendredi 20 janvier 2023, 20:38:32 UTC Alejandro Colomar a écrit : > Hi Bastien, > > On 1/20/23 21:32, Bastien Roucariès wrote: > [...] > > >> diff --git a/bits/socket.h b/bits/socket.h > >> index aac8c49b00..c0c23b4e84 100644 > >> --- a/bits/socket.h > >> +++ b/bits/socket.h > >> @@ -168,9 +1

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Gabriel Ravier via Gcc
On 1/20/23 20:19, Eli Zaretskii wrote: Date: Fri, 20 Jan 2023 17:46:59 +0100 Cc: gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org From: Gabriel Ravier On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: From: Björn Schäpers Date: Fri, 20 Jan 2023 11:54:08 +0100 @@ -856,7 +870,12 @@ coff_add (struct backt

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Alejandro Colomar via Gcc
Hi Bastien, On 1/20/23 21:32, Bastien Roucariès wrote: [...] diff --git a/bits/socket.h b/bits/socket.h index aac8c49b00..c0c23b4e84 100644 --- a/bits/socket.h +++ b/bits/socket.h @@ -168,9 +168,14 @@ struct sockaddr struct sockaddr_storage { -__SOCKADDR_COMMON (ss_); /* Address

Re: [PATCH v2] socket: Implement sockaddr_storage with an anonymous union

2023-01-20 Thread Alejandro Colomar via Gcc
[CC += GCC] // pun not intended :P Hi Zack, On 1/20/23 19:04, Zack Weinberg wrote: On Fri, Jan 20, 2023, at 8:40 AM, Alejandro Colomar wrote: The historical design of `sockaddr_storage` makes it impossible to use without breaking strict aliasing rules. Not only this type is unusable, but eve

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc
> Date: Fri, 20 Jan 2023 17:46:59 +0100 > Cc: gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > From: Gabriel Ravier > > On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: > >> From: Björn Schäpers > >> Date: Fri, 20 Jan 2023 11:54:08 +0100 > >> > >> @@ -856,7 +870,12 @@ coff_add (struct backtrace_state *s

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Gabriel Ravier via Gcc
On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: From: Björn Schäpers Date: Fri, 20 Jan 2023 11:54:08 +0100 @@ -856,7 +870,12 @@ coff_add (struct backtrace_state *state, int descriptor, + (sections[i].offset - min_offset)); } - if (!backtrace_dwarf_add

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc
> From: Björn Schäpers > Date: Fri, 20 Jan 2023 11:54:08 +0100 > > @@ -856,7 +870,12 @@ coff_add (struct backtrace_state *state, int descriptor, > + (sections[i].offset - min_offset)); > } > > - if (!backtrace_dwarf_add (state, /* base_address */ 0, &dwarf_

Re: struct sockaddr_storage

2023-01-20 Thread Alejandro Colomar via Gcc
Hi Stefan, On 1/20/23 11:06, Stefan Puiu wrote: Hi Alex, On Thu, Jan 19, 2023 at 4:14 PM Alejandro Colomar wrote: Hi! I just received a report about struct sockaddr_storage in the man pages. It reminded me of some concern I've always had about it: it doesn't seem to be a usable type. It h

[PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers This is actually needed so that libstdc++'s implementation to be able to work on windows. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * configure.ac: Add a check for windows.h. * configure, config.h.in: Regenerate. * fileline.c: Add windo

[PATCH 4/4] libbacktrace: get debug information for loaded dlls

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except that libraries loaded after the backtrace_initialize are not handled. But as far as I can see that's the same for elf. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * pecoff.c (coff_add)

[PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers Any underflow which might happen, will be countered by an overflow in dwarf.c. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- Fixes https://github.com/ianlancetaylor/libbacktrace/issues/89 and https://github.com/ianlancetaylor/libbacktrace/issues/82. * peco

[PATCH 1/4] libbacktrace: change all pc related variables to uintptr_t

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers It's the right thing to do, since the PC shouldn't go out of the uintptr_t domain, and in backtrace_pcinfo the pc is uintptr_t. This is a preparation for a following patch. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- * dwarf.c: changed variables holding p

Re: struct sockaddr_storage

2023-01-20 Thread Stefan Puiu via Gcc
Hi Alex, On Thu, Jan 19, 2023 at 4:14 PM Alejandro Colomar wrote: > > Hi! > > I just received a report about struct sockaddr_storage in the man pages. It > reminded me of some concern I've always had about it: it doesn't seem to be a > usable type. > > It has some alignment promises that make it