Comments (27)
I see that the Ubuntu version which I am using has patches for at least one memory leak…
from fortune-mod.
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.
from fortune-mod.
from fortune-mod.
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.
from fortune-mod.
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.
from fortune-mod.
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.
from fortune-mod.
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.
from fortune-mod.
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.
from fortune-mod.
Seems like it is https://github.com/rrthomas/Recode
from fortune-mod.
Yes, that's it. I'm currently setting up Travis and AppVeyor CI.
from fortune-mod.
I ran the test you posted at pinard/Recode#7 and found all memory was freed.
from fortune-mod.
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.
from fortune-mod.
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.
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.
from fortune-mod.
Closing this issue as FIXED. Thanks!
from fortune-mod.
@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.
Done, thanks for the hint.
from fortune-mod.
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.
from fortune-mod.
Related Issues (20)
- Duplicate cookies in "datfiles/linux" and "datfiles/linuxcookie" HOT 1
- can not cross-compile HOT 15
- Ferengi Rules of Acquisition HOT 3
- Compiling ipk for OpenWRT failed HOT 7
- Add fill usage list HOT 1
- Incorrect Verbage HOT 2
- I need help and fix for `fortune with cowthink` HOT 3
- ‘Stupid idiot users’ insults outside `off` HOT 2
- pets duplicates the same fortune twice HOT 1
- minor typo for Collis Huntington's famous quote HOT 2
- Typo in fortune HOT 2
- PPA HOT 3
- Typo in fortune HOT 1
- $XDG_DATA_DIRS and $XDG_DATA_HOME support HOT 4
- rinutils is missing in 3.16.0 release HOT 1
- Specifying percentage for "all" breaks if both FORTDIR and LOCFORTDIR have fortunes HOT 1
- backspace characters HOT 4
- the command fortune -o doesn't work HOT 3
- Installing from source doesn't seem to copy executable to install dir HOT 2
- The yaml files in .github should have a cmment that they are generated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortune-mod.