From: Anand Dixit <Anand.Dixit@Sun.COM>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-user@gnu.org
Subject: Re: seg fault with repeated function calls from C?
Date: Tue, 16 Dec 2008 16:46:04 -0800 [thread overview]
Message-ID: <1229474764.11638.28.camel@home-desktop> (raw)
In-Reply-To: <m363lj21z6.fsf@pobox.com>
Hi Andy,
Here is the output from 'gdb fdtd core' (fdtd is the excutable name).
Another point to note: I had similar problems with the scm_c_eval_string
command - it would also give me segmentation fault after some
iterations. scm_call allows for more evaluations before failing. Let me
know if you want me to try some other command.
--------------------
This GDB was configured as "x86_64-linux-gnu"...
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/libguile.so.17...done.
Loaded symbols for /usr/lib/libguile.so.17
Reading symbols from /usr/lib/libltdl.so.3...done.
Loaded symbols for /usr/lib/libltdl.so.3
Reading symbols from /usr/lib/libgmp.so.3...done.
Loaded symbols for /usr/lib/libgmp.so.3
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libguilereadline-v-17.so.17...done.
Loaded symbols for /usr/lib/libguilereadline-v-17.so.17
Reading symbols from /lib/libreadline.so.5...done.
Loaded symbols for /lib/libreadline.so.5
Reading symbols from /lib/libncurses.so.5...done.
Loaded symbols for /lib/libncurses.so.5
Core was generated by `fdtd poisson.ctl'.
Program terminated with signal 11, Segmentation fault.
[New process 12395]
#0 0x00007f18eff3b49b in scm_gc_mark () from /usr/lib/libguile.so.17
(gdb) bt
#0 0x00007f18eff3b49b in scm_gc_mark () from /usr/lib/libguile.so.17
#1 0x00007f18eff3b3c7 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#2 0x00007f18eff3b3c7 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#3 0x00007f18eff3b241 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#4 0x00007f18eff3b2d6 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#5 0x00007f18eff3b241 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#6 0x00007f18eff3b2d6 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#7 0x00007f18eff3b241 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#8 0x00007f18eff3b2d6 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#9 0x00007f18eff3b3c7 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#10 0x00007f18eff3b241 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#11 0x00007f18eff3b2d6 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#12 0x00007f18eff3b3c7 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#13 0x00007f18eff3b241 in scm_gc_mark_dependencies ()
from /usr/lib/libguile.so.17
#14 0x00007f18eff814a3 in scm_threads_mark_stacks ()
from /usr/lib/libguile.so.17
#15 0x00007f18eff3b598 in scm_mark_all () from /usr/lib/libguile.so.17
#16 0x00007f18eff3a64a in scm_i_gc () from /usr/lib/libguile.so.17
#17 0x00007f18eff3a84e in scm_gc_for_newcell ()
from /usr/lib/libguile.so.17
#18 0x00007f18eff5a3e5 in scm_cons () from /usr/lib/libguile.so.17
#19 0x00007f18eff5a3ff in scm_cons2 () from /usr/lib/libguile.so.17
#20 0x00007f18eff2fee5 in scm_call_4 () from /usr/lib/libguile.so.17
#21 0x00000000004288ab in Esource::fixE (this=0xe04b80) at
esource.hpp:61
#22 0x0000000000423b4a in inner_main (argc=<value optimized out>,
argv=0x7ffff83f3dd8)
---Type <return> to continue, or q <return> to quit---
at fdtd.cpp:722
#23 0x00007f18eff3e99e in ?? () from /usr/lib/libguile.so.17
#24 0x00007f18eff48caf in ?? () from /usr/lib/libguile.so.17
#25 0x00007f18eff2119a in ?? () from /usr/lib/libguile.so.17
#26 0x00007f18eff82865 in scm_c_catch () from /usr/lib/libguile.so.17
#27 0x00007f18eff215b6 in scm_i_with_continuation_barrier ()
from /usr/lib/libguile.so.17
#28 0x00007f18eff21650 in scm_c_with_continuation_barrier ()
from /usr/lib/libguile.so.17
#29 0x00007f18eff81ce3 in scm_i_with_guile_and_parent ()
from /usr/lib/libguile.so.17
#30 0x00007f18eff48c75 in scm_boot_guile () from /usr/lib/libguile.so.17
#31 0x0000000000417dee in main (argc=0, argv=0x10000000000) at
fdtd.cpp:1005
--------------------------
Thanks,
- Anand
On Tue, 2008-12-16 at 23:23 +0100, Andy Wingo wrote:
> On Tue 16 Dec 2008 18:17, Anand Dixit <Anand.Dixit@Sun.COM> writes:
>
> >> I am calling a guile function from my C code. Its a fairly straight
> >> forward implementation. However, as I keep calling this function a
> >> number of times, it breaks at some point with a segmentation fault. Here
> >> is the relevant portion :
>
> Can we see a C-level backtrace? Things look OK to me on first glance.
>
> Andy
next prev parent reply other threads:[~2008-12-17 0:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 6:22 seg fault with repeated function calls from C? Anand Dixit
2008-12-16 17:17 ` Anand Dixit
2008-12-16 20:08 ` Ludovic Courtès
2008-12-17 0:23 ` Anand Dixit
2008-12-17 10:28 ` Neil Jerram
2008-12-16 22:23 ` Andy Wingo
2008-12-17 0:46 ` Anand Dixit [this message]
2008-12-17 2:46 ` Anand Dixit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1229474764.11638.28.camel@home-desktop \
--to=anand.dixit@sun.com \
--cc=guile-user@gnu.org \
--cc=wingo@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).