ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102419] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
@ 2021-02-08 20:03 ` test35965
  2021-02-08 20:08 ` [ruby-core:102420] " test35965
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: test35965 @ 2021-02-08 20:03 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by test35965@gmail.com (Alexander Riccio).


Still active as of Ruby 3.0.0p0 (x64-mingw32). I've done some more digging, and it appears to be freeing the Thread_Mutex in rb_call_inits (inits.c), aka the Init_Thread_Mutex function in thread.c.

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-90291

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:102420] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
  2021-02-08 20:03 ` [ruby-core:102419] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby test35965
@ 2021-02-08 20:08 ` test35965
  2021-03-11  0:57 ` [ruby-core:102818] " nobu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: test35965 @ 2021-02-08 20:08 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by test35965@gmail.com (Alexander Riccio).


How do I assign? It looks like this should go to @ko1 (eval) or @nobu (mingw)

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-90292

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:102818] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
  2021-02-08 20:03 ` [ruby-core:102419] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby test35965
  2021-02-08 20:08 ` [ruby-core:102420] " test35965
@ 2021-03-11  0:57 ` nobu
  2021-03-11 11:06 ` [ruby-core:102823] " naruse
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2021-03-11  0:57 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED

`vm->waitpid_lock` and `vm->workqueue_lock` seem never deleted.
`rb_native_mutex_destroy` on them are disabled by `if (0)` in `rb_vm_gvl_destroy()`, and that function is not called from anywhere too.
I have no idea why these calls are disabled.

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-90875

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:102823] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2021-03-11  0:57 ` [ruby-core:102818] " nobu
@ 2021-03-11 11:06 ` naruse
  2021-03-20  4:19 ` [ruby-core:102939] " nagachika00
  2021-04-04 23:51 ` [ruby-core:103226] " usa
  5 siblings, 0 replies; 6+ messages in thread
From: naruse @ 2021-03-11 11:06 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by naruse (Yui NARUSE).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 0074ea2d83230e10ab0cd769fff203c13d3c592f merged revision(s) 2a83650b0fd25719fb6c03bfec7bd895734d3ceb.

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-90882

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:102939] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2021-03-11 11:06 ` [ruby-core:102823] " naruse
@ 2021-03-20  4:19 ` nagachika00
  2021-04-04 23:51 ` [ruby-core:103226] " usa
  5 siblings, 0 replies; 6+ messages in thread
From: nagachika00 @ 2021-03-20  4:19 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE to 2.6: REQUIRED, 2.7: DONE, 3.0: DONE

ruby_2_7 30942fc4d89a04792e9eba7d3c4e5009c54e81da merged revision(s) 2a83650b0fd25719fb6c03bfec7bd895734d3ceb.

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-91005

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: DONE, 3.0: DONE
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:103226] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
       [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2021-03-20  4:19 ` [ruby-core:102939] " nagachika00
@ 2021-04-04 23:51 ` usa
  5 siblings, 0 replies; 6+ messages in thread
From: usa @ 2021-04-04 23:51 UTC (permalink / raw)
  To: ruby-core

Issue #15852 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.6: REQUIRED, 2.7: DONE, 3.0: DONE to 2.6: DONE, 2.7: DONE, 3.0: DONE

backported into ruby_2_6 at r67930

----------------------------------------
Bug #15852: APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby
https://bugs.ruby-lang.org/issues/15852#change-91304

* Author: test35965@gmail.com (Alexander Riccio)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32]
* Backport: 2.6: DONE, 2.7: DONE, 3.0: DONE
----------------------------------------
Ruby appears to be freeing some critical section in ruby_vm_destruct before deleting the critical section. Critical Section objects must be deleted with DeleteCriticalSection (https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-deletecriticalsection) before freeing the owning memory.

I can't tell exactly what critical section is being freed - I'm new to ruby, don't know how the VM works, and haven't built it locally - so I can't help you guys there yet.

The clean stack trace is:

```
0:000> kc
 # Call Site
00 vrfcore!VerifierStopMessageEx
01 vfbasics!AVrfpFreeMemLockChecks
02 vfbasics!AVrfpFreeMemNotify
03 vfbasics!AVrfpRtlFreeHeap
04 msvcrt!free
05 vfbasics!AVrfp_free
06 x64_msvcrt_ruby260!ruby_xfree
07 x64_msvcrt_ruby260!ruby_vm_destruct
08 x64_msvcrt_ruby260!ruby_cleanup
09 x64_msvcrt_ruby260!ruby_run_node
0a image00000000_00400000
0b image00000000_00400000
0c image00000000_00400000
0d KERNEL32!BaseThreadInitThunk
0e ntdll!RtlUserThreadStart
```


I'm running `C:\Ruby26-x64\bin\ruby.exe  -x "C:\Ruby26-x64\bin\irb.cmd" `, with Application Verifier lock verification enabled. Application Verifier is the Windows SDK dynamic analysis tool, and it can be enabled by anybody who's installed the SDK. Add ruby.exe to the list of applications in Application Verifier and then run irb from inside windbg. Leak analysis should be enabled by default.

I've attached the full debug log in Windbg.

---Files--------------------------------
ruby_freeing_active_critsec.TXT (17.2 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-04 23:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15852.20190515210528.24727@ruby-lang.org>
2021-02-08 20:03 ` [ruby-core:102419] [Ruby master Bug#15852] APPLICATION_VERIFIER_LOCKS_LOCK_IN_FREED_HEAP on exiting ruby test35965
2021-02-08 20:08 ` [ruby-core:102420] " test35965
2021-03-11  0:57 ` [ruby-core:102818] " nobu
2021-03-11 11:06 ` [ruby-core:102823] " naruse
2021-03-20  4:19 ` [ruby-core:102939] " nagachika00
2021-04-04 23:51 ` [ruby-core:103226] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).