esilver-uvm / Left-Group-VERSO

Repository for the Left Group (from the back) of the Advanced Programming VERSO activity.
MIT License
0 stars 8 forks source link

Memory Leak in remove_duplicates.cc #27

Closed esilver-uvm closed 1 day ago

esilver-uvm commented 1 day ago

A float pointer on line 22 of remove_duplicates.cc causes a needless memory leak.

Steps to Reproduce

  1. Compile and run the executable.
  2. A memory leak occurs, 120020123 bytes are allocated and never released.

Expected Behavior We expect the program to remove duplicates from a vector.

Actual Behavior Instead, 120020123 bytes are allocated, grinding my device to a halt.

Additional Information My OS is macOS Sonoma 14.6.1 My Browser is Firefox 132.0.1 The Version is unversioned.

Possible Solution Remove the memory allocation. Nothing is even put in the float pointer. Floats cannot even conceivably be that big. Wikipedia isn't that big. My collection of movies isn't that big. It is a void and it is needless.

Related Issues Some wiseguy did the exact same thing in datetime_convert.cc

Priority High. It makes the program unusable.

Reproducibility It's guaranteed to happen every time the function is called due to unsafe pointers so long as compilation occurs without optimization.

Impact It renders the program unusable.

JayYarlott commented 1 day ago

Have you tried purchasing more RAM, or perhaps visiting https://downloadmoreram.com ?

esilver-uvm commented 1 day ago

BLOWING UP MY DANG EMAILS

On Nov 12, 2024, at 14:16, JayYarlott @.***> wrote:



Have you tried purchasing more RAM, or perhaps visiting https://downloadmoreram.com ?

— Reply to this email directly, view it on GitHubhttps://github.com/esilver-uvm/Left-Group-VERSO/issues/27#issuecomment-2471357895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A227EHRNNZC4ZG54NCUUXUD2AJHQXAVCNFSM6AAAAABRUYSELOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGM2TOOBZGU. You are receiving this because you authored the thread.Message ID: @.***>

Bmcaleer1 commented 1 day ago

fixed float* thing = malloc(120020123); Now memory allocation is working