GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Christopher (shrydar@mastodon.social)'s status on Friday, 08-Nov-2024 18:00:36 JST Christopher Christopher

    going slightly mad. Old code is fine, new is borked. These buffers are never freed (just left for OS to clean up when program exits).

    anyone?

    In conversation about 6 months ago from mastodon.social permalink

    Attachments


    1. https://files.mastodon.social/media_attachments/files/113/446/405/039/360/776/original/ed6546a6957b294b.png
    • Embed this notice
      zirias (on snac) (zirias@snac.bsd.cafe)'s status on Friday, 08-Nov-2024 18:00:34 JST zirias (on snac) zirias (on snac)
      in reply to
      Borked in what way? What's the declared type of .udp_volts?
      In conversation about 6 months ago permalink
    • Embed this notice
      Christopher (shrydar@mastodon.social)'s status on Friday, 08-Nov-2024 18:36:42 JST Christopher Christopher
      in reply to
      • zirias (on snac)

      @zirias a long way down the line a map of which pointers were never initialised to point to data has a mismatch with data output by concatenating the data pointed to with runs of zeros for null pointers. Changing the params to calloc seems to fix it (cf other reply in thread), which makes no sense at all. Weekend time now I think.

      `.udp_volts` is a char***

      (a few lines earlier there's a `sub[slot].udp_volts = calloc(MAX_INPUTS + 1, sizeof(char **));` )

      In conversation about 6 months ago permalink
    • Embed this notice
      zirias (on snac) (zirias@snac.bsd.cafe)'s status on Friday, 08-Nov-2024 18:36:42 JST zirias (on snac) zirias (on snac)
      in reply to
      Ok, I can't immediately spot the issue with the parts of the code seen so far. If I had to debug this, I'd fire some tooling on it (e.g. the compiler's "address sanitizer" and similer, valgrind, ...) first.

      But then, this also looks like some code in desperate need of refactoring. "Three stars" should almost always raise an eyebrow: https://wiki.c2.com/?ThreeStarProgrammer ... and the MAX_INPUTS constant looks weird, if it's actually the maximum index, making it one less than the number of inputs 🧐

      I'd also suggest to use expressions instead of type names with the sizeof operator, making the code more robust to change, e.g. sizeof(char **) → sizeof *sub[slot].udp_volts in the above line of code, but that's a stylistic thing...
      In conversation about 6 months ago permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: wiki.c2.com
        https://wiki.c2.com/?ThreeStarProgrammer

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.