You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucy.apache.org by "Marvin Humphrey (JIRA)" <ji...@apache.org> on 2012/08/18 02:40:37 UTC

[lucy-issues] [jira] [Created] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Marvin Humphrey created LUCY-245:
------------------------------------

             Summary: 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.2, 0.3.0 (incubating)
            Reporter: Marvin Humphrey
            Priority: Minor


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

        

[lucy-issues] [jira] [Commented] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437195#comment-13437195 ] 

Marvin Humphrey commented on LUCY-245:
--------------------------------------

All the Strawberry Perl tests come from a single tester, David Solimano.  The
last test is from Christian Walde.

Perhaps we can track them down and persuade one or both to run the following
commands:

{noformat}
perl Build.PL
CHARM_VERBOSITY=2 ./Build charmony
{noformat}

                
> 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
>
> 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

        

[lucy-issues] [jira] [Commented] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
    [ 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

        

[lucy-issues] [jira] [Updated] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey updated LUCY-245:
---------------------------------

    Attachment: 0001-LUCY-245-Simplify-i64-literal-detection.patch

Here is a patch which simplifies the probe for 64-bit integer literal syntax.

I don't know that it will help.  I can't see anything wrong with the existing
probe.  It seems unlikely that GCC 4.4.3 wouldn't accept either "L" or "LL" as
an acceptable suffix, depending on whether the 64-bit type was "long" or "long
long".  Maybe the cast in the existing code was dicey??

                
> 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
>
>
> 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

        

[lucy-issues] [jira] [Commented] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Nick Wellnhofer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437341#comment-13437341 ] 

Nick Wellnhofer commented on LUCY-245:
--------------------------------------

Here is a discussion of the problem:

http://stackoverflow.com/questions/3764072/c-win32-how-to-wait-for-a-pending-delete-to-complete

                
> 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
>
>
> 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

        

[lucy-issues] [jira] [Commented] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Nick Wellnhofer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437339#comment-13437339 ] 

Nick Wellnhofer commented on LUCY-245:
--------------------------------------

If you haver a closer look at the output of the "3.4.5 (mingw-vista special r3)" test, you'll notice that TestDirManip.c compiles fine just before the error in TestFuncMacro.c. It also includes charmony.h, so why doesn't it fail with the same error? The reason might be that TestDirManip.c (and also the charmonizer probes via _charm.h) include stdio.h before charmony.h. This shouldn't affect the availability of "long long", though.

I guess that all this has nothing to do with 64-bit integers. 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. IIRC, the DeleteFile call exited succesfully but recreating the file immediately could sometimes fail.

This could make probes fail randomly and produce all kinds of weird results. In the "3.4.5 (mingw-vista special r3)" case, the "long long" probe could have failed randomly, then the "__int64" probe could have succeeded, because __int64 might be pulled in by stdio.h on MingW. Then compiling TestFuncMacro.c would fail, because it doesn't include stdio.h before charmony.h.


                
> 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
>
>
> 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

        

[lucy-issues] [jira] [Commented] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Nick Wellnhofer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437563#comment-13437563 ] 

Nick Wellnhofer commented on LUCY-245:
--------------------------------------

Committed with that change as r1374811.
                
> 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

        

[lucy-issues] [jira] [Resolved] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey resolved LUCY-245.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.3.3
    
> 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
>             Fix For: 0.3.3
>
>         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

        

[lucy-issues] [jira] [Updated] (LUCY-245) Charmonizer fails to detect syntax for 64-bit integer literals

Posted by "Nick Wellnhofer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Wellnhofer updated LUCY-245:
---------------------------------

    Attachment: 0101-LUCY-245-Safe-Charmonizer-file-removal-on-Windows.patch

Proposed fix. Untested, because I cannot reproduce the problem with my MingW setup.
                
> 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