Thanks Nick for the response.
I looked up how to use gdb very quickly. I found out that the segfault is
happening at the same place I suspected.
As I suspected, the lines causing the segfault are similar to:
// dir_cfg contains mostly ints
struct intContainer
{
int x
} intContainer;
/* ... later... in the merge function */
static void* dir_cfg_merge_function (apr_pool_t* the_pool, void*
the_parent_dir_cfg, void* the_sub_dir_cfg)
{
intContainer* merged_dir_cfg = apr_pcalloc(p, 1*sizeof(intContainer));
int y = 1;
merged_dir_cfg->x = y; // this line causes a segfault... why?
// this line would also segfault:
memcpy(, , 1*sizeof(int));
return merged_dir_cfg;
}
I still can't figure out what the issue is. Is there any way to tell if the
apr_pcalloc is failing?
On 2/7/07, Nick Kew <[EMAIL PROTECTED]> wrote:
On 8 Feb 2007, at 00:46, David Wortham wrote:
>
> I am testing on LINUX, and that's where my whitescreens are showing up
> (haven't started cross-platform testing yet). I have encountered
> them in
> the past and they culprit has always been a segfault.
> I suspected a segfault-like error at the end of startup causing the
> whitescreens, but I don't yet have a way to verify this. Also, I
> don't know
> where in my code the segfault could have occurred (unless the memory
> allocation request was denied).
Run it with -X under gdb. Do whatever it is that causes the segfault.
Then get a backtrace from gdb.
--
Nick Kew