Skip to content

Conversation

@bangarumahesh22
Copy link

This PR adds examples/leak_example2.c, a small intentional memory-leak example for Dr. Memory demos and testing.

  • File: examples/leak_example2.c
  • Purpose: simple program that allocates memory and does not free it (used to demonstrate leak detection).
  • Verified locally: ran with Dr. Memory (../build/bin/drmemory -- ../examples/leak_example2) and confirmed a reported leak.

Please let me know if you'd like the example to be modified (e.g., add comments or a README entry).

@@ -0,0 +1,14 @@
#include <stdlib.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in #2567, I am a little confused: so you are proposing creating a new directory examples/? Will these be used in automated tests? What is the bigger picture here: could you file a feature issue in the tracker and describe the goal and link this PR to that new issue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @derekbruening for your patience and feedback.

I've just responded to your similar question in #2567, and the same applies here:

This PR is creating new example files (examples/leak_example2.c and examples/test_hacktober.c), not editing existing files. I should have made this clearer in my PR descriptions.

Regarding your questions about the bigger picture:

You're absolutely right to ask. I realize now that I:

  • Created these PRs during Hacktoberfest without proper discussion
  • Don't have a clear plan for how these integrate with the project
  • Should have filed a feature issue first before implementing

What I propose:

  1. I can close these PRs (Fix memory leak in test example #2567, Add second memory leak #2568, Add signal_buffer_leak example for memory leak detection #2569) since they were submitted without proper planning
  2. If the project would benefit from example files, I'm happy to file a proper feature request describing:
    • The purpose and use cases
    • How they'd integrate with documentation/tests
    • What examples would be most valuable
  3. Wait for maintainer feedback before implementing anything

I apologize for the confusion and for not following proper contribution procedures. Would you prefer I close these PRs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants