Package: unixodbc
Version: 2.2.14p2-5

Unixodbc is patched to use libltdl

The following stack trace shows a double free coming from lt_dlsetsearchpath()
when multithread usage of odbc is being done with FreeSWITCH



#0  0x00007f3aed113475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f3aed1166f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f3aed14e52b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007f3aed157d76 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007f3aed15cb1c in free () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f3aeceddc65 in lt_dlsetsearchpath () from
/usr/lib/x86_64-linux-gnu/libltdl.so.7
#6  0x00007f3aeed9c103 in ?? () from /usr/lib/x86_64-linux-gnu/libodbc.so.1
#7  0x00007f3aeed9edfc in SQLConnect () from
/usr/lib/x86_64-linux-gnu/libodbc.so.1


According to the documentation at
http://www.delorie.com/gnu/docs/libtool/libtool_46.html

Note that libltdl is not threadsafe, i.e. a multithreaded application has
to use a mutex for libltdl. It was reported that GNU/Linux's glibc 2.0's
dlopen with `RTLD_LAZY' (which libltdl uses by default) is not thread-safe,
but this problem is supposed to be fixed in glibc 2.1. On the other hand,
`RTLD_NOW' was reported to introduce problems in multi-threaded
applications on FreeBSD. Working around these problems is left as an
exercise for the reader; contributions are certainly welcome.


I think the patch needs to be changed to use this lib with a mutex to avoid
memory corruption when concurrent calls to opening sql drivers are
performed in a multi-threaded app or the use of this libltdl should be
discontinued.




-- 
Anthony Minessale II       ♬ @anthmfs  ♬ @FreeSWITCH  ♬

☞ http://freeswitch.org/http://cluecon.com/http://twitter.com/FreeSWITCH
☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+
<http://freeswitch.org/g+>*

ClueCon Weekly Development Call
☎ sip:[email protected]  ☎ +19193869900

Reply via email to