Provide public sdb_ref sdb_unref
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by tracing Sdb reference ownership and the RBinFile->sdb field, especially the cleanup path in r_bin_file_free. Define how public sdb_ref and sdb_unref should be used for shared Sdb values, then verify that the ownership behavior no longer permits the described leaks.
Written by the indexing model from the issue text.
Description
I think we should introduce new APIs to increment/decrement the ref value of a Sdb. This can be very useful in radare2 where sdb are passed around and sometimes it's not clear which component will be the first to release a given Sdb.
This seems the case with RBinFile, which has a ->sdb field which is not freed in r_bin_file_free because it is already freed by someone else. This leads to memory leaks in some cases and in general I think it is not good practice to have some fields of a data structure owned by something else.
- Dominant language
- C
- Stars
- 235
- Forks
- 69
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from radareorg/sdb
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
-
SDB Logo?Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Kill SdbHt or HtOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
bug game: 0400486024DEC000 mac nvn shader chain
Difficulty 1/5 Under an hour Newbie friendliness 78/100
seedds/nxnative#3675 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
makecpt and grd2cpt overwrite explicit +c category labels with +k keysPossibly taken @yousizaitianqiong claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GenericMappingTools/gmt#9377 ·
Maintainers usually reply within 1 day