Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Feb 2004 16:41:07 -0700
From:      Joe Lewis <joe@joe-lewis.com>
To:        freebsd-questions@freebsd.org
Subject:   programming help - dlopen() segmentation fault
Message-ID:  <40242613.8090201@joe-lewis.com>

next in thread | raw e-mail | index | archive | help
G'Day, ladies and gents;

I've got a program that I am trying to play around with.  Once I've 
added dlopen() using --export-dynamic, every time I try to run the 
program, I get a segmentation fault.  It always occurs on the same line 
of code :

    modules = new_module_pointer;

I can comment that line out, and suddenly the thing runs without a 
hitch.  However, I kinda need that line.  When I run gdb on the core 
dump, I get :

GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(no debugging symbols found)...
Core was generated by `server'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libc.so.4...(no debugging symbols 
found)...done.
Reading symbols from 
/home/j/joe/code/mail/source/modules/mail_mod_sample.so...
(no debugging symbols found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols 
found)...
done.
#0  0x280da8ba in __sfvwrite () from /usr/lib/libc.so.4
(gdb)

Does anyone have any ideas?

Joe



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40242613.8090201>