Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-10 Thread Marco van de Voort
  This is the culprit. 
 
 On my system (SuSE 7.1) I have /etc/localtime: 
   symbolic link to /usr/share/zoneinfo/CST6CDT
 
  - but I can't find a file named timezone anywhere.

It is a FPC/FCL/LCL/Lazarus bug, but mostly fpc.

I've to talk to Peter first before fixing this. 

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-10 Thread Marco van de Voort
  It is a FPC/FCL/LCL/Lazarus bug, but mostly fpc.
 
 I don't use Lazarus  - ironically, I ran into this bug while
 trying to recompile a program that interfaces FPC with NEdit.
 It doesn't use Lazarus or GTK, but it uses popen(F, 'ppc386 -iV', 'R') 
 to check the compiler version. As a temporary workaround, I can use 
 oldlinux.popen() or shell('ppc386 -iV  version.txt') and read the 
 result from there.
 
 Thanks a bunch for your help - I would never have guessed
 the timezone file had anything to do with opening a pipe!

The real, more fundamental problem a convention change about 
errorhandling. 

A side effect is that uncatched errors internally in the RTL can propagate
to the next call. 

The actual (convention) problem was that assignpipe read errno when the
call hadn't failed. This was no problem in the old convention
(errno/linuxerror reset to zero on succesfull call) but is in the new one.
  
 PS: For some reason my posts never get nested in the right 
 thread - Maybe pipermail doesn't like yahoo's headers ?

Maybe the yahoo client or server mutilates some headers. I don't use
threading in email atm, so I wouldn't know.

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-09 Thread Jeff Pohlmeyer

  Did you try the example I posted?

 Yes, and it runs fine.
 Peter


hmmm...
 I have tried everything you suggested  ( and everything else I can think of )
 but I still can't get it to work.
 
Could someone else please try this with the Linux 1.9.0 compiler,  
and let me know the results ?
 

program pipetest;
uses errors, unix;
var
  pipi, pipo: text;
begin
  AssignPipe(pipi, pipo);
  perror('AssignPipe', LinuxError);
end.


Thanks, 
 - Jeff



__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-09 Thread GongYu
Jeff Pohlmeyer:
I do not try your sample(I remove it and install 1.0.10),
but the lazarus IDE on my pc always show the same error(can not create pipe)
with FPC 1.9.0 Compiler!




  Did you try the example I posted?

 Yes, and it runs fine.
 Peter


hmmm...
 I have tried everything you suggested  ( and everything else I can think of )
 but I still can't get it to work.

Could someone else please try this with the Linux 1.9.0 compiler,
and let me know the results ?


program pipetest;
uses errors, unix;
var
  pipi, pipo: text;
begin
  AssignPipe(pipi, pipo);
  perror('AssignPipe', LinuxError);
end.


Thanks,
 - Jeff



__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

= = = = = = = = = = = = = = = = = = = =



   GongYu
   [EMAIL PROTECTED]
2003-11-09




___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-09 Thread Florian Klaempfl
GongYu wrote:
 Jeff Pohlmeyer:
 I do not try your sample(I remove it and install 1.0.10),
 but the lazarus IDE on my pc always show the same error(can not create pipe)
 with FPC 1.9.0 Compiler!

This won't help us to improve FPC...



___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-09 Thread Marco van de Voort
pipi, pipo: text;
  begin
AssignPipe(pipi, pipo);
perror('AssignPipe', LinuxError);
  end.
 
 I've tried it, with fpc 1.9.0 (binary rpm downloaded from sf).
 
 $ fpc pipetest.pp
 Hint: End of reading config file /etc/fpc.cfg
 Free Pascal Compiler version 1.9.0 [2003/11/05] for i386
 Copyright (c) 1993-2002 by Florian Klaempfl
 Target OS: Linux for i386
 Compiling pipetest.pp
 Linking pipetest
 9 Lines compiled, 0.7 sec
 
 $ ./pipetest
 AssignPipe: Success

- Do an strace, and see if there is a function that fails.

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Re: Bug in AssignPipe() on Linux

2003-11-09 Thread Marco van de Voort
[ Charset ISO-8859-1 unsupported, converting... ]
 Marco van de Voort wrote:
  - Do an strace, and see if there is a function that fails.
 
 Everything seems OK.
 
 $ strace pipetest
 execve(/home/plc/Pascal/test1.9/pipetest, [pipetest], [/* 63 vars */]) = 0
 sigaction(SIGFPE, {0x805a9d4, [], 0}, {SIG_DFL}, 0x40054d58) = 0
 sigaction(SIGSEGV, {0x805a9d4, [], 0}, {SIG_DFL}, 0x40054d58) = 0
 sigaction(SIGBUS, {0x805a9d4, [], 0}, {SIG_DFL}, 0x40054d58) = 0
 sigaction(SIGILL, {0x805a9d4, [], 0}, {SIG_DFL}, 0x40054d58) = 0
 getpid()= 4307
 readlink(/proc/4307/exe, /home/plc/Pascal/test1.9/pipetest, 255) = 33
 open(/etc/timezone, O_RDONLY) = 3

This is the culprit. People that have this file don't have the problem.
If this one goes wrong, the errno value remains there, and the next 
decision that bases itself on linuxerror goes wrong. 

This is why it was hard to reproduce:
 
In my case, this happens

getpid()= 3953
readlink(/proc/3953/exe, /export/home/marcov/pipetest, 255) = 28
open(/etc/timezone, O_RDONLY) = -1 ENOENT (No such file or directory)

- failed 

stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=1074, ...}) = 0
open(/etc/localtime, O_RDONLY)= 3

- found, but errno is untouched.




___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel