[Klone-users] klone segfaults
Mark Richards
mark.richards at massmicro.com
Sun Feb 10 14:23:37 EST 2008
Klone 2.0.0
Dev env: 2.6.18-8.1.3.el5 #1 SMP Mon Apr 30 19:55:44 EDT 2007 i686 i686
i386 GNU/Linux
cross-compiling: cris-axis
target: 2.6.19 #4 Wed Jan 30 19:20:26 EST 2008 cris unknown
Klone has been extremely reliable, however I've been tracking down an
issue with sqlite3 which led me to other issues and eventually to a huge
rewrite of a main shared library (called aemutils) that provides a
sqlite3 wrapper and other utilities to my klone application.
As a result, apparently of some changes along the way, klone breaks
(other apps that use the re-written shared lib do not - and they use the
same call that klone breaks on).
The header file of aemutils.so contains a structure defined:
struct _sysinfo
{
int nSiteNr;
int nEmailTimeout;
int is_debug;
}
There are many functions in the main source of my shared library that
reference the structure. So at the top of the shared lib source I do this:
struct _sysinfo sysinfo;
which makes sysinfo public.
This same _sysinfo structure is defined in the header file of my
libkloneaemlib which is included in my klone build:
WEBAPP_LDADD = $(TOP)/src/libkloneaemlib.a
index.kl1 references the structure thusly:
extern struct _sysinfo sysinfo;
When my index.kl1 starts and hits this code it segfaults:
# kloned (pid 792) segfaults for page address 00082000 at pc 00097198
If I don't define the extern struct _sysinfo sysinfo and remove a
statement that makes an assignment to an element of the structure, klone
works. However, if I then call a function in the aemutils.so that does
the same thing, klone breaks again.
Although I made lots of changes to aemitils.so I haven't changed
anything with this particular structure or the way it's handled in
aemutils.so (or for that matter, klone). Therefore I am at a loss to
explain, particularly as it works OK with other apps.
To see if it was a matter of klones thread model, I set it to iterative.
No difference.
Maybe this is a stupid coding problem.
Help :)
More information about the klone-users
mailing list