public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23278] New: SJLJ-exceptions broken
@ 2005-08-07 19:50 jacob dot navia at ants dot com
  2005-08-07 19:57 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: jacob dot navia at ants dot com @ 2005-08-07 19:50 UTC (permalink / raw)
  To: gcc-bugs

We have a program (c++) that needs c++ SJLJ exceptions. We have built all
compilers from 3.3.1 to 3.3.6 and they all have the same bug:
In the first throw that the program does, we get an exception in the runtime
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1166014832 (LWP 24573)]
parse_lsda_header (context=0x457f6978,
    p=0xd5a0400000 <Address 0xd5a0400000 out of bounds>, info=0x457f6900)
    at ../../../../gcc-3.3.6/libstdc++-v3/libsupc++/eh_personality.cc:62
62        lpstart_encoding = *p++;

The variable p has a wrong address: 0xd5a0400000. This address is NOT completely
random however. It is always the address of a function, in this case :

 .gnu.linkonce.d._ZTV18QueryRowLimitCheck
0x0000000000d5a040      0x330 ../Debug/libdatabaselibrary.a(GenerateWhere.o)
                0x0000000000d5a040                _ZTV18QueryRowLimitCheck

I gathered that from the map file.

In different versions of the compiler the specific function changes, but the
overall pattern is the same:
The high 32 bits of the address are filled with the low 32 bits of the address
of a function.

A bug somewhere???????

WHERE????

I have been working already almost a week in this and I get nowhere. Please
help.

Thanks in advance

jacob

-- 
           Summary: SJLJ-exceptions broken
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jacob dot navia at ants dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: gcc-3.3.3 to gcc-3.3.6
GCC target triplet: amd64


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
@ 2005-08-07 19:57 ` pinskia at gcc dot gnu dot org
  2005-08-07 20:30 ` jacob dot navia at ants dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-07 19:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 19:57 -------
Why do the program requires SJLJ exceptions?  That does not make sense.
Do you have a simple testcase which this can be reproduced with?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++
           Keywords|                            |EH, sjlj-eh


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
  2005-08-07 19:57 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
@ 2005-08-07 20:30 ` jacob dot navia at ants dot com
  2005-08-07 20:33 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: jacob dot navia at ants dot com @ 2005-08-07 20:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jacob dot navia at ants dot com  2005-08-07 20:30 -------
>>Why do the program requires SJLJ exceptions?  That does not make sense.

Yes it does.

The problem is that we are generating dynamically code
using an embedded compiler. Our stack looks like this:

	C++ stack
	dynamically generated code
	C++ stack
	dynamically generated code
	C++ stack <--- makes a throw

If we would use table-driven (dwarf2) exceptions, the program would crash
since there are no dwarf tables for our dynamically generated code!

We HAVE to use sjlj exceptions.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
  2005-08-07 19:57 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
  2005-08-07 20:30 ` jacob dot navia at ants dot com
@ 2005-08-07 20:33 ` pinskia at gcc dot gnu dot org
  2005-08-07 20:37 ` dberlin at dberlin dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-07 20:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 20:33 -------
Why don't you generate dwarf2 tables at runtime too.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (2 preceding siblings ...)
  2005-08-07 20:33 ` pinskia at gcc dot gnu dot org
@ 2005-08-07 20:37 ` dberlin at dberlin dot org
  2005-08-07 20:37 ` [Bug c++/23278] New: " Daniel Berlin
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dberlin at dberlin dot org @ 2005-08-07 20:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-08-07 20:37 -------
Subject: Re:  New: SJLJ-exceptions broken

On Sun, 2005-08-07 at 19:50 +0000, jacob dot navia at ants dot com
wrote:
> We have a program (c++) that needs c++ SJLJ exceptions. We have built all
> compilers from 3.3.1 to 3.3.6 and they all have the same bug:

> In the first throw that the program does, we get an exception in the runtime

> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1166014832 (LWP 24573)]
> parse_lsda_header (context=0x457f6978,
>     p=0xd5a0400000 <Address 0xd5a0400000 out of bounds>, info=0x457f6900)
>     at ../../../../gcc-3.3.6/libstdc++-v3/libsupc++/eh_personality.cc:62
> 62        lpstart_encoding = *p++;
> 


You can't mix SJLJ exceptions and dwarf2 exceptions, which is what happened here, AFAICT



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* Re: [Bug c++/23278] New: SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (3 preceding siblings ...)
  2005-08-07 20:37 ` dberlin at dberlin dot org
@ 2005-08-07 20:37 ` Daniel Berlin
  2005-08-08 18:45 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Daniel Berlin @ 2005-08-07 20:37 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

On Sun, 2005-08-07 at 19:50 +0000, jacob dot navia at ants dot com
wrote:
> We have a program (c++) that needs c++ SJLJ exceptions. We have built all
> compilers from 3.3.1 to 3.3.6 and they all have the same bug:

> In the first throw that the program does, we get an exception in the runtime

> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1166014832 (LWP 24573)]
> parse_lsda_header (context=0x457f6978,
>     p=0xd5a0400000 <Address 0xd5a0400000 out of bounds>, info=0x457f6900)
>     at ../../../../gcc-3.3.6/libstdc++-v3/libsupc++/eh_personality.cc:62
> 62        lpstart_encoding = *p++;
> 


You can't mix SJLJ exceptions and dwarf2 exceptions, which is what happened here, AFAICT


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (4 preceding siblings ...)
  2005-08-07 20:37 ` [Bug c++/23278] New: " Daniel Berlin
@ 2005-08-08 18:45 ` pinskia at gcc dot gnu dot org
  2005-08-09 19:57 ` jacob dot navia at ants dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-08 18:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (5 preceding siblings ...)
  2005-08-08 18:45 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
@ 2005-08-09 19:57 ` jacob dot navia at ants dot com
  2005-08-09 22:53   ` Daniel Berlin
  2005-08-09 22:53 ` dberlin at dberlin dot org
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 14+ messages in thread
From: jacob dot navia at ants dot com @ 2005-08-09 19:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jacob dot navia at ants dot com  2005-08-09 19:57 -------
If I can't mix SJLJ exceptions with DWARF2 exceptions how this is supposed to 
work?
I mean I have to rebuild all libraries including libc, libm, and whatever????

This can't be. Besides, why this mixing should lead to the address of a 
function being stored in the high 32 bits of a 64 bit address?

Has anyone used SJLJ exceptions under linux?

Thanks in advance.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* Re: [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-09 19:57 ` jacob dot navia at ants dot com
@ 2005-08-09 22:53   ` Daniel Berlin
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Berlin @ 2005-08-09 22:53 UTC (permalink / raw)
  To: jacob dot navia at ants dot com; +Cc: gcc-bugs



On Tue, 9 Aug 2005, jacob dot navia at ants dot com wrote:

>
> ------- Additional Comments From jacob dot navia at ants dot com  2005-08-09 19:57 -------
> If I can't mix SJLJ exceptions with DWARF2 exceptions how this is supposed to
> work?
How is what supposed to work?

> I mean I have to rebuild all libraries including libc, libm, and whatever????
Yes.

>
> This can't be.

It is.

>  Besides, why this mixing should lead to the address of a
> function being stored in the high 32 bits of a 64 bit address?
Possibly because it's attempting to read the wrong place as if it 
was an unwind table, and gets confused.

k


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (6 preceding siblings ...)
  2005-08-09 19:57 ` jacob dot navia at ants dot com
@ 2005-08-09 22:53 ` dberlin at dberlin dot org
  2005-08-15 19:39 ` bkoz at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: dberlin at dberlin dot org @ 2005-08-09 22:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-08-09 22:53 -------
Subject: Re:  SJLJ-exceptions broken



On Tue, 9 Aug 2005, jacob dot navia at ants dot com wrote:

>
> ------- Additional Comments From jacob dot navia at ants dot com  2005-08-09 19:57 -------
> If I can't mix SJLJ exceptions with DWARF2 exceptions how this is supposed to
> work?
How is what supposed to work?

> I mean I have to rebuild all libraries including libc, libm, and whatever????
Yes.

>
> This can't be.

It is.

>  Besides, why this mixing should lead to the address of a
> function being stored in the high 32 bits of a 64 bit address?
Possibly because it's attempting to read the wrong place as if it 
was an unwind table, and gets confused.

k


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (7 preceding siblings ...)
  2005-08-09 22:53 ` dberlin at dberlin dot org
@ 2005-08-15 19:39 ` bkoz at gcc dot gnu dot org
  2005-09-12 19:13 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-08-15 19:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2005-08-15 17:51 -------

Where is the testcase?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (8 preceding siblings ...)
  2005-08-15 19:39 ` bkoz at gcc dot gnu dot org
@ 2005-09-12 19:13 ` bkoz at gcc dot gnu dot org
  2005-09-12 21:44 ` jacob dot navia at ants dot com
  2005-09-13 19:29 ` [Bug c++/23278] " bkoz at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-09-12 19:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2005-09-12 19:13 -------

There are no platform details, no reproducing sources, and all this on a
toolchain that is now mostly frozen.

In addition, I also cannot tell why dwarf eh is not being used. So, the answer
the question, does anybody use SJLJ exceptions on linux is: no, not really. 

Not unless the target is completely brain dead.

-benjamin

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug libstdc++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (9 preceding siblings ...)
  2005-09-12 19:13 ` bkoz at gcc dot gnu dot org
@ 2005-09-12 21:44 ` jacob dot navia at ants dot com
  2005-09-13 19:29 ` [Bug c++/23278] " bkoz at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: jacob dot navia at ants dot com @ 2005-09-12 21:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jacob dot navia at ants dot com  2005-09-12 21:44 -------
Subject: RE:  SJLJ-exceptions broken

1) I need to use sjlj exceptions because we dynamically generate code.
   Since we do not have any means of generating the needed dwarf2 tables
   dynamically because there is no API to do it, we can ONLY use
   sjlj exception. All this is explained in a previous message.
2)
   Our stack configuration looks like this:
         C++ code
         ---------
         dynamically generated code
         ---------
         C++ code
         ---------
         dynamically generated code
         ---------
         C++ code <<<<<----- makes a throw

The problem is that since there isn't any dwarf2
info for the dynamically generated code, a throw will crash
when done in this configuration.

That is why we use that. Not because we are brain dead.
Thanks for your very useful comments but... yes, I repeat:
Not because we are brain dead but because we *need* to do this.

I can't send you any reproducing sources since I would need
to send our just in time compiler to you.

I use this in a toolchain "that now is mostly frozen" because the
"new and improved" toolchain will not compile our source code
since the bug PR 23167 still was unsolved last time I checked.

jacob


-----Original Message-----
From: bkoz at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org]
Sent: Monday, September 12, 2005 12:14 PM
To: Jacob Navia
Subject: [Bug libstdc++/23278] SJLJ-exceptions broken



------- Additional Comments From bkoz at gcc dot gnu dot org  2005-09-12 19:13 -------

There are no platform details, no reproducing sources, and all this on a
toolchain that is now mostly frozen.

In addition, I also cannot tell why dwarf eh is not being used. So, the answer
the question, does anybody use SJLJ exceptions on linux is: no, not really. 

Not unless the target is completely brain dead.

-benjamin



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

* [Bug c++/23278] SJLJ-exceptions broken
  2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
                   ` (10 preceding siblings ...)
  2005-09-12 21:44 ` jacob dot navia at ants dot com
@ 2005-09-13 19:29 ` bkoz at gcc dot gnu dot org
  11 siblings, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-09-13 19:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2005-09-13 19:29 -------

Moving to c++ component, maybe they can help him...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libstdc++                   |c++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23278


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

end of thread, other threads:[~2005-09-13 19:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-07 19:50 [Bug c++/23278] New: SJLJ-exceptions broken jacob dot navia at ants dot com
2005-08-07 19:57 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
2005-08-07 20:30 ` jacob dot navia at ants dot com
2005-08-07 20:33 ` pinskia at gcc dot gnu dot org
2005-08-07 20:37 ` dberlin at dberlin dot org
2005-08-07 20:37 ` [Bug c++/23278] New: " Daniel Berlin
2005-08-08 18:45 ` [Bug libstdc++/23278] " pinskia at gcc dot gnu dot org
2005-08-09 19:57 ` jacob dot navia at ants dot com
2005-08-09 22:53   ` Daniel Berlin
2005-08-09 22:53 ` dberlin at dberlin dot org
2005-08-15 19:39 ` bkoz at gcc dot gnu dot org
2005-09-12 19:13 ` bkoz at gcc dot gnu dot org
2005-09-12 21:44 ` jacob dot navia at ants dot com
2005-09-13 19:29 ` [Bug c++/23278] " bkoz at gcc dot gnu dot org

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).