[
https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437455#comment-13437455
]
Marvin Humphrey commented on LUCY-245:
--------------------------------------
> I guess that all this has nothing to do with 64-bit integers.
That seems plausible.
> I have seen spurious errors with repeated and fast creation and deletion of
> files with the same name on Windows before. I remember fixing a very similar
> problem by switching to random file names.
We can do that. :)
There aren't that many places in Charmonizer that would need to be modified.
Here's what I think would be the key code fragment:
{noformat}
int
OS_capture_stdout(const char *command, char **target) {
int retval = 1;
char *temp_name = OS_temp_file_name();
char pattern[] = "%s%s 1> %s 2> %s";
size_t size = sizeof(pattern)
+ strlen(local_command_start)
+ strlen(command)
+ strlen(temp_name)
+ strlen(dev_null)
+ 10;
char *full_command = (char*)malloc(size);
sprintf(full_command, pattern, command, temp_name, dev_null);
retval = system(full_command);
*target = Util_slurp_file(temp_name);
OS_remove(temp_name);
free(full_command);
free(temp_name);
return retval;
}
{noformat}
Capturing using the shell to a random-named temp file rather than redirecting
stdout within our probe apps also allows us to ditch `_charm.h` and the
`Charm_Setup` macro.
In the meantime, I prefer the approach in your patch (rename to random temp
then delete) over the approach in my patch (still not deleted? try again!).
The only thing I'd suggest is that we enable the code on all systems so that
it is always exercised. +1 to commit (with or without that minor change).
> Charmonizer fails to detect syntax for 64-bit integer literals
> --------------------------------------------------------------
>
> Key: LUCY-245
> URL: https://issues.apache.org/jira/browse/LUCY-245
> Project: Lucy
> Issue Type: Bug
> Components: Charmonizer
> Affects Versions: 0.3.0 (incubating), 0.3.2
> Reporter: Marvin Humphrey
> Priority: Minor
> Attachments: 0001-LUCY-245-Simplify-i64-literal-detection.patch,
> 0101-LUCY-245-Safe-Charmonizer-file-removal-on-Windows.patch
>
>
> On some Windows systems running Strawberry Perl and GCC 4.4.3,
> Charmonizer fails to find the syntax for 64-bit integer literals.
> [http://cpantesters.org/cpan/report/69b25746-6cfa-1014-850b-e0170163837e]
> [http://cpantesters.org/cpan/report/d4d48c84-6cef-1014-bdbd-2502895448ee]
> [http://cpantesters.org/cpan/report/ffcaade6-6cc9-1014-8d81-4edd8ede4cb4]
> In addition, we have received one failure report where Charmonizer could
> not detect any 64-bit integer type at all with GCC
> "3.4.5 (mingw-vista special r3)".
> [http://cpantesters.org/cpan/report/3006586a-6ed6-1014-9e5f-68193373d4b5]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira