MYSQL connector 的 NullReferenceException bug
mysql connector 連線報錯, 客戶端在 MySqlClient.MySqlDataReader.NextResult() 處報錯 ,IIS 程式池 crash 後 db 端提示 Got an error reading communication packets 。
異常時堆疊呼叫資訊:
ServerConnectionInfo.Finallize()
=>ServerConnectionInfo.Dispose()
=>MySqlConnection.Dispose()
=>MySqlConnection.Close()
=>MySqlDataReader.Close()
=》MySqlDataReader.NextResult()
從堆疊呼叫資訊來看,是從程式中發起了Dispose(),後再呼叫了MySqlConnection.Dispose()進行關閉。 在這裡MySqlConnection.Close()又呼叫MySqlDataReader.Close()=》MySqlDataReader.NextResult(),從應用程式碼瞭解到MySqlConnection.Close()一般應為正常關閉的最後一步,而MySqlDataReader.Close()應在MySqlConnection.Close()之厚,這看起來是個非正常行為。
報錯資訊與connector 的 Bug#91106 NullReferenceException in Finalize crashes applications及Bug#90845
NullReferenceException on connection close比較匹配,易工已透過修改connetor原始碼進行測試。
Bug#90845:
Description:
A NullReferenceException is thrown on MySqlConnection Dispose
The NullReference came from the setter of the property Reader.
In the getter the driver has a null check but in the setter it is treated as a NotNull value
Bug#91106
Suggested fix:
The MySqlDataReader that is used underneath by the command and dataadapter should have been disposed of when the commmand and dataadapter were disposed. I think that is probably a bug.
If it wasn't disposed of correctly then, the finalize method should not assume the driver and driver.stream are not null. or you can catch these exceptions in dispose and not crash the program.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29863023/viewspace-2719547/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用mysql-connector-python操作MYSQL資料庫MySqlPython資料庫
- mysql explain的bug薦MySqlAI
- mysql-connector-java各種版本下載地址MySqlJava
- MySQL 鎖bug?MySql
- mysql bug 55981MySql
- mysql 安全bugMySql
- mysql 原生 線上DDL 的bug .MySql
- MySQL Connector/Python 查詢如何返回欄位名MySqlPython
- .lastUpdated:The POM for mysql:mysql-connector-java:jar:8.1.0 is missing, no dependency information availableASTMySqlJavaJARORMAI
- 這是mysql driver的bug嗎?MySql
- 【MySql】innobackupex 增量備份的bugMySql
- 【MySQL】全索引掃描的bugMySql索引
- 急!mysql5.0+connector/J3.0.9+tomcat5.0.14MySqlTomcat
- MYSQL connector/.NET 預設的 show variables 引起的執行緒mutex鎖爭用MySql執行緒Mutex
- SAP Java Connector 的配置指南Java
- MySQL8.0.11 Community Server 與 驅動 mysql-connector-java-8.0.11.jarMySqlUnityServerJavaJAR
- FluentData Mysql分頁的一個BUGMySql
- Mysql bug列表、論壇MySql
- MySQL UDF的除錯方式 - debugview (轉)MySql除錯View
- PySpark-MongoDB ConnectorSparkMongoDB
- MySQL UDF 在 in ( subquery where ) bugMySql
- mysql xtrabackup 遭遇嚴重bugMySql
- Window7 python2.7 拋錯ImportError No module named mysql.connectorPythonImportErrorMySql
- Python 利用pandas和mysql-connector獲取Excel資料寫入到MySQL資料庫PythonMySqlExcel資料庫
- SpingBoot - Mybatis報錯:For artifact {com.mysql:mysql-connector-j:null:jar}: The version cannot be empty.bootMyBatisMySqlNullJAR
- 【MySQL】xtrabackup 2.4.12備份觸發的bugMySql
- MySQL的這個bug,坑了多少人?MySql
- Acceptor-Connector模式系列模式
- 工具 | 常用 MySQL 核心 Debug 技巧MySql
- Nebula Flink Connector 的原理和實踐
- MySQL Bug導致異常當機的分析流程MySql
- MySQL關於timestamp和mysqldump的一個“bug”MySql
- flink connector 之FlinkKafkaProducerKafka
- SAP Java Connector 元件介紹Java元件
- MySQL:關於Bug #81119MySql
- 線上BUG:MySQL死鎖分析實戰MySql
- MySQL:關於Bug #20939184MySql
- mysql partition table use to_days bugMySql