Discussion:
[freetds] Question concerning crash SEGV in tds_free_results
Edwin Boatswain
2013-10-25 11:53:54 UTC
Permalink
Hello,

I?m hoping someone has seen or can provide some insight into the following. We have an issue where one of our customers is interfacing to an MS SQL Server database from a Linux Virtual Machine. To accomplish this we?re using FreeTDS 0.91 and iODBC 3.52.8. On our reproduction of their environment, replaying the customer?s own data, this works fine. The customer however is seeing intermittent crashes with a stack trace that looks like this:

Program terminated with signal 11, Segmentation fault.
#0? tds_free_results (res_info=0x6f726300) at mem.c:528
528???? mem.c: No such file or directory.
??????? in mem.c
(gdb) where
#0? tds_free_results (res_info=0x6f726300) at mem.c:528
#1? 0xf4e12def in tds_free_param_results (param_info=0x6f726300) at mem.c:479
#2? 0xf4e12604 in tds_free_input_params (dyn=0x93e8898) at mem.c:132
#3? 0xf4e07dc7 in _SQLExecute (stmt=0x9f61520) at odbc.c:3074
#4? 0xf4e0809c in SQLExecute (hstmt=0x9f61520) at odbc.c:3256
#5? 0xf4e5b456 in SQLExecute_Internal (hstmt=0x9f61458) at execute.c:373
#6? 0xf4e5b6cd in SQLExecute (hstmt=0x9f61458) at execute.c:459
#7? 0x08b64370 in IodbcCursor::Execute (this=0xa09e460, nPlaceHolderCount=2,
??? ppPlaceHolders=0x9c3f5f0) at odbcClient.cpp:1718
#8? 0x08b4a713 in SACommand::Execute (this=0xa09e408) at SQLAPI.cpp:3889
#9? 0x08b2da7c in DBConnection::wexecutePrepared (this=0x9f3e0ec)
??? at ../../src/DBConnection.cpp:1142
#10 0x08b369b0 in DBConnection::run (this=0x9f3e0ec)
??? at ../../src/DBConnection.cpp:1792
#11 0x08b37c47 in DBConnectionBlockingRun (arg=0x9f3e0ec)
??? at ../../src/DBConnection.cpp:1839
#12 0xf71dd879 in start_thread () from /lib/libpthread.so.0
#13 0xf6f9cffe in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

I was wondering if there any known issues in this area or perhaps someone has seen this before?

Regards,
Edwin Boatswain
--
Edwin Boatswain ? Software Developer ? ITRS Group Ltd



______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Frediano Ziglio
2013-10-26 08:39:48 UTC
Permalink
Could be a race condition related to thread support. Surely development version has free thread support for odbc, not sure this feature was supported on 0.91. UnixOdbc make our library safer even without, not iOdbc. I'll check it

Frediano Ziglio
Post by Edwin Boatswain
Hello,
Program terminated with signal 11, Segmentation fault.
#0 tds_free_results (res_info=0x6f726300) at mem.c:528
528 mem.c: No such file or directory.
in mem.c
(gdb) where
#0 tds_free_results (res_info=0x6f726300) at mem.c:528
#1 0xf4e12def in tds_free_param_results (param_info=0x6f726300) at mem.c:479
#2 0xf4e12604 in tds_free_input_params (dyn=0x93e8898) at mem.c:132
#3 0xf4e07dc7 in _SQLExecute (stmt=0x9f61520) at odbc.c:3074
#4 0xf4e0809c in SQLExecute (hstmt=0x9f61520) at odbc.c:3256
#5 0xf4e5b456 in SQLExecute_Internal (hstmt=0x9f61458) at execute.c:373
#6 0xf4e5b6cd in SQLExecute (hstmt=0x9f61458) at execute.c:459
#7 0x08b64370 in IodbcCursor::Execute (this=0xa09e460, nPlaceHolderCount=2,
ppPlaceHolders=0x9c3f5f0) at odbcClient.cpp:1718
#8 0x08b4a713 in SACommand::Execute (this=0xa09e408) at SQLAPI.cpp:3889
#9 0x08b2da7c in DBConnection::wexecutePrepared (this=0x9f3e0ec)
at ../../src/DBConnection.cpp:1142
#10 0x08b369b0 in DBConnection::run (this=0x9f3e0ec)
at ../../src/DBConnection.cpp:1792
#11 0x08b37c47 in DBConnectionBlockingRun (arg=0x9f3e0ec)
at ../../src/DBConnection.cpp:1839
#12 0xf71dd879 in start_thread () from /lib/libpthread.so.0
#13 0xf6f9cffe in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further
I was wondering if there any known issues in this area or perhaps someone has seen this before?
Regards,
Edwin Boatswain
--
Edwin Boatswain ? Software Developer ? ITRS Group Ltd
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Frediano Ziglio
2013-11-01 18:11:24 UTC
Permalink
Yes, definitely a feature in git but not on 0.91

Frediano
Post by Frediano Ziglio
Could be a race condition related to thread support. Surely development version has free thread support for odbc, not sure this feature was supported on 0.91. UnixOdbc make our library safer even without, not iOdbc. I'll check it
Frediano Ziglio
Post by Edwin Boatswain
Hello,
Program terminated with signal 11, Segmentation fault.
#0 tds_free_results (res_info=0x6f726300) at mem.c:528
528 mem.c: No such file or directory.
in mem.c
(gdb) where
#0 tds_free_results (res_info=0x6f726300) at mem.c:528
#1 0xf4e12def in tds_free_param_results (param_info=0x6f726300) at mem.c:479
#2 0xf4e12604 in tds_free_input_params (dyn=0x93e8898) at mem.c:132
#3 0xf4e07dc7 in _SQLExecute (stmt=0x9f61520) at odbc.c:3074
#4 0xf4e0809c in SQLExecute (hstmt=0x9f61520) at odbc.c:3256
#5 0xf4e5b456 in SQLExecute_Internal (hstmt=0x9f61458) at execute.c:373
#6 0xf4e5b6cd in SQLExecute (hstmt=0x9f61458) at execute.c:459
#7 0x08b64370 in IodbcCursor::Execute (this=0xa09e460, nPlaceHolderCount=2,
ppPlaceHolders=0x9c3f5f0) at odbcClient.cpp:1718
#8 0x08b4a713 in SACommand::Execute (this=0xa09e408) at SQLAPI.cpp:3889
#9 0x08b2da7c in DBConnection::wexecutePrepared (this=0x9f3e0ec)
at ../../src/DBConnection.cpp:1142
#10 0x08b369b0 in DBConnection::run (this=0x9f3e0ec)
at ../../src/DBConnection.cpp:1792
#11 0x08b37c47 in DBConnectionBlockingRun (arg=0x9f3e0ec)
at ../../src/DBConnection.cpp:1839
#12 0xf71dd879 in start_thread () from /lib/libpthread.so.0
#13 0xf6f9cffe in clone () from /lib/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further
I was wondering if there any known issues in this area or perhaps someone has seen this before?
Regards,
Edwin Boatswain
--
Edwin Boatswain ? Software Developer ? ITRS Group Ltd
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Loading...