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

initialize libdash only on first call #701

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

AnirudhNarsipur
Copy link
Contributor

libdash.parser.parse takes in an init argument that indicates whether libdash should be initialized. This should be set to False after the first call. Not initializing libdash properly will call the following program to hang:

import libdash.parser


a = libdash.parser.parse("bad0.sh")
b = list(a)
c = libdash.parser.parse("bad0.sh")
d = list(c)

where bad0.sh is simply:

cat /a.txt

While I believe PaSH only calls libdash once it's better to be defensive.

Copy link

OS:ubuntu-20.04
Tue Nov 21 05:07:15 UTC 2023
intro: 2/2 tests passed.
interface: 41/41 tests passed.
compiler: 54/54 tests passed.

Copy link

OS:ubuntu-20.04
Tue Nov 21 05:08:37 UTC 2023
intro: 2/2 tests passed.
interface: 41/41 tests passed.
compiler: 54/54 tests passed.

Copy link

OS = Debian 10
CPU = Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Ram = 15752
Hash = 3237ef4
Kernel= Linux 4.15.0-197-generic x86_64

benchmark tests passed failed untested unresolved unsupported not_in_use other_status
posix 494 375 41 31 6 40 1 0
intro 2 2 0 0 0 0 0 0
interface 41 41 0 0 0 0 0 0
compiler 54 54 0 0 0 0 0 0

Copy link

OS = Debian 10
CPU = Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Ram = 15752
Hash = 9cf4d00
Kernel= Linux 4.15.0-197-generic x86_64

benchmark tests passed failed untested unresolved unsupported not_in_use other_status
posix 494 375 41 31 6 40 1 0
intro 2 2 0 0 0 0 0 0
interface 41 41 0 0 0 0 0 0
compiler 54 54 0 0 0 0 0 0

Copy link
Member

@angelhof angelhof left a comment

Choose a reason for hiding this comment

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

Looks good to me! If I recall correctly we had discussed this in some meeting some time ago right? Feel free to merge from my side!

@angelhof angelhof merged commit c875873 into future Nov 21, 2023
6 checks passed
@angelhof angelhof deleted the libdash_parser_init_fix branch November 21, 2023 14:38
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.

2 participants