[GH-ISSUE #64] double free or corruption (out) #26

Closed
opened 2026-03-07 19:14:10 +03:00 by kerem · 6 comments
Owner

Originally created by @jk7gr on GitHub (Apr 24, 2023).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/64

Dear @007revad ,
I wanted to test your script on my DS918+ NAS running DSM 7.1.1-42962 Update 5.

Unfortunately, it doesn't like it. I am getting a "double free or corruption (out)" message and I don't know what it is.
I have exactly the same error message with your other script "syno_create_m2_volume.sh" as well.

example below:
$ sudo -i /volume1/docker/syno_hdd_db.sh -h
Password:
double free or corruption (out)
Aborted

Originally created by @jk7gr on GitHub (Apr 24, 2023). Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/64 Dear @007revad , I wanted to test your script on my DS918+ NAS running DSM 7.1.1-42962 Update 5. Unfortunately, it doesn't like it. I am getting a "double free or corruption (out)" message and I don't know what it is. I have exactly the same error message with your other script "syno_create_m2_volume.sh" as well. example below: $ sudo -i /volume1/docker/syno_hdd_db.sh -h Password: double free or corruption (out) Aborted
kerem closed this issue 2026-03-07 19:14:10 +03:00
Author
Owner

@007revad commented on GitHub (Apr 24, 2023):

That is weird. The "double free or corruption (out)" error is normally seen in C or C++ programs. It seems to be due to the shell trying to read the same memory twice or trying to read or write to memory that's not accessible to the user.

Are you using SSH in a Windows terminal, command prompt or powershell?

See if you get the same error with just the following command: sudo -i

If sudo -i does not give the same error, then try running the following command to make sure the permissions are set to executable on the syno_hdd_db.sh file.
chmod u+x /volume1/docker/syno_hdd_db.sh

If sudo -i does give the same error, then there may be something strange with your user's environment variables. In which case try sudo without the -i: sudo /volume1/docker/syno_hdd_db.sh -h

<!-- gh-comment-id:1519658994 --> @007revad commented on GitHub (Apr 24, 2023): That is weird. The "double free or corruption (out)" error is normally seen in C or C++ programs. It seems to be due to the shell trying to read the same memory twice or trying to read or write to memory that's not accessible to the user. Are you using SSH in a Windows terminal, command prompt or powershell? See if you get the same error with just the following command: `sudo -i` If `sudo -i` does **not** give the same error, then try running the following command to make sure the permissions are set to executable on the syno_hdd_db.sh file. `chmod u+x /volume1/docker/syno_hdd_db.sh` If `sudo -i` **does** give the same error, then there may be something strange with your user's environment variables. In which case try sudo without the -i: `sudo /volume1/docker/syno_hdd_db.sh -h`
Author
Owner

@jk7gr commented on GitHub (Apr 24, 2023):

I appreciate the immediate response.
No joy,
I am using Putty on a Win11 machine.
I am pasting the output of the terminal:

image

<!-- gh-comment-id:1519890763 --> @jk7gr commented on GitHub (Apr 24, 2023): I appreciate the immediate response. No joy, I am using Putty on a Win11 machine. I am pasting the output of the terminal: ![image](https://user-images.githubusercontent.com/17036347/233995886-cf8db56d-ce28-4b65-8500-857660db7d2e.png)
Author
Owner

@007revad commented on GitHub (Apr 25, 2023):

That error message
double free or corruption (out)
Aborted (core dumped)
means that the something tried to twice to free the same block of memory, or that something in memory was overwritten that shouldn't have been. But the script hasn't even started when that error ocurred.

Are you able to run other scripts? Any script?

Even one that just contains:

#!/usr/bin/env bash
echo "Hello world"

What does the following command return:
free -m

<!-- gh-comment-id:1521586972 --> @007revad commented on GitHub (Apr 25, 2023): That error message double free or corruption (out) Aborted (core dumped) means that the something tried to twice to free the same block of memory, or that something in memory was overwritten that shouldn't have been. But the script hasn't even started when that error ocurred. Are you able to run other scripts? Any script? Even one that just contains: ``` #!/usr/bin/env bash echo "Hello world" ``` What does the following command return: `free -m`
Author
Owner

@jk7gr commented on GitHub (Apr 25, 2023):

You are right... I cannot run any script...
Very strange. I used to be able to, but it seems not anymore. Any idea what should be looking at?
the extract of free -m is below. I don't know if is good or bad
image

<!-- gh-comment-id:1521850661 --> @jk7gr commented on GitHub (Apr 25, 2023): You are right... I cannot run any script... Very strange. I used to be able to, but it seems not anymore. Any idea what should be looking at? the extract of free -m is below. I don't know if is good or bad ![image](https://user-images.githubusercontent.com/17036347/234301995-612e715c-f73a-4beb-9595-9eb1647fea73.png)
Author
Owner

@jk7gr commented on GitHub (Apr 25, 2023):

You are right... I cannot run any script... Very strange. I used to be able to, but it seems not anymore. Any idea what should be looking at? the extract of free -m is below. I don't know if is good or bad image

I managed to understand and troubleshoot.
I simply changed the first line of your script

from:
#!/usr/bin/env bash

to:
#!/bin/bash

After that it worked. I don't know what this really means. :)

<!-- gh-comment-id:1521866027 --> @jk7gr commented on GitHub (Apr 25, 2023): > You are right... I cannot run any script... Very strange. I used to be able to, but it seems not anymore. Any idea what should be looking at? the extract of free -m is below. I don't know if is good or bad ![image](https://user-images.githubusercontent.com/17036347/234301995-612e715c-f73a-4beb-9595-9eb1647fea73.png) I managed to understand and troubleshoot. I simply changed the first line of your script from: #!/usr/bin/env bash to: #!/bin/bash After that it worked. I don't know what this really means. :)
Author
Owner

@007revad commented on GitHub (Apr 25, 2023):

That means your environment variables are messed up (at least for your user account). Maybe when you update to DSM 7.2 it will fix them - or maybe not :)

If you're curious, what do these 2 commands return:
echo $PATH

env

<!-- gh-comment-id:1522553458 --> @007revad commented on GitHub (Apr 25, 2023): That means your environment variables are messed up (at least for your user account). Maybe when you update to DSM 7.2 it will fix them - or maybe not :) If you're curious, what do these 2 commands return: `echo $PATH` `env`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_HDD_db#26
No description provided.