This is the mail archive of the
mailing list for the GCC project.
Re: Segfault generated by gcc-7
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Marco Varlese <marco dot varlese at suse dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 12:40:20 +0200
- Subject: Re: Segfault generated by gcc-7
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <20170829103536.GA286@x4>
On 2017.08.29 at 12:35 +0200, Markus Trippelsdorf wrote:
> On 2017.08.29 at 12:31 +0200, Marco Varlese wrote:
> > Hi,
> > I got a SEGFAULT in my program when compiling it with gcc-7 but it
> > is/was all good when using gcc-6.
> > The SEGFAULT happens due to the line below:
> > d_point = *p;
> > And a fix for it (with gcc-7) has been:
> > memcpy(&d_point,
> > p,
> > sizeof(d_point));
> > Does this make any sense to anybody?
> No. Please open a bug and attach the full program that causes the crash.
> Otherwise the issue is impossible to debug.
But my guess would be a misaligned address. Try building with
-fsanitize=undefined and fix all issues the sanitizer points out.