Skip to Content.
Sympa Menu

freetds - [freetds] gethostbyname_r fails if statically linked

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "John Wythe" <jwythe AT silksystems.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] gethostbyname_r fails if statically linked
  • Date: Thu, 9 Mar 2006 18:24:22 -0800

Has anyone one ever tried to statically link a program that accesses both
MySQL and unixODBC. The reason I ask is that the gethostbyname_r function
acts strange of seg faults
when my program is linked statically, dynamically it works find, as do the
isql and iusql programs. The call to gethostbyname_r in question is deep
inside freetds in the threadsafe.c source. If my program is statically
linked it always returns NULL, and h_errno is never changed. All programs
and code are compiled on the system in question freetds, unixODBC, and my
program. My thinking is that somehow the dlopened tds library is somehow
accessing a copy of gethostbyname_r that is statically linked into my
program, instead of one that is dynamically available. Maybe somehow there
are too different libraries with the same function, and my program gets a
different one (maybe because of MySQL) when linked statically.

John


John Wythe, Systems Programmer

Phone: (800) 663-0718

Fax: (604) 468-1667

jwythe AT silksystems.com




Attachment: silk_signature.jpg
Description: JPEG image




Archive powered by MHonArc 2.6.24.

Top of Page