* malloc debug for Alpha
@ 1993-12-03 20:30 Charles Geyer
1993-12-04 0:48 ` fairfield
1993-12-05 18:02 ` Charles Geyer
0 siblings, 2 replies; 3+ messages in thread
From: Charles Geyer @ 1993-12-03 20:30 UTC (permalink / raw)
Got a problem. I have to port a bunch of C code to Alpha. The code runs
fine on 32 bit machines, but bombs on an Alpha. Lots of print statements
show that malloc is returning pointers to blocks that overlap other blocks
that were previously allocated and not freed. O. K. so the code wasn't
written portably. I know, don't tell me.
The next step was to try to get a malloc debugging package. So I snarfed
malloclib from comp.sources.unix and GNU malloc. Neither one passes it's
tests on the Alpha. O. K. so the code wasn't written portably.
What now? Anyone have any suggestions? Besides more print statements :-(
--
Charles Geyer
School of Statistics
University of Minnesota
charlie@stat.umn.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: malloc debug for Alpha
1993-12-03 20:30 malloc debug for Alpha Charles Geyer
@ 1993-12-04 0:48 ` fairfield
1993-12-05 18:02 ` Charles Geyer
1 sibling, 0 replies; 3+ messages in thread
From: fairfield @ 1993-12-04 0:48 UTC (permalink / raw)
In article <CHH7sD.9Ao@news.cis.umn.edu>,
charlie@umnstat.stat.umn.edu (Charles Geyer) writes:
> Got a problem. I have to port a bunch of C code to Alpha. The code runs
> fine on 32 bit machines, but bombs on an Alpha. Lots of print statements
> show that malloc is returning pointers to blocks that overlap other blocks
> that were previously allocated and not freed. O. K. so the code wasn't
> written portably. I know, don't tell me.
>
> The next step was to try to get a malloc debugging package. So I snarfed
> malloclib from comp.sources.unix and GNU malloc. Neither one passes it's
> tests on the Alpha. O. K. so the code wasn't written portably.
>
> What now? Anyone have any suggestions? Besides more print statements :-(
No solutions, just two suggestions:
1) Have you made sure that all your pointer variables are 64-bits?
(Use `long int' I think...)
2) Post your query to vmsnet.alpha for quick and knowledgeable
response. :-)
-Ken
--
Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu
SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
Stanford, CA 94309 | Voice: (415) 926-2924 FAX: (415) 926-4335
----------------------------------------------------------------------------
These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: malloc debug for Alpha
1993-12-03 20:30 malloc debug for Alpha Charles Geyer
1993-12-04 0:48 ` fairfield
@ 1993-12-05 18:02 ` Charles Geyer
1 sibling, 0 replies; 3+ messages in thread
From: Charles Geyer @ 1993-12-05 18:02 UTC (permalink / raw)
In article <CHH7sD.9Ao@news.cis.umn.edu> charlie@umnstat.stat.umn.edu
I asked for malloc debugging help. Many thanks to all who sent suggestions.
What worked the best was the version of Electric Fence modified for the
Alpha that a kind person at DEC told me about and where to snarf it.
Under Electric Fence the program crashed where the problem was instead of
much later.
If anyone is curious the problem was an
(int **) malloc(thesize * sizeof(int))
which (of course) should have been
(int **) malloc(thesize * sizeof(int *))
obvious, but hard to find in a huge pile of code.
Thanks again,
--
Charles Geyer
School of Statistics
University of Minnesota
charlie@stat.umn.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1993-12-05 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-12-03 20:30 malloc debug for Alpha Charles Geyer
1993-12-04 0:48 ` fairfield
1993-12-05 18:02 ` Charles Geyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox