[gnu.gdb.bug] segmentation violation with large symbol tables

glenne%hplsla@HP-SDE.SDE.HP.COM (Glenn Engel) (03/15/89)

I received a segmentation violation when attempting to read a file
which had a 2.1 Mbyte symbol table.  A backtrace revealed the culprit
to be the alloca() call near line 1500 of dbxread.c in
symbol_file_command().  I'm not sure whether this is a gdb problem or
a kernel bug.  What seems to be happening is the kernel is generating
a segmentation violation when the stack is extended in alloca.
Evidently it assumes a 2.1 Mbyte stack extension all at once really
means the program is out-to-lunch.  Another possibility is that there
is a kernel parameter that needs to be tuned for this type of
application.  At any rate, changing the alloca to malloc fixes my
problem but also requires a free at the end of the function.

--
 |  Glenn R. Engel
 |  Hewlett-Packard 
 |  (206) 335-2066
 |  glenne%hplsla@hplabs.hp.com

rang@cpsin3.cps.msu.edu (Anton Rang) (03/16/89)

Is your stack limit set too low?  Maybe try 'limit stack 3m' or
something like that, if you're using the shell.  On the other hand,
should there be some "reasonable" maximum size for stack allocation?

+---------------------------+------------------------+----------------------+
| Anton Rang (grad student) | "VMS Forever!"         | "Do worry...be SAD!" |
| Michigan State University | rang@cpswh.cps.msu.edu |                      |
+---------------------------+------------------------+----------------------+