public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: finishing cancellation handling
@ 2003-09-08 16:30 Steven Munroe
  2003-09-08 19:20 ` Ulrich Drepper
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Munroe @ 2003-09-08 16:30 UTC (permalink / raw)
  To: libc-hacker

Tried running the find-cps tool against a PPC64 glibc built on RHEL
3-Beta2. and can only get:

  ../find-cps -f libc_pic.a -d libc.so open close
find-cps: ../../libelf/elf32_getshdr.c:93: elf64_getshdr: Assertion
`ehdr->e_ident[5] != 2 || (! 0 && (ehdr->e_shoff & (__alignof__
(Elf64_Shdr) - 1)) != 0)' failed.
Aborted

I assume that libelf.so is biarch? The only libelf.so in this install is
32-bit but the libc_pic.a and libc.so are 64-bit...


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

* Re: finishing cancellation handling
  2003-09-08 16:30 finishing cancellation handling Steven Munroe
@ 2003-09-08 19:20 ` Ulrich Drepper
  0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Drepper @ 2003-09-08 19:20 UTC (permalink / raw)
  To: sjmunroe; +Cc: libc-hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Munroe wrote:

>  ../find-cps -f libc_pic.a -d libc.so open close
> find-cps: ../../libelf/elf32_getshdr.c:93: elf64_getshdr: Assertion
> `ehdr->e_ident[5] != 2 || (! 0 && (ehdr->e_shoff & (__alignof__
> (Elf64_Shdr) - 1)) != 0)' failed.
> Aborted
> 
> I assume that libelf.so is biarch? The only libelf.so in this install is
> 32-bit but the libc_pic.a and libc.so are 64-bit...

libelf from elfutils supports all architectures, nothin as crude as
biarch.  The error means that the ELF data structures as mmaped are
unnaturally aligned in memory.  This probably happens because the
alignment in the archive is unnatural.

If you recompile find-cps and change all ELF_C_READ_MMAP to ELF_C_READ
it should work.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/XNZz2ijCOnn/RHQRAse2AJsHOf2q0F1EKxQWuzyWDpIZWDErnQCggDIY
KKtrBTpCEyoqpUr+S7Sltdo=
=8M3q
-----END PGP SIGNATURE-----

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

* Re: finishing cancellation handling
  2003-09-16 19:30 Steven Munroe
@ 2003-09-16 19:47 ` Ulrich Drepper
  0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Drepper @ 2003-09-16 19:47 UTC (permalink / raw)
  To: sjmunroe; +Cc: libc-hacker

Steven Munroe wrote:
> Perhaps the tool has problems with "."ed symbols?

I've said already a few times, I haven't used the tool on ppc nor do I
ever have the intention to do so.  If there are major problems they
quite likely stem from problems like these .-symbols.  If you want the
tool to work on ppc, fix it yourself.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

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

* Re: finishing cancellation handling
@ 2003-09-16 19:30 Steven Munroe
  2003-09-16 19:47 ` Ulrich Drepper
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Munroe @ 2003-09-16 19:30 UTC (permalink / raw)
  To: libc-hacker

Still not having much luck with the find-cps.c tool.

Still having problems with "false claims" of duplicate symbols:

duplicate definition of endutxent in endutxent.os
previous definition in getutxent.os

Patching around this I saw "fatal error 400" until I recompiled -static and
-m64 (The libraries I am scaning are all 64-bit). Only 64-bit static links seem
to work.

Now when I run:

../find-cps64 -e -f libc_pic.a -w ../libc23/CANCEL-FILE-WAIVE open close

I see:

files missing .eh_frame
../find-cps64: seed 'open' not defined

What is the purpose/function of the "seeds"? 

In this case, "open" and ".open" do exist but are both weak symbols

open.os:     file format elf64-powerpc
rw-rw-r-- 500/500   2512 Sep 11 11:25 2003 open.os
0000000000000000  w      .opd   00000000000000a4 open
0000000000000000  w    F .text  0000000000000000 .open

Tried __libc_open and __GI___libc_open as well with no joy.

Perhaps the tool has problems with "."ed symbols?


-- 
Steven Munroe
sjmunroe@us.ibm.com
Linux on PowerPC-64 Development
GLIBC for PowerPC-64 Development

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

* Re: finishing cancellation handling
@ 2003-09-08 20:48 Steve Munroe
  0 siblings, 0 replies; 6+ messages in thread
From: Steve Munroe @ 2003-09-08 20:48 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: libc-hacker

Ulrich Drepper writes

> If you recompile find-cps and change all ELF_C_READ_MMAP to ELF_C_READ
> it should work.

Thanks. That helped, but now I am seeing the message:

"../find-cps duplicate definition od putw in putw.os
previous definition in getw.os"

objdump -xd shows this is not true!

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

* finishing cancellation handling
@ 2003-09-02  9:34 Ulrich Drepper
  0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Drepper @ 2003-09-02  9:34 UTC (permalink / raw)
  To: Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ever since the cancellation handling in nptl started using exceptions
there are a large number of potential problems in the libc code.  For an
exception to be passed up all functions on the call path to the place
where the exception originated must have call frame information.  Not a
problem for platforms which have the support enabled by default, but x86
for instance doesn't fall into this category.

Another problem is that all interfaces which might cause an exception to
be raised must not be marked with __THROW in the header.

Analyzing this by hand is a tedious job and when I tried I missed many
things.  I've now written a little very specialized tool which helps
with this:

  http://people.redhat.com/drepper/find-cps.c

You need a reasonable libelf for it (i.e., the one from elfutils).

The tool has two basic modes: one to show which interfaces, when called,
can (potentially) raise an exception.  The other mode shows which files,
containing functions which might raise exception or call functions which
might raise exceptions, are not compiled with -fexceptions.

The automatic analysis is not 100% so there is the possibility to have
waiver list.  One I've already checked into the CVS archive
(CANCEL-FILE-WAIVE).  Use the tool with it like this

find-cps -e -f libc_pic.a -w ~/gnu/libc/CANCEL-FILE-WAIVE open close

This is for the second mode.  For the first mode run


find-cps -f libc_pic.a -d libc.so open close


There will be a waiver list as well.  I haven't populated it yet.

There is a lot of work left so you are encouraged to do your part.
Please send small patches as soon as you have them so that we can
minimize duplication of work.  There are several different solutions:

~ functions cannot use cancelable functions and have to be rewritten;
  this is also sometimes necessary if the cleanup action would be too
  messy

~ if cancellation is OK the code must be compiled with -fexceptions and
  the prototype in the exported header must not have __THROW

~ if the function modifies some global data it might be necessary to
  write cleanup handlers

~ the tools report false positives; the waiver lists must be adjusted.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/VGQN2ijCOnn/RHQRAgE3AKCh0d6xF2df9V288inv/kpVLUpfTQCdHcai
S3NWHYs1j8jln5Y9qA+3vRo=
=InJw
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2003-09-16 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 16:30 finishing cancellation handling Steven Munroe
2003-09-08 19:20 ` Ulrich Drepper
  -- strict thread matches above, loose matches on Subject: below --
2003-09-16 19:30 Steven Munroe
2003-09-16 19:47 ` Ulrich Drepper
2003-09-08 20:48 Steve Munroe
2003-09-02  9:34 Ulrich Drepper

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