libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libunwind] _ReadSLEB and _ReadULEB


From: Tommy Hoffner
Subject: Re: [libunwind] _ReadSLEB and _ReadULEB
Date: Thu, 10 Feb 2005 12:50:46 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

David Mosberger skrev:
On Wed, 09 Feb 2005 12:31:16 +0100, Tommy Hoffner

<address@hidden> said:

  Tommy> Whats the story behind _ReadSLEB and _ReadULEB?  I spent
  Tommy> quite a lot of time locating a bug where the personality
  Tommy> routine got in to an endless loop. Finally I fixed it by
  Tommy> removing the two mentioned routines from the libunwind
  Tommy> library (so it used the libipr versions instead)..

The routines were added solely for compatibility with ICC. ;-(
Unfortunately, libunwind.so.6 as shipped with ICC exports those
routines so in order to use my libunwind as a replacement, we have to
export those routines, too.
Hm, current libunwind (Intel's/Dinkumware's) and libipr both contain the same object file (read_leb.o).

  I don't see off-hand what's wrong.  AFAICS,
the implementations should be compatible.
Enclosing an example that fails for me. The first catch works and the second loops, so swapping them makes the other one fail.

/Tommy

PS
I built the library with icpc ver 8.1, which I thought made sense since the functions are to be used in that context :-)
DS.

--------------Makefile-------------------------
CXX=icpc -gcc-name=gcc-3.4
CC=icpc -gcc-name=gcc-3.4
LDFLAGS=-L/home/uabhoto/src/test/libunwind-0.98.3/src/.libs/ -lunwind
#CXX=g++-3.4
#CC=g++-3.4

CXXFLAGS=-O0 -g

LEBbug: LEBbug.o

clean:
        rm LEBbug LEBbug.o
---------------LEBbug.C--------------------------------
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#include <stdio.h>

int
main (int argc, char *argv[])
{
  unw_dyn_info_t di;
  int execptype=0;

  try {
    if(argc>1)
      throw("Exception");
    else
      throw(7);
  }
  catch (const char *p) {
    printf("SUCCESS! (Caught %s)\n\n",p);
  }
  catch (const int i) {
    printf("SUCCESS! (Caught %d)\n\n",i);
  }

  _U_dyn_cancel (&di); //Just to ensure that I link towards the right library
  return -1;
}
-------------------------------------------------------

Do you know why there was an endless loop?
It loops in the personality routine calling _Z21match_exception_typesPSt9type_infoS0_PvPS1_ once and _ReadSLEB twice for each turn so it seems to me that it fails to match the exception type and fails to progress to the next excepton type (or realizing that it is at the end of possible types), but whether it does wrong there or if this loop is a result of a problem in the previous step i don't know.


        --david

/Tommy

--
Tommy Hoffner
Senior Software Designer
Compiler Technology

Ericsson AB
Development Unit Core Network Evolution
Tel:    +46 13 23 57 12
Fax:    +46 13 28 73 71
SMS/MMS:+46 730 43 61 56
address@hidden
www.ericsson.com

This communication is confidential and intended solely for the
addressee(s). Any unauthorized review, use, disclosure or distribution is
prohibited. If you believe this message has been sent to you in error,
please notify the sender by replying to this transmission and delete the
message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption,
interruption, unauthorized amendment, tampering and viruses, and we only
send and receive e-mails on the basis that we are not liable for any such
corruption, interception, amendment, tampering or viruses or any
consequences thereof.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]