[unixODBC-support] Is Unix ODBC Driver Manager using /tmp

Thomas A. Lowery tlowery at rparts.us
Mon Nov 1 21:03:42 GMT 2004


Nick,

On Sun, Oct 31, 2004 at 10:03:10PM +0000, Nick Gorham wrote:
> Thomas A. Lowery wrote:
> 
> >I've a commercial product called data integrator (was data junction) 
> >from Pervasive that
> >I'm using to extract data to a text file from a large ms sql server 
> >table.
> >dj (Linux) -> unixodbc -> freetds(odbc) -> sql server
> >During the extract /tmp is running out of space.
> >
> >However, when I do the same extract using perl DBD::ODBC it works.
> >perl DBI -> DBD::ODBC -> unixodbc -> freetds(odbc) -> sql server
...
> Not sure about freetds, but I don't think its the driver manager, The 
> only other  possibility is  its  something unixODBC is using like iconv, 
> but I don;t think so, I am sure I would have had this reported before.
> 
> One posibility I have thought of, the stats part of the driver manager 
> does a ftok to get a semaphore handle.
> 
> If you turn on odbc tracing, the strace will show the entry and exit 
> writes to the trace file, so if the tmp  write is between a entry and a 
> exit, you know its the DM or driver.

It appears that the /tmp file usage is done after a close and before the next open 
of the trace file.


Here's a snip from the strace:

open("/tmp/sql.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 8
fstat64(8, {st_mode=S_IFREG|0644, st_size=268393, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x420a4000
fstat64(8, {st_mode=S_IFREG|0644, st_size=268393, ...}) = 0
_llseek(8, 268393, [268393], SEEK_SET)  = 0
getpid()                                = 4817
write(8, "[ODBC][4817][SQLFetchScroll.c][1"..., 150) = 150
close(8)                                = 0

munmap(0x420a4000, 4096)                = 0
stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
getpid()                                = 4817
open("/tmp/tmpfNojaqx", O_RDWR|O_CREAT|O_EXCL, 0600) = 8
rmdir("/tmp/tmpfNojaqx")                = -1 ENOTDIR (Not a directory)
unlink("/tmp/tmpfNojaqx")               = 0
fcntl64(0x8, 0x3, 0xbffe8e88, 0x3)      = 2
fstat64(8, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x420a4000
_llseek(8, 0, [0], SEEK_CUR)            = 0
_llseek(8, 0, [0], SEEK_SET)            = 0

open("/tmp/sql.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 9
fstat64(9, {st_mode=S_IFREG|0644, st_size=268543, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x420a5000
fstat64(9, {st_mode=S_IFREG|0644, st_size=268543, ...}) = 0
_llseek(9, 268543, [268543], SEEK_SET)  = 0
getpid()                                = 4817
write(9, "[ODBC][4817][SQLFetchScroll.c][3"..., 57) = 57
close(9)                                = 0

So whatever is opening the tmp file is doing so outside of the DM and driver?

Tom




More information about the unixODBC-support mailing list