Nick Vatamaniuc

Results 338 comments of Nick Vatamaniuc

I tried it and the issue happened (memory blew up to 43GB) but the assert didn't trigger. Wonder if there are more places to insert the check?

I ran the optimized version of the VM.

Thanks, Sverker. I had started on the same path here https://github.com/erlang/otp/compare/master...nickva:otp:sverker/check-circular-offheap/25.3.2.8 I noticed it would be nice to have line numbers, so I altered the assert macro a bit. And...

I added a few more checks: And now it fails at `erl_process.c:13358`: https://github.com/nickva/otp/blob/71237615b62ef876a82cbbe8757884efb8fd8ac2/erts/emulator/beam/erl_process.c#L13358 After `watcher = copy_struct(watcher, watcher_sz, &hp, factory.off_heap);` ``` 2024-02-02_19:56:43.27406 beam/erl_process.c:13358:erts_proc_exit_handle_dist_monitor() Assertion failed: erts_check_circular_offheap(c_p) ```

Trying to dig a bit deeper I added a sleep call to attach the debugger right after when the condition happens: https://github.com/nickva/otp/commit/f9000c020978d99eb50cd99e55acecaac780fbff ```c watcher = copy_struct(watcher, watcher_sz, &hp, factory.off_heap); if(!erts_check_circular_offheap(c_p))...

Thank you, @sverker I gave it a try in a new commit https://github.com/nickva/otp/commit/c8982760cee69a466c6c85f4ef225dc447f8b95f But I noticed an assert trigger in `beam_jit_call_nif` as soon as it started right away. So added...

Oops, sorry. That makes sense. I'll fix the check and retest

Thank you for explaining @sverker I updated the commit https://github.com/nickva/otp/commit/e0cd2e7953dcb06a8c0f6707c98bd3aae8487b63 Now the assert fails in [erts_continue_exit_process](https://github.com/nickva/otp/blob/e0cd2e7953dcb06a8c0f6707c98bd3aae8487b63/erts/emulator/beam/erl_process.c#L14051) ``` #2 0x000056273d27c164 in erl_assert_error (expr=expr@entry=0x56273d335030 "(erts_check_circular_offheap(p)==0)", func=func@entry=0x56273d335f70 "erts_continue_exit_process", file=file@entry=0x56273d3353f5 "beam/erl_process.c", line=line@entry=14051) at sys/unix/sys.c:955...

I managed to get [rr-project](https://rr-project.org/) debugger working and captured a few traces with assertions but haven't yet figure out how navigate properly. ``` $ rr replay GNU gdb (Debian 10.1-1.7)...

Thank you @sverker. The `-l` option did the trick. I got a bit further, I see the watchpoint trigger but the backtrace looks unreadable: ``` (rr) display p->off_heap.first 1: p->off_heap.first...