Ticket #806 (new bug)

Opened 13 years ago

Last modified 12 years ago

Test.readdir is not skipped on Win32 even though it appears that it should be

Reported by: MoC Owned by:
Priority: normal Milestone:
Component: core Version: trunk
Severity: low Keywords:
Cc: Language:
Patch status: Platform: win32

Description

t/pmc/os.t:270:

skip 'not implemented on windows yet', 1 if ( $MSWin32 && $MSVC );

It seems like the message doesn't agree with the if clause, because you can also use GCC (MinGW) to compile on Windows. If you compile Parrot on Windows XP SP3 with GCC 4.4 this test will fail (see attached log and smolder report at  http://smolder.plusthree.com/app/public_projects/report_details/24454). However I'm not sure wether the if clause is responsible for this error or GCC 4.4 since other Windows builds compiled with GCC 3.4 pass this test according to smolder (see  http://smolder.plusthree.com/app/public_projects/report_details/24452).

Attachments

ErrorLog.txt Download (1.2 KB) - added by MoC 13 years ago.
Procmon_Logfile.xml Download (4.1 KB) - added by MoC 13 years ago.

Change History

Changed 13 years ago by MoC

  Changed 13 years ago by MoC

I also attached a logfile created with Process Monitor which displays all queries made to the docs directory. Seems like Parrot just opens the directory and stops, while Perl reads it correctly.

Changed 13 years ago by MoC

  Changed 13 years ago by fperrad

My current Strawberry Perl 5.10.0.3 is built (and ship) with gcc 3.4.5

I build Parrot with gcc 3.4.5 and the readdir test is OK.

I think that the problem is in the MinGW libc : not the same behaviour between 3.4.5 and 4.4.0

  Changed 13 years ago by MoC

To make sure I compiled the following snippet:

#include <dirent.h>
#include <stdio.h>

int main (int argc, char * argv[])
{
	struct dirent *dirent;
	DIR *dir = opendir("SomeDirectoryThatExists");

	while ((dirent = readdir(dir)) != NULL) {
		printf("%s ", dirent->d_name);
	}

	closedir(dir);
}

Which works as expected. Could it be that the while-loop in the pmc code is not reached at all?

follow-up: ↓ 5   Changed 13 years ago by fperrad

Could you try to build Parrot without --optimize ?

in reply to: ↑ 4   Changed 13 years ago by MoC

Replying to fperrad:

Could you try to build Parrot without --optimize ?

Seems like it works without --optimize:  http://smolder.plusthree.com/app/public_projects/report_details/24456. Is there a known bug with --optimize or was that just a guess?

follow-up: ↓ 7   Changed 13 years ago by fperrad

Configure.pl with --optimize ==> gcc with -O2

-O2 -s works fine with MinGW gcc-3.4.5 (see  http://smolder.plusthree.com/app/public_projects/report_details/24452)

It seems to be a bug of MinGW gcc-4.4.0 when -O2 is enabled
or -O2 always needs -s like with gcc-3.4.5

MinGW gcc-4.4.0 was released on 22 June 2009, so it's very recent.

in reply to: ↑ 6 ; follow-up: ↓ 9   Changed 13 years ago by jkeenan

Replying to fperrad:

Configure.pl with --optimize ==> gcc with -O2 -O2 -s works fine with MinGW gcc-3.4.5 (see  http://smolder.plusthree.com/app/public_projects/report_details/24452) It seems to be a bug of MinGW gcc-4.4.0 when -O2 is enabled
or -O2 always needs -s like with gcc-3.4.5 MinGW gcc-4.4.0 was released on 22 June 2009, so it's very recent.

Should we consider adding data like this to the Win32 hints file?

  Changed 13 years ago by fperrad

Same problem with --optimize=-O1

in reply to: ↑ 7   Changed 12 years ago by jkeenan

Replying to jkeenan:

Replying to fperrad:

Configure.pl with --optimize ==> gcc with -O2 -O2 -s works fine with MinGW gcc-3.4.5 (see  http://smolder.plusthree.com/app/public_projects/report_details/24452) It seems to be a bug of MinGW gcc-4.4.0 when -O2 is enabled
or -O2 always needs -s like with gcc-3.4.5 MinGW gcc-4.4.0 was released on 22 June 2009, so it's very recent.

Should we consider adding data like this to the Win32 hints file?

Can anyone respond?

Note: See TracTickets for help on using tickets.