Re: Segmentation fault/memory corruption in TclpAlloc()



In article <slrnj8ulgl.244.johnSPAMcarAWAYuso@xxxxxxxxxxxxxxxxxxxxxxxxxx>, John Caruso wrote:
Welcome to my nightmare. :-)

Which has finally ended. For anyone who's interested, the problem was in
the tDOM code (not Tcl) -- there's a memcpy() in there that specifies
sizeof(int*) when it should be using sizeof(int), which worked on a 32-bit
architecture where both of those were 4 but caused problems on a 64-bit
architecture where sizeof(int*) was 8 (so the memcpy was copying twice as
much as it should have). Someone else encountered the same problem:

http://tech.groups.yahoo.com/group/tdom/message/1994

Based on what that person said I tried re-running the server in question
under valgrind yet again (with no suppressions and no error limit), and
valgrind still didn't flag the problem that led to this crash (or any
tDOM functions at all, actually). So I'm not sure what I could have done
differently to track it down.

Thanks to everyone who offered suggestions and assistance--it was much
appreciated.

- John
.



Relevant Pages

  • Re: Segmentation fault/memory corruption in TclpAlloc()
    ... architecture where sizeofwas 8 (so the memcpy was copying twice as ... But I never got any reaction from the tDOM maintainers. ... valgrind still didn't flag the problem that led to this crash (or any ...
    (comp.lang.tcl)
  • Re: [opensuse] Motif application crashes with 12.1 (glibc problem?)
    ... I've started valgrind to check whether there are heap overflows. ... I do not say that glibc is broken. ... Btw. the memcpy change was not in 11.4, we disabled it, ...
    (SuSE)
  • Re: Is memcpy secure?
    ... I am concerned that if I use memcpy, ... > Depends on your OS and architecture. ... > involved sending a page-sized copy request to a hardware dma unit. ... It's Linux and not intended for any special architecture. ...
    (comp.security.misc)
  • Re: Is memcpy secure?
    ... I am concerned that if I use memcpy, ... > Depends on your OS and architecture. ... > involved sending a page-sized copy request to a hardware dma unit. ... It's Linux and not intended for any special architecture. ...
    (comp.lang.c)
  • Re: [patch 5/8] Immediate Values - x86 Optimization (simplified)
    ... Rusty Russell wrote: ... This is now almost entirely generic code, but I suppose we can let the next ... I have to call those architecture specific primitives: ... a memcpy that copies to write protected memory (disables the ...
    (Linux-Kernel)