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

C Compilation Issue -- Appears Related to Quoted Items Inside Strings #23045

Open
bfisherqsi opened this issue Dec 2, 2024 · 7 comments
Open
Labels
Bug This tag is applied to issues which reports bugs. Parallel CGEN Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.

Comments

@bfisherqsi
Copy link

bfisherqsi commented Dec 2, 2024

There's a hard-to-replicate issue with V that results in bad C code being generated. Compiler version V 0.4.8 f3d0c53 on M2 MAX under MacOS X Sonoma. It seems to be related to a construct like this:

struct MyParams {
     p_fpga_ver  string  @[long: fp_ver; name: 'FPGA Version'; xdoc:'String to use as simulated FPGA version in Version responses. Must be in the form "a.bb.cccc"']
     p_cm_ver    string  @[long: cm_ver; name: 'CM Version'; xdoc:'String to use as simulated CM version in Version responses. Must be in the form "a.bb.cccc"']
}     

Note the quoted elements inside the string, "a.bb.cccc". This structure is being used by the "flag" module.

This issue comes and goes even with the code being unchanged; it's not clear why that's happening, but it happens even when I use -no-parallel. When the error DOES occur, the report points to one of the lines of code related to this structure, showing multiple double-quotes in a row, which is clearly not right. It complains about a parenthesis missing.

Unfortunately, I cannot provide the original code because it's under NDA. And when I tried to make a replication case, it went away.

The workaround is simple: either escape the quotes, or just remove them entirely. But that's just a kludge. I will continue to attempt to isolate a replication case that can be posted. So far, no luck.

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@spytheman spytheman added Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Parallel CGEN labels Dec 2, 2024
@medvednikov
Copy link
Member

Thank you for reporting this.

@felipensp
Copy link
Member

Can you try again with a fresh V version?

@bfisherqsi
Copy link
Author

I can try with a newer version when one is pushed, but that's no guarantee, because the bug cannot be reliably replicated even with the original data. My testing was done with version 0.4.8, which is already the most recent release. I updated the version just before running my tests.

@medvednikov
Copy link
Member

I'll release 0.4.9 tomorrow.

@felipensp
Copy link
Member

I can try with a newer version when one is pushed, but that's no guarantee, because the bug cannot be reliably replicated even with the original data. My testing was done with version 0.4.8, which is already the most recent release. I updated the version just before running my tests.

I meant the v up 👍🏻

@felipensp
Copy link
Member

Any news @bfisherqsi ?

@bfisherqsi
Copy link
Author

bfisherqsi commented Dec 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Parallel CGEN Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general.
Projects
None yet
Development

No branches or pull requests

4 participants