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. Okay. I'm done today

Okay. I'm done today

Scheduled Pinned Locked Moved The Lounge
designhardwarehelpc++css
7 Posts 6 Posters 0 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.
  • honey the codewitchH Offline
    honey the codewitchH Offline
    honey the codewitch
    wrote on last edited by
    #1

    I got a stack overflow in my SVG code. It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines. Furthermore, reverting the changes didn't fix it. There's something else going on. Well, on little embedded devices there's not a whole lot of memory protection. When you stack overflow it clobbers the stack so you can't get even a partial stack trace. Okay. My code is cross platform. I'll fire it up on my PC under MSVC++ Compile errors. Turns out what I thought was a harmless feature add makes MSVC++'s compiler just scream. 100 errors for less than 10 lines of code. I removed the feature. It's a shame too, as it was a real convenience. Got it building. Put together my test code - basically just de-arduino-ing it and then making it spit the graphics as ascii art to the console. No big deal. Run it. No crash. No stack overflow. Which tells me the problem is the one I didn't want to try and solve. Now I need to figure out what's taking all the stack, rather than what is recursing indefinitely. I did move 2KB off the stack but it's still dying on me. This code is non-trivial. It's the SVG parsing code, and took me forever to create it. I tried to keep it light on the stack but apparently it's not light enough. Pruning for stack space in a veritable labyrinth of function calls is not my idea of fun. I have a dentist appointment later today which seems appealing by comparison. :rolleyes:

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

    M A J 3 Replies Last reply
    0
    • honey the codewitchH honey the codewitch

      I got a stack overflow in my SVG code. It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines. Furthermore, reverting the changes didn't fix it. There's something else going on. Well, on little embedded devices there's not a whole lot of memory protection. When you stack overflow it clobbers the stack so you can't get even a partial stack trace. Okay. My code is cross platform. I'll fire it up on my PC under MSVC++ Compile errors. Turns out what I thought was a harmless feature add makes MSVC++'s compiler just scream. 100 errors for less than 10 lines of code. I removed the feature. It's a shame too, as it was a real convenience. Got it building. Put together my test code - basically just de-arduino-ing it and then making it spit the graphics as ascii art to the console. No big deal. Run it. No crash. No stack overflow. Which tells me the problem is the one I didn't want to try and solve. Now I need to figure out what's taking all the stack, rather than what is recursing indefinitely. I did move 2KB off the stack but it's still dying on me. This code is non-trivial. It's the SVG parsing code, and took me forever to create it. I tried to keep it light on the stack but apparently it's not light enough. Pruning for stack space in a veritable labyrinth of function calls is not my idea of fun. I have a dentist appointment later today which seems appealing by comparison. :rolleyes:

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

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      honey the codewitch wrote:

      . It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines.

      lol. Famous last words...

      CI/CD = Continuous Impediment/Continuous Despair

      honey the codewitchH 1 Reply Last reply
      0
      • M Maximilien

        honey the codewitch wrote:

        . It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines.

        lol. Famous last words...

        CI/CD = Continuous Impediment/Continuous Despair

        honey the codewitchH Offline
        honey the codewitchH Offline
        honey the codewitch
        wrote on last edited by
        #3

        Like I said, I reverted the changes and the problem still occurs. I know better than not to verify that.

        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
        • honey the codewitchH honey the codewitch

          I got a stack overflow in my SVG code. It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines. Furthermore, reverting the changes didn't fix it. There's something else going on. Well, on little embedded devices there's not a whole lot of memory protection. When you stack overflow it clobbers the stack so you can't get even a partial stack trace. Okay. My code is cross platform. I'll fire it up on my PC under MSVC++ Compile errors. Turns out what I thought was a harmless feature add makes MSVC++'s compiler just scream. 100 errors for less than 10 lines of code. I removed the feature. It's a shame too, as it was a real convenience. Got it building. Put together my test code - basically just de-arduino-ing it and then making it spit the graphics as ascii art to the console. No big deal. Run it. No crash. No stack overflow. Which tells me the problem is the one I didn't want to try and solve. Now I need to figure out what's taking all the stack, rather than what is recursing indefinitely. I did move 2KB off the stack but it's still dying on me. This code is non-trivial. It's the SVG parsing code, and took me forever to create it. I tried to keep it light on the stack but apparently it's not light enough. Pruning for stack space in a veritable labyrinth of function calls is not my idea of fun. I have a dentist appointment later today which seems appealing by comparison. :rolleyes:

          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
          #4

          I sympathise. Many years ago I worked on a desktop financial calculator which had 32K of EPROM for all the code and 16K of battery backed RAM for everything else, all the persistent storage and workspace, display buffer, the lot, and the number of times we had late nights reworking the code to save a few bytes here and there so it would fit in the EPROM, or shaving the stack usage so our variables survived ... a very character building time.

          1 Reply Last reply
          0
          • honey the codewitchH honey the codewitch

            I got a stack overflow in my SVG code. It never used to do that before, and I barely changed anything. I just removed a few divisions in some relatively innocuous routines. Furthermore, reverting the changes didn't fix it. There's something else going on. Well, on little embedded devices there's not a whole lot of memory protection. When you stack overflow it clobbers the stack so you can't get even a partial stack trace. Okay. My code is cross platform. I'll fire it up on my PC under MSVC++ Compile errors. Turns out what I thought was a harmless feature add makes MSVC++'s compiler just scream. 100 errors for less than 10 lines of code. I removed the feature. It's a shame too, as it was a real convenience. Got it building. Put together my test code - basically just de-arduino-ing it and then making it spit the graphics as ascii art to the console. No big deal. Run it. No crash. No stack overflow. Which tells me the problem is the one I didn't want to try and solve. Now I need to figure out what's taking all the stack, rather than what is recursing indefinitely. I did move 2KB off the stack but it's still dying on me. This code is non-trivial. It's the SVG parsing code, and took me forever to create it. I tried to keep it light on the stack but apparently it's not light enough. Pruning for stack space in a veritable labyrinth of function calls is not my idea of fun. I have a dentist appointment later today which seems appealing by comparison. :rolleyes:

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

            J Offline
            J Offline
            jochance
            wrote on last edited by
            #5

            Rust. (I'm sorry I felt this had to be done)

            R C 2 Replies Last reply
            0
            • J jochance

              Rust. (I'm sorry I felt this had to be done)

              R Offline
              R Offline
              Rage
              wrote on last edited by
              #6

              I do not know anything about rust, but does rust have infinite stack ?

              Do not escape reality : improve reality !

              1 Reply Last reply
              0
              • J jochance

                Rust. (I'm sorry I felt this had to be done)

                C Offline
                C Offline
                charlieg
                wrote on last edited by
                #7

                Please explain why RUST would have solved this problem. Honest and curious question. stack issues are common in embedded systems, no matter what development language you choose.

                Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

                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