Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Ever pushed a bubble around a waterbed?

Ever pushed a bubble around a waterbed?

Scheduled Pinned Locked Moved The Lounge
designcomgraphicsiotdata-structures
18 Posts 7 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K k5054

    Yeah, it probably does. But as a starting point, you could run under valgrind, with lots of stack, to see if it detects anything it thinks is not kosher (which might be everything you're doing from it's point of view :( ) GNU libc allows you to hook various system calls : [Hooks for Malloc (The GNU C Library)](https://www.gnu.org/software/libc/manual/html\_node/Hooks-for-Malloc.html) Maybe that can help? or the Previous link on that page re heap consistency checking?

    "A little song, a little dance, a little seltzer down your pants" Chuckles the clown

    H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #7

    It looks like valgrind has a utility that hooks for you. However, it also looks like valgrind requires linux to build, so I'm doing it but it's more work than I originally hoped.

    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

    K 1 Reply Last reply
    0
    • H honey the codewitch

      It looks like valgrind has a utility that hooks for you. However, it also looks like valgrind requires linux to build, so I'm doing it but it's more work than I originally hoped.

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      K Offline
      K Offline
      k5054
      wrote on last edited by
      #8

      valgrind should be an installable package.

      "A little song, a little dance, a little seltzer down your pants" Chuckles the clown

      H 1 Reply Last reply
      0
      • K k5054

        valgrind should be an installable package.

        "A little song, a little dance, a little seltzer down your pants" Chuckles the clown

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #9

        maybe it was. I built it from the sources.

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

        1 Reply Last reply
        0
        • H honey the codewitch

          Some of my code is causing heap corruption. I don't know what code, but I suspect it's my SVG code. The issue is that it works sometimes. But if I look at it funny it starts crashing, and my stack trace keeps pointing me to different places depending on the seemingly unrelated changes I make in main(). Sometimes it points me to some font rendering code. Sometimes it points me to a seemingly innocuous assign to a local variable in my SVG parser code. It's maddening. It doesn't reproduce on the PC, at least 64-bit. I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM? I tried running Deleaker against it, not sure if it would pick up heap corruption - it either doesn't, or it isn't coming up on the PC. Unfortunately, much of this code is derived in many places from work that wasn't mine to begin with, and so instrumenting it to detect heap corruption if I have to wrap all malloc/reallocs etc will cause me real pain. I don't know what to do. Maybe this would rear its head if I had kilobytes instead of gigabytes of RAM? but i wouldn't even know how to set that up on a PC without altering my code to use a custom constrained heap. I'm so frustrated I've put it down, but it's gnawing at me, because it's definitely blocking any attempt I make at releasing. I wish these little IoT devices had good memory protection. It just now occurred to me to try this on an ARM and hope i can reproduce it. Maybe I'll get a better stack trace. Who knows? :confused:

          Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #10

          honey the codewitch wrote:

          I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM?

          Not if you're using older versions of Visual Studio. We have a couple products still maintained using Visual Studio 2008 that build for 32 bit.

          Software Zen: delete this;

          R H 2 Replies Last reply
          0
          • G Gary R Wheeler

            honey the codewitch wrote:

            I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM?

            Not if you're using older versions of Visual Studio. We have a couple products still maintained using Visual Studio 2008 that build for 32 bit.

            Software Zen: delete this;

            R Offline
            R Offline
            RickZeeland
            wrote on last edited by
            #11

            We build a part of our application called "DriverHost" as 32-bits in VS2022 and .NET 8.

            1 Reply Last reply
            0
            • H honey the codewitch

              Some of my code is causing heap corruption. I don't know what code, but I suspect it's my SVG code. The issue is that it works sometimes. But if I look at it funny it starts crashing, and my stack trace keeps pointing me to different places depending on the seemingly unrelated changes I make in main(). Sometimes it points me to some font rendering code. Sometimes it points me to a seemingly innocuous assign to a local variable in my SVG parser code. It's maddening. It doesn't reproduce on the PC, at least 64-bit. I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM? I tried running Deleaker against it, not sure if it would pick up heap corruption - it either doesn't, or it isn't coming up on the PC. Unfortunately, much of this code is derived in many places from work that wasn't mine to begin with, and so instrumenting it to detect heap corruption if I have to wrap all malloc/reallocs etc will cause me real pain. I don't know what to do. Maybe this would rear its head if I had kilobytes instead of gigabytes of RAM? but i wouldn't even know how to set that up on a PC without altering my code to use a custom constrained heap. I'm so frustrated I've put it down, but it's gnawing at me, because it's definitely blocking any attempt I make at releasing. I wish these little IoT devices had good memory protection. It just now occurred to me to try this on an ARM and hope i can reproduce it. Maybe I'll get a better stack trace. Who knows? :confused:

              Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

              S Offline
              S Offline
              Shao Voon Wong
              wrote on last edited by
              #12

              You can enable Address Sanitizer on Visual Studio to find memory issues such as corruptions or overruns.

              1 Reply Last reply
              0
              • G Gary R Wheeler

                honey the codewitch wrote:

                I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM?

                Not if you're using older versions of Visual Studio. We have a couple products still maintained using Visual Studio 2008 that build for 32 bit.

                Software Zen: delete this;

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #13

                That won't work. Whatever the MSVC was able to compile back then, it wasn't C++. It was "C++-ish"

                Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                G 1 Reply Last reply
                0
                • H honey the codewitch

                  That won't work. Whatever the MSVC was able to compile back then, it wasn't C++. It was "C++-ish"

                  Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                  G Offline
                  G Offline
                  Gary R Wheeler
                  wrote on last edited by
                  #14

                  It served our purposes at the time; after all it made Mr. Object (one of my coworkers) happy :-D. The fact that we're still using VS2008 to maintain these products is a reflection on how engineering management here is hardware-centric and it makes them lose their sphincter control when we mention changing tools.

                  Software Zen: delete this;

                  H 1 Reply Last reply
                  0
                  • G Gary R Wheeler

                    It served our purposes at the time; after all it made Mr. Object (one of my coworkers) happy :-D. The fact that we're still using VS2008 to maintain these products is a reflection on how engineering management here is hardware-centric and it makes them lose their sphincter control when we mention changing tools.

                    Software Zen: delete this;

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #15

                    I'm sure wored/works for you. My code won't compile with anything less than GCC within the last 7 years or so, or VS2022. It took microsoft that long to get their crap together. Is it really that hard to make stdint.h? And fix their template syntax madness?

                    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                    A 1 Reply Last reply
                    0
                    • H honey the codewitch

                      Some of my code is causing heap corruption. I don't know what code, but I suspect it's my SVG code. The issue is that it works sometimes. But if I look at it funny it starts crashing, and my stack trace keeps pointing me to different places depending on the seemingly unrelated changes I make in main(). Sometimes it points me to some font rendering code. Sometimes it points me to a seemingly innocuous assign to a local variable in my SVG parser code. It's maddening. It doesn't reproduce on the PC, at least 64-bit. I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM? I tried running Deleaker against it, not sure if it would pick up heap corruption - it either doesn't, or it isn't coming up on the PC. Unfortunately, much of this code is derived in many places from work that wasn't mine to begin with, and so instrumenting it to detect heap corruption if I have to wrap all malloc/reallocs etc will cause me real pain. I don't know what to do. Maybe this would rear its head if I had kilobytes instead of gigabytes of RAM? but i wouldn't even know how to set that up on a PC without altering my code to use a custom constrained heap. I'm so frustrated I've put it down, but it's gnawing at me, because it's definitely blocking any attempt I make at releasing. I wish these little IoT devices had good memory protection. It just now occurred to me to try this on an ARM and hope i can reproduce it. Maybe I'll get a better stack trace. Who knows? :confused:

                      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                      D Offline
                      D Offline
                      Daniel Pfeffer
                      wrote on last edited by
                      #16

                      honey the codewitch wrote:

                      It doesn't reproduce on the PC, at least 64-bit. I haven't tried 32 because trying to get 32-bit executables built on a windows machine these days I think requires a VM?

                      VS 2022 allows building for ARM, ARM64, x86, and x64. I don't remember if all compilers are installed by default, but they definitely may be installed from the installer. Your confusion may arise because VS 2022, unlike the earlier editions, is a 64-bit application.

                      Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                      1 Reply Last reply
                      0
                      • H honey the codewitch

                        I'm sure wored/works for you. My code won't compile with anything less than GCC within the last 7 years or so, or VS2022. It took microsoft that long to get their crap together. Is it really that hard to make stdint.h? And fix their template syntax madness?

                        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                        A Offline
                        A Offline
                        Alister Morton
                        wrote on last edited by
                        #17

                        We build 32 bit executables and dlls in VS2022 from C++ source. We still have to support 32 bit applications.

                        H 1 Reply Last reply
                        0
                        • A Alister Morton

                          We build 32 bit executables and dlls in VS2022 from C++ source. We still have to support 32 bit applications.

                          H Offline
                          H Offline
                          honey the codewitch
                          wrote on last edited by
                          #18

                          Yeah, for some reason when I was looking through installed targeting packs I didn't see x86 for some reason. It's there. I just missed it the first time.

                          Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups