Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid a crash on Linux #2

Closed
wants to merge 1 commit into from
Closed

Conversation

mnogu
Copy link

@mnogu mnogu commented Dec 2, 2023

When we run this program on Linux, it aborts with the following error:

$ ./mis datasets/100/graph_100_1000.txt
58
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 15) >= this->size() (which is 12)
Aborted (core dumped)

This pull request resolves this issue by adding missing return statements.

@iPapatsoris
Copy link
Owner

Hello, thanks for the contribution! I will look into it soon.

@iPapatsoris
Copy link
Owner

iPapatsoris commented Dec 20, 2023

I am not able to reproduce this error, I am on Ubuntu 18, g++ version 7.5.0. I have looked into the pull request, these functions are indeed missing return statements, but the return value is ignored in all the places where they are called. They return a boolean, but it's not used anywhere, they just alter objects through references. Which means that this is not the real solution, maybe there is undefined behavior somewhere else, and by making this change, we happen to "get lucky"? But again, I am not able to reproduce.

@mnogu
Copy link
Author

mnogu commented Dec 21, 2023

I succeeded in reproducing this crash with GitHub Action. This crash may only occur on newer operating systems.

https://github.com/mnogu/Maximum-Independent-Set/actions/runs/7287156697/job/19857240420

Operating System
  Ubuntu
  22.04.3
  LTS
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 36) >= this->size() (which is 12)
/home/runner/work/_temp/167df828-aa35-4ad4-9dac-a7d4903ea3c4.sh: line 2:  1737 Aborted                 (core dumped) ./mis datasets/100/graph_100_1000.txt
Error: Process completed with exit code 134.

https://github.com/mnogu/Maximum-Independent-Set/blob/53bc9a5e767bd8f22426f4bacecd58f7e11b71ab/.github/workflows/run.yml

on: push
jobs:
  run_test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |   
          make
          ./mis datasets/100/graph_100_1000.txt

@mnogu
Copy link
Author

mnogu commented Dec 22, 2023

./mis crashed on Ubuntu 20.04, too.

https://github.com/mnogu/Maximum-Independent-Set/actions/runs/7299107600/job/19891326187

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 14) >= this->size() (which is 9)
/home/runner/work/_temp/1b5071a4-b776-4adf-9f9f-5b4d2d94274f.sh: line 2:  1932 Aborted                 (core dumped) ./mis datasets/100/graph_100_1000.txt

@iPapatsoris
Copy link
Owner

Hello, thank you for the reproduction through GitHub Actions. By looking through the research papers the program is based on, and the code itself, I noticed significant deviations. Unfortunately, it would take a long time to properly study, implement and fix everything, as the changes needed are extensive. For the foreseeable future, I will have to archive the repository and add a note that there are breaking bugs. Thank you for the interest.

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.

None yet

2 participants