[MDEV-7403] should not pass recv_writer_thread_handle to CloseHandle() Created: 2015-01-02 Updated: 2015-01-14 Resolved: 2015-01-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0.15 |
| Fix Version/s: | 10.0.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | sbester1 | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows |
||
| Description |
|
Calling CloseHandle on an invalid handle. See here: UNIV_INTERN os_thread_t recv_writer_thread_handle = 0; recv_init_crash_recovery() does: recv_writer_thread_handle = os_thread_create(recv_writer_thread, 0, 0); recv_recovery_from_checkpoint_finish() does: if (recv_writer_thread_handle) { CloseHandle(recv_writer_thread_handle); }However, os_thread_create() is not returning the HANDLE object from CreateThread, it is returning the lpThreadId!!! |
| Comments |
| Comment by sbester1 [ 2015-01-02 ] |
|
Worst case scenario, crash recovery closes some actual valid file or thread handle and failure would be mysterious! |
| Comment by sbester1 [ 2015-01-02 ] |
|
Same problem here in fts_parallel_tokenization(): |
| Comment by sbester1 [ 2015-01-03 ] |
|
Offending patch: |
| Comment by Jan Lindström (Inactive) [ 2015-01-06 ] |
|
revno: 4549 Analysis: For some reason actual thread handle is not Fix: Return thread handle from os_thread_create() |
| Comment by Elena Stepanova [ 2015-01-11 ] |
|
The fix was pushed into 10.0, should the bug now be closed? |
| Comment by Jan Lindström (Inactive) [ 2015-01-11 ] |
|
Actual fix is tested on Windows only, and last build did not test the code at all. Above complain is because by default there is no several purge threads. |