Coder Social home page Coder Social logo

Comments (27)

rrthomas avatar rrthomas commented on May 20, 2024

I see that the Ubuntu version which I am using has patches for at least one memory leak…

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

I searched for and attempted to contact François Pinard: his email address bounces and I can't find any other contact for him.

I suggest therefore that I make a friendly fork of recode, which incorporates at least the Debian patches, and perhaps any others I can easily find in other major distros.

I'm having a go at getting the current Recode 3.7beta repo code up and running (if that doesn't work, I can revert to 3.6+patches); it seems fairly straightforward.

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Yes, I did make install.

$ ./fortune
No fortunes found
$ ~/.local/games/fortune
No fortunes found

I can see all the fortunes files in ~/.local/share/games/fortunes.

I tried make clean and remaking.

I ran cmake as:

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Great, that works! Now I get two test failures (3 subtest failures):

/home/rrt/.local/var/repo/fortune-mod/fortune-mod/tests/t/trailing-space-and-CRs.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/3 subtests 
/home/rrt/.local/var/repo/fortune-mod/fortune-mod/tests/t/valgrind.t ................ 1/1 

It's odd, as the Valgrind log file has no errors I can see:

==30682== Memcheck, a memory error detector
==30682== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==30682== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==30682== Command: ./fortune
==30682== Parent PID: 30603
==30682== 
==30682== 
==30682== HEAP SUMMARY:
==30682==     in use at exit: 9,714 bytes in 164 blocks
==30682==   total heap usage: 5,280 allocs, 5,116 frees, 252,644 bytes allocated
==30682== 
==30682== LEAK SUMMARY:
==30682==    definitely lost: 0 bytes in 0 blocks
==30682==    indirectly lost: 0 bytes in 0 blocks
==30682==      possibly lost: 0 bytes in 0 blocks
==30682==    still reachable: 9,714 bytes in 164 blocks
==30682==         suppressed: 0 bytes in 0 blocks
==30682== Reachable blocks (those to which a pointer was found) are not shown.
==30682== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==30682== 
==30682== For counts of detected and suppressed errors, rerun with: -v
==30682== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

OK, I've now got recode resurrected and ready to test with fortune-mod.

What is the problem here? Is it that the memory still in use should have been freed?

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

It's OK, you don't need to educate me about basic concepts: I have two degrees in computer science and I have been working as a programmer for nearly 30 years. Thanks, though, for taking the time to add explanation in case I needed it.

The point is that having memory in use when a program exits is usually no problem (that is why I wouldn't usually regard it as an error), because, as you know, memory used by a process is returned to the system when the process exits. Hence, I would only usually worry about unreachable memory.

So I'm not quite sure you understood my question; I'd just like to check: I think in this case you want to check that the recode library has freed all the memory it allocated, and you're saying it has not; am I right?

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Just a quick (non-)update: in fact, I spent the last 24 hours battling with my attempts to fix all warnings in recode. I have completed this now. I have also found that the current code in fact already has all the Debian patches applied (including the space leak fix). I should get to testing with fortune-mod tomorrow.

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

Seems like it is https://github.com/rrthomas/Recode

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Yes, that's it. I'm currently setting up Travis and AppVeyor CI.

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

I ran the test you posted at pinard/Recode#7 and found all memory was freed.

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

I ran the valgrind tests with --leak-check=full --show-leak-kinds=all, and found that all the remaining memory in use at exit is allocated by getargs, so it seems there's no memory being retained by librecode.

It's not clear to me that this is really a problem, so perhaps you want to relax the requirement, and only look for actual leaks, not memory in use when the program ends?

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

Thanks @rrthomas ! I have now fixed these mem leaks which were fortune.c's fault. The valgrind test now passes with your Recode.

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Great, thanks! Glad you don't now have to find an alternative to recode. I am still going through the list of Debian bugs and fixing all the easy ones and those with patches. Then I shall do the same for François Pinard's GitHub (unfortunately I found out he died a few years ago), and then I shall make a release.

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

Closing this issue as FIXED. Thanks!

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

@rrthomas : I suggest you enable the Issues tracker on your fork of the recode repo - currently it is disabled. Please let me know when you mint a new release so I can release a new version of fortune-mod.

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

Done, thanks for the hint.

from fortune-mod.

rrthomas avatar rrthomas commented on May 20, 2024

By the way, in case I forget to get in touch when I make the release, it will be a normal GitHub release, so subscribing to release notifications on my project will be sufficient.

from fortune-mod.

shlomif avatar shlomif commented on May 20, 2024

from fortune-mod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.