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 鎖bug?MySql
- .lastUpdated:The POM for mysql:mysql-connector-java:jar:8.1.0 is missing, no dependency information availableASTMySqlJavaJARORMAI
- MySQL Connector/Python 查詢如何返回欄位名MySqlPython
- mysql-connector-java各種版本下載地址MySqlJava
- MySQL8.0.11 Community Server 與 驅動 mysql-connector-java-8.0.11.jarMySqlUnityServerJavaJAR
- mysql 原生 線上DDL 的bug .MySql
- MySQL:關於Bug #81119MySql
- MySQL:關於Bug #20939184MySql
- MYSQL connector/.NET 預設的 show variables 引起的執行緒mutex鎖爭用MySql執行緒Mutex
- SAP Java Connector 的配置指南Java
- 【MySQL】xtrabackup 2.4.12備份觸發的bugMySql
- MySQL UDF 在 in ( subquery where ) bugMySql
- SpingBoot - Mybatis報錯:For artifact {com.mysql:mysql-connector-j:null:jar}: The version cannot be empty.bootMyBatisMySqlNullJAR
- MySQL的這個bug,坑了多少人?MySql
- Python 利用pandas和mysql-connector獲取Excel資料寫入到MySQL資料庫PythonMySqlExcel資料庫
- flink connector 之FlinkKafkaProducerKafka
- Nebula Flink Connector 的原理和實踐
- 如何使用 TDengine Sink Connector?
- 分享2個近期遇到的MySQL資料庫的BUG案例MySql資料庫
- 記一次 Mysql 日期使用不當造成的 bugMySql
- MySQL案例07:MySQL5.7併發複製隱式bugMySql
- MySQL 8.0.25 Bug 報"MY-013132 The table ...is full"MySql
- MySQL 5.6 遭遇 OS bug INNODB MONITOR OUTPUT 事件MySql事件
- 線上BUG:MySQL死鎖分析實戰MySql
- 惡性BUG:unity MySQL匯出出現1252UnityMySql
- SAP Java Connector 元件介紹Java元件
- MySQL8.0的一個bug導致複製延時MySql
- 當 mysql-connector-java-5 遇上 MySQL8,終究還是錯付了 → 門當戶對真的很重要!MySqlJava
- MySQL 記一次 Bug發現過程MySql
- Presto通過RESTful介面新增ConnectorREST
- Flink Kafka Connector與Exactly Once剖析Kafka
- Confluent之Kafka Connector初體驗Kafka
- Spark Connector Reader 原理與實踐Spark
- 一個 MySQL sql 語句執行順序帶來的 bugMySql
- 使用Java connector消費ABAP系統的函式Java函式
- Pravega Flink connector 的過去、現在和未來
- SAP Java Connector 正常執行所需的網路配置Java
- 給找 Bug 的工具(larastan)找 BugAST