Skip to Content.
Sympa Menu

freetds - Re: [freetds] Segmentation fault when concurrently opening database connections

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Segmentation fault when concurrently opening database connections
  • Date: Mon, 19 Apr 2004 19:38:30 -0400

On Mon, 19 Apr 2004, Joshua Moore-Oliva <josh AT chatgris.com> wrote:
> When I concurrently open connections (one per thread), I get a segfault
> while executing the dbopen function.
>
> it occurs here
>
> Thread 3:
> ==22112== Invalid read of size 4
> ==22112== at 0x4032B1C3: tds_get_homedir (in
> /usr/lib/libsybdb.so.4.0)==22112== Address 0x14 is not stack'd,
> malloc'd or free'd==22112==
> ==22112== Process terminating with default action of signal 11
> (SIGSEGV): dumping core==22112== Address not mapped to object at
> address 0x14==22112== at 0x4032B1C3: tds_get_homedir (in
> /usr/lib/libsybdb.so.4.0)
>
> However, this behaviour does not present itself if the dbopen function
> call is protected by a mutex..

Hmph. Does the utility addr2line(1) reveal just where in
tds_get_homedir() we go wrong? As you can see from the code
(src/tds/threadsafe.c), the function is heavily conditionalized for
various forms of homedir getting. Maybe our detection system needs work.


Or maybe it would be better to give up and put a local static mutex in
tds_get_homedir()....

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page