[Bioc-devel] Segfault/Valgrind/bgx
Martin Morgan
mtmorgan at fhcrc.org
Sun May 6 02:04:25 CEST 2007
Ernest,
I wonder if the problem comes from writing to your C variable dirname
in bgx.cc:243 ?
At the risk of spreading mis-information, from looking at the code for
.C, in src/main/dotcode.c:do_dotCode and RObjToCPtr, it looks like
what happens is that 'gobbledigook' is copied to dirname[0], with
allocation for strlen(gobbledigook)+1 space; you'll then overwite this
with the return path, and bad things happen when the return path is
longer than gobbledigook.
Perhaps pass the return path in from R?
Hope that helps,
Martin
Ernest Turro <ernest.turro at ic.ac.uk> writes:
> Dear all,
>
> my package ( svn co https://hedgehog.fhcrc.org/bioconductor/trunk/
> madman/Rpacks/bgx ) segfaults sometimes. I say sometimes because, for
> instance, on lamb1 it doesn't, and on wellington it does, on my own
> machine it doesn't - except if I run it through valgrind...). When I
> run the code as a standalone binary, there are no segfaults. Anyway,
> the problem according to valgrind's stack trace appears to be in
> libR.so - not directly in my own C code. I think it occurs when calling:
>
> # bgx/R/mcmc.R:36
> # free allocated memory on user interrupt/end of simulation
> on.exit(.C("freeBGXMemory", as.integer(out.ind), as.integer
> (numberGenesToWatch), PACKAGE = "bgx"))
>
> Specifically, when calling as.integer(numberGenesToWatch).
>
> The relevant part of valgrind's stack trace is below. The full trace
> is below that. Does anyone have any ideas? I've been debugging for
> quite a while and I really don't know what more to do..
>
> Many thanks!
--
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org
More information about the Bioc-devel
mailing list