* [Linux-ia64] ia64 gcc implementation of alloca
@ 2000-06-06 22:34 roneng
2000-06-07 1:29 ` Jim Wilson
0 siblings, 1 reply; 2+ messages in thread
From: roneng @ 2000-06-06 22:34 UTC (permalink / raw)
To: linux-ia64
Hi,
Has anyone had any problem using alloca, or knows where in the gcc code it
is implemented?
when I run my program get the following error:
Program received signal SIGSEGV, Segmentation fault.
loose (code\x14, fd=6, name=0x9ffffffffff05ca0 "libnss_files.so.2",
realname=0x60000000000115b0 "/lib/libnss_files.so.2", l=0x0,
msg=0x200000000002f880 "cannot read file data") at dl-load.c:642
642 a[0] = fd;
(gdb)
the code around line 642 is the following
__attribute__ ((noreturn))
lose (int code, int fd, const char *name, char *realname, struct link_map
*l,
const char *msg)
{
/* The use of `alloca' here looks ridiculous but it helps. The goal
is to avoid the function from being inlined. There is no official
way to do this so we use this trick. gcc never inlines functions
which use `alloca'. */
int *a = alloca (sizeof (int));
a[0] = fd;
simple testcases of alloca seem to work, so this is probably an
intermittent problem.
Thank you,
Ronen Grosman
- e-mail roneng@ca.ibm.com
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Linux-ia64] ia64 gcc implementation of alloca
2000-06-06 22:34 [Linux-ia64] ia64 gcc implementation of alloca roneng
@ 2000-06-07 1:29 ` Jim Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Jim Wilson @ 2000-06-07 1:29 UTC (permalink / raw)
To: linux-ia64
Has anyone had any problem using alloca, or knows where in the gcc code it
is implemented?
There is a lot of GNU code that uses alloca. I haven't seen any alloca bug
reports.
There are a number of places in gcc that deal with alloca. The main one
is allocate_dynamic_stack_space in explow.c.
It is probably easier to debug your failing code before trying to debug gcc.
Look at the instruction that failed, disassemble the loose routine, and figure
out why you get the segmentation fault. It could be a problem with the code
rather than a gcc problem. Is the stack pointer valid? Is it aligned
properly, does it point to a valid stack address?
It looks like the program is dying in the dynamic loader when trying to load a
shared library. Do you have a reasonably up to date copy of the dynamic
loader? Are your shared libraries up to date? There were many reports of
problems with glibc failing when a /etc/nsswitch.conf file was present early
this year, but it seems to work fine now. The Red Hat May 17, 2000 OS release
has the file and it works fine. I suspect a glibc bug that was fixed maybe a
month or two ago.
Jim
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-06-07 1:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-06 22:34 [Linux-ia64] ia64 gcc implementation of alloca roneng
2000-06-07 1:29 ` Jim Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox