Hi, I was developing a dynamic module when I noticed that when '--module-assertions' are enabled I got strange complaints regarding value to be freed. Namely, Emacs was producing an error message like the following one: Emacs module assertion: Global value was not found in list of 10 globals I tracked it down to a bug in module_free_global_ref. It's traversal of the linked list of all allocated global values was flawed and only considered the head of the list. Please find attached my attempt at fixing it and a test in Emacs test suite that reproduces the issue. Regards, Sergey