* [Bug libgcj/50057] [4.7 regression] SIGSEGV in natObject.cc:58
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
@ 2011-09-29 13:25 ` rguenth at gcc dot gnu.org
2011-10-10 12:21 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-09-29 13:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] SIGSEGV in natObject.cc:58
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
2011-09-29 13:25 ` [Bug libgcj/50057] " rguenth at gcc dot gnu.org
@ 2011-10-10 12:21 ` rguenth at gcc dot gnu.org
2011-12-17 21:56 ` ktietz at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 12:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] SIGSEGV in natObject.cc:58
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
2011-09-29 13:25 ` [Bug libgcj/50057] " rguenth at gcc dot gnu.org
2011-10-10 12:21 ` rguenth at gcc dot gnu.org
@ 2011-12-17 21:56 ` ktietz at gcc dot gnu.org
2012-01-18 6:25 ` jojelino at gmail dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2011-12-17 21:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ktietz at gcc dot gnu.org
--- Comment #1 from Kai Tietz <ktietz at gcc dot gnu.org> 2011-12-17 21:54:05 UTC ---
Hmm, this might be a duplicate for already fixed PR/50053. Could you please
check, if you still have this issue here with current trunk version.
Thanks
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] SIGSEGV in natObject.cc:58
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (2 preceding siblings ...)
2011-12-17 21:56 ` ktietz at gcc dot gnu.org
@ 2012-01-18 6:25 ` jojelino at gmail dot com
2012-01-18 6:46 ` [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null jojelino at gmail dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jojelino at gmail dot com @ 2012-01-18 6:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
--- Comment #2 from gee <jojelino at gmail dot com> 2012-01-18 06:14:17 UTC ---
(In reply to comment #1)
> Hmm, this might be a duplicate for already fixed PR/50053. Could you please
> check, if you still have this issue here with current trunk version.
>
> Thanks
Starting program: /tmp/gcc/i686-pc-mingw32/libjava/.libs/gij.exe
/tmp/gcc/libjava/testsuite/libjava.lang/foobar.class
[New Thread 9088.0x1188]
[New Thread 9088.0x2760]
[Inferior 1 (process 9088) exited with code 01]
(gdb)
just exists with silent message. without sigsegv
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (3 preceding siblings ...)
2012-01-18 6:25 ` jojelino at gmail dot com
@ 2012-01-18 6:46 ` jojelino at gmail dot com
2012-01-18 13:37 ` jojelino at gmail dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jojelino at gmail dot com @ 2012-01-18 6:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
gee <jojelino at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.7 regression] SIGSEGV in |[4.7 regression]
|natObject.cc:58 |misalignment of
| |java_exception_header
| |resulted in throwable to be
| |null
Severity|normal |major
--- Comment #3 from gee <jojelino at gmail dot com> 2012-01-18 06:20:40 UTC ---
in libjava/exception.cc
/* The object being thrown. Compiled code expects this to be immediately
before the generic exception header. Which is complicated by the fact
that _Unwind_Exception is ((aligned)). */
Starting program: /tmp/gcc/i686-pc-mingw32/libjava/testsuite/.libs/PR218
[New Thread 6064.0x1e4c]
Breakpoint 13, _Jv_Throw (value=0xa9ba08) at ../.././libjava/exception.cc:118
118 _Unwind_RaiseException (&xh->unwindHeader);
(gdb) p ((int)&xh->unwindHeader-(int)&xh->value)
$19 = 0xc
It seems that padding was unsuccessful.
following is version info.
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-cygwin/4.7.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: ./configure --config-cache --prefix=/usr
--disable-win32-registry --enable-threads=win32
--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls
--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp
--enable-cloog-backend=isl LTLDFLAGS=-no-undefined
lt_cv_deplibs_check_method=pass_all : (reconfigured) ./configure --config-cache
--prefix=/usr --disable-win32-registry --enable-threads=win32
--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls
--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp
--enable-cloog-backend=isl LTLDFLAGS=-no-undefined
lt_cv_deplibs_check_method=pass_all
Thread model: win32
gcc version 4.7.0 20120114 (experimental) (GCC)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (4 preceding siblings ...)
2012-01-18 6:46 ` [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null jojelino at gmail dot com
@ 2012-01-18 13:37 ` jojelino at gmail dot com
2012-02-10 19:20 ` ktietz at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: jojelino at gmail dot com @ 2012-01-18 13:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
--- Comment #4 from gee <jojelino at gmail dot com> 2012-01-18 13:28:53 UTC ---
Created attachment 26365
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26365
proposed patch
it fixes invalid padding that caused the bug.
#include <cstddef>
#define DEBUG 1
#include <cassert>
#include <cstdlib>
#include <cstdio>
#include <iostream>
typedef int* jthrowable,_Unwind_Ptr;
struct alignment_test_struct
{
char space;
char end[0] __attribute__((aligned));
};
struct java_exception_header
{
#define MEMBER_AT_FRONT \
_Unwind_Ptr* landingPad;\
int handlerSwitchValue;
MEMBER_AT_FRONT
struct _pad{MEMBER_AT_FRONT};
#undef MEMBER_AT_FRONT
#define PADORZERO(x,y,z) (sizeof(x)<sizeof(y)?sizeof(y)-sizeof(x)+(z):0)
char
pad[PADORZERO(jthrowable,alignment_test_struct,PADORZERO(_pad,alignment_test_struct,0))];
#undef PADORZERO
jthrowable __attribute__((packed)) value;
int* unwindHeader;
};
int main()
{
alignment_test_struct s;
java_exception_header t;
printf("%x\n",sizeof(alignment_test_struct));
int
dat[]={offsetof(java_exception_header,pad),sizeof(java_exception_header::pad)
,offsetof(java_exception_header,value),sizeof(java_exception_header::value)
,offsetof(java_exception_header,unwindHeader),sizeof(java_exception_header::unwindHeader)};
printf("pad %x %x\n",dat[0],dat[1]);
printf("value %x %x\n",dat[2],dat[3]);
printf("header %x %x\n",dat[4],dat[5]);
assert((dat[2]+dat[3])==dat[4]);
return 0;
}
10
pad 8 14
value 1c 4
header 20 4
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (5 preceding siblings ...)
2012-01-18 13:37 ` jojelino at gmail dot com
@ 2012-02-10 19:20 ` ktietz at gcc dot gnu.org
2012-02-10 19:21 ` ktietz at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-10 19:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
--- Comment #5 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-10 19:19:56 UTC ---
Hmm, I assume issue is related to using of -mms-bitfields for 4.7 for
windows-targets.
Does the following patch fix the issue?
Index: exception.cc
===================================================================
--- exception.cc (revision 184105)
+++ exception.cc (working copy)
@@ -33,12 +33,18 @@
}
#include "unwind.h"
+#ifdef __MINGW32__
+__attribute__ ((gcc_struct))
+#endif
struct alignment_test_struct
{
char space;
char end[0] __attribute__((aligned));
};
+#ifdef __MINGW32__
+__attribute__ ((gcc_struct))
+#endif
struct java_exception_header
{
/* Cache handler details between Phase 1 and Phase 2. */
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (6 preceding siblings ...)
2012-02-10 19:20 ` ktietz at gcc dot gnu.org
@ 2012-02-10 19:21 ` ktietz at gcc dot gnu.org
2012-02-14 20:26 ` ktietz at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-10 19:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-02-10
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (7 preceding siblings ...)
2012-02-10 19:21 ` ktietz at gcc dot gnu.org
@ 2012-02-14 20:26 ` ktietz at gcc dot gnu.org
2012-02-22 12:40 ` ktietz at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-14 20:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
--- Comment #6 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-14 20:26:01 UTC ---
Hmm, this might be a duplicate of PR52238
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (8 preceding siblings ...)
2012-02-14 20:26 ` ktietz at gcc dot gnu.org
@ 2012-02-22 12:40 ` ktietz at gcc dot gnu.org
2012-02-22 16:20 ` jojelino at gmail dot com
2012-02-22 16:32 ` ktietz at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-22 12:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
--- Comment #7 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-22 12:35:04 UTC ---
Could you please retest this bug. I assume it is a duplicate of PR52238, which
was recently fixed.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (9 preceding siblings ...)
2012-02-22 12:40 ` ktietz at gcc dot gnu.org
@ 2012-02-22 16:20 ` jojelino at gmail dot com
2012-02-22 16:32 ` ktietz at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: jojelino at gmail dot com @ 2012-02-22 16:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
gee <jojelino at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |FIXED
--- Comment #8 from gee <jojelino at gmail dot com> 2012-02-22 16:13:41 UTC ---
(In reply to comment #7)
> Could you please retest this bug. I assume it is a duplicate of PR52238, which
> was recently fixed.
yes, it's fixed. thank you.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libgcj/50057] [4.7 regression] misalignment of java_exception_header resulted in throwable to be null
2011-08-12 14:02 [Bug libgcj/50057] New: [4.7 regression] SIGSEGV in natObject.cc:58 jojelino at gmail dot com
` (10 preceding siblings ...)
2012-02-22 16:20 ` jojelino at gmail dot com
@ 2012-02-22 16:32 ` ktietz at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-22 16:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50057
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |DUPLICATE
--- Comment #9 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-22 16:28:40 UTC ---
mark as duplicate of 52238
*** This bug has been marked as a duplicate of bug 52238 ***
^ permalink raw reply [flat|nested] 13+ messages in thread