Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #50298] [PATCH] Fix the glibc backtrace() configuration test

1 view
Skip to first unread message

James Keenan via RT

unread,
Jan 27, 2008, 1:33:20 PM1/27/08
to perl6-i...@perl.org
On Sun Jan 27 09:36:26 2008, ah...@airmail.net wrote:
> Hi.
>
> The test for the backtrace() function was failing


Could you post the failing test result?

In particular, the output of 'prove -v t/steps/auto_backtrace*.t' would
be helpful.

I haven't seen any failures in these tests lately, so I'm unclear as to
what failures you're trying to correct with your patch.

Thank you very much.

Art Haas

unread,
Jan 27, 2008, 2:17:23 PM1/27/08
to James Keenan via RT

Hi.

Here's the relevant configuration step output with '--verbose=2'.

Unpatched code produces:

Determining whether libc has the backtrace* functions (glibc only)...
gcc -D_REENTRANT -D_GNU_SOURCE -pipe -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I./include -c test.c
test.c:7: error: conflicting types for 'backtrace'
/usr/include/execinfo.h:28: error: previous declaration of 'backtrace' was here
test.c:8: error: conflicting types for 'backtrace_symbols'
/usr/include/execinfo.h:33: error: previous declaration of 'backtrace_symbols' was here
......no.

With my patch the output is ...

Determining whether libc has the backtrace* functions (glibc only)...
gcc -D_REENTRANT -D_GNU_SOURCE -pipe -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I./include -c test.c
gcc -L/usr/local/lib -L/opt/gnu/lib -Wl,-E test.o -o test -lnsl -ldl -lm -lcrypt -lutil -lpthread

Setting Configuration Data:
(
glibc_backtrace => '1',
);
.....yes.

This is on my Debian "sid" system - 'gcc' is version 4.2.2-7 of the
'gcc-4.2' package, my libc is version 2.7-6 of the 'libc6' package.

Art Haas
--
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

James Keenan via RT

unread,
Jan 27, 2008, 7:50:20 PM1/27/08
to perl6-i...@perl.org
Thanks for taking the time to work on this patch.

Since the config/auto/backtrace.pm has not generated any configuration
or build failures for me on either Linux or Darwin, the most I would be
able to say is whether it does me any harm on either of those systems.

It did no harm on Linux, where it appears I do have the backtrace functions:

Determining whether libc has the backtrace* functions (glibc only)...cc
-pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE -I./include -c test.c
cc -L/usr/local/lib -Wl,-E test.o -o test -lnsl -ldl -lm -lcrypt
-lutil -lpthread
..yes.
Setting Configuration Data:
(
verbose => undef,
);

Nor did it appear to do any harm on Darwin, where it appears I do *not*
have the backtrace functions:

Determining whether libc has the backtrace* functions (glibc

only).../usr/bin/gcc-3.3 -fno-common -no-cpp-precomp -pipe
-I/usr/local/include -pipe -fno-common -Wno-long-double -I./include -c
test.c
test.c:5:22: execinfo.h: No such file or directory
test.c: In function `main':
test.c:15: warning: assignment makes pointer from integer without a cast
...no.
Setting Configuration Data:
(
verbose => undef,
);

But I don't think we should apply it until (a) we get additional failure
results on systems closer to yours; and (b) we have determined that it
does no harm on other OSes.

Compilation gurus? Have at it!

Thanks again.

kid51

Art Haas

unread,
Jan 27, 2008, 12:36:27 PM1/27/08
to bugs-bi...@rt.perl.org
# New Ticket Created by "Art Haas"
# Please include the string: [perl #50298]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50298 >


Hi.

The test for the backtrace() function was failing due to the prototypes
at the start of the test code differing for those listed in the header
file. The patch below fixes things by removing the extra prototypes
and basically copying the sample code from the glibc documentation for
backtrace() into a working example. The patched code successfully built
on my Debian "sid" and Fedora "rawhide" systems and correctly identified
both systems as having the backtrace() function.

Changes: config/auto/backtrace/test_c.in

test_c.in | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

test_c_in.diff

Chromatic

unread,
Jan 27, 2008, 8:08:23 PM1/27/08
to parrot-...@perl.org, Art Haas, bugs-bi...@rt.perl.org
On Sunday 27 January 2008 09:36:27 Art Haas wrote:

> The test for the backtrace() function was failing due to the prototypes
> at the start of the test code differing for those listed in the header
> file. The patch below fixes things by removing the extra prototypes
> and basically copying the sample code from the glibc documentation for
> backtrace() into a working example. The patched code successfully built
> on my Debian "sid" and Fedora "rawhide" systems and correctly identified
> both systems as having the backtrace() function.

It works on Ubuntu, and your explanation makes sense to me too.

+1

James Keenan via RT

unread,
Jan 30, 2008, 7:54:19 PM1/30/08
to perl6-i...@perl.org
No one commented unfavorably on this patch, so I suspect that the only
way we're really going to find out if it's okay is to apply it to trunk
and see if it breaks any smokes. Applied in r25376.

James Keenan via RT

unread,
Jan 31, 2008, 9:03:30 AM1/31/08
to perl6-i...@perl.org
Since this does not appear to be causing any problems for smoke tests,
I'm resolving this ticket.
0 new messages