Re: What's "#<variable-code>"?
Sage Gerard <sage-nnKKxiom5Z1/[email protected]>
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <jk8PKgoSwaioairnI9lmNa_mZtjRPQ4kEoBgarwc7J6NwKg46Ij2Adz9fNhXPzqTWEwwoY1jS2jxCcYNElmroGGR8vTijVTAKNTjJLMqLdk=@sagegerard.com> |
Alright, thanks. I have a couple of leads on what happened, but since the implementation details are private I'm unsure of the best troubleshooting technique in this context. For now I am making a minimal C project that builds a shared library and follows the same allocation pattern and FFI use. I noticed that switching "_pointer" back to a tagged pointer type makes the program raise an error, but I suspect that's due to a tag being missing from the (malloc) call. Once I learn my mistake I will share it here. ~slg -------- Original Message -------- On Oct 23, 2019, 10:58 AM, Sam Tobin-Hochstadt wrote: > `#<variable-code>` is how a representation of one of the internal AST > types for the compiler is printed. When you see it, it definitely > means some memory got corrupted. > > Sam > > On Tue, Oct 22, 2019 at 4:52 PM Sage Gerard <sage-nnKKxiom5Z1/[email protected]> wrote: >> >> Here's a Vulkan app that prints the properties of the first physical device on the system: https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L39 >> >> If you comment out the call to `vkGetPhysicalDeviceProperties`, the main module works. I create a Vulkan instance, print out a blank version of a struct, then destroy the instance. If I leave it in, I get: >> >> ; ptr-ref: contract violation >> ; expected: cpointer? >> ; given: #<variable-code> >> ; argument position: 1st >> >> I bind `vkGetPhysicalDeviceProperties` using _pointer so I can learn how to work with the raw API: >> https://github.com/zyrolasting/racket-vulkan/blob/master/unsafe.rkt#L1008 >> >> I expect I misused a pointer and ended up with corrupted memory. But what is #<variable-code>, anyway? How did I produce it? >> >> ~slg >> >> >> -- >> You received this message because you are subscribed to the Google Groups "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] >> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/kOdM__5k_2CVKSt5cmEUjb8Ci-00MtOsPUnBvetk5puetw-rGEyH95lFrYNQ-rgKdEOJQ7eo7boVEz9ua4RHPeUb1O9OdzsDdkQjwhuM9pA%3D%40sagegerard.com. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/jk8PKgoSwaioairnI9lmNa_mZtjRPQ4kEoBgarwc7J6NwKg46Ij2Adz9fNhXPzqTWEwwoY1jS2jxCcYNElmroGGR8vTijVTAKNTjJLMqLdk%3D%40sagegerard.com.