Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-12

Problems with rapid fpSend calls on x64 Ubuntu 10.10 (updated)

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

OS: Ubuntu 10.10 x64 all updates as of this am. But problem has persisted for days now.
Laz/FPC: Today's trunk

worker thread running issues a call to fpSend with iSend Bytes in buffer
        Try
RSRP^.LastCall:=Sockets.fpSend(RSRP^.Info.Socket,@FSendBuffer[0],iSend,0);
        except
          on E:Exception do
OnRSRException('TRSRManager.cb_RSR_Send','Exception',E.Message);
        end;

FPC/srtl/linux/x86_64/syscall.inc

line 319 fails but execption is raised in 320.

line 319: syscall { Do the system call. } line 320: cmpq $-4095, %rax { Check %rax for error. }

I had exception handling inside the block but it was not caught.

Anyone else having problems with sockets on Unix. This problem does not exist on Windows. After the first occurance of this issue, all network engine activity fails across other threads too with exceptions at this very spot.

Any help would be greatly appreciated.

Reply by email

Michael Van Canneyt
to Andrew Brunner
Andrew Brunner wrote 24 lines
OS: Ubuntu 10.10 x64 all updates as of this am.  But problem has persisted for days now. Laz/FPC: Today's trunk worker thread running issues a call to fpSend with iSend Bytes in buffer         Try           RSRP^.LastCall:=Sockets.fpSend(RSRP^.Info.Socket,@FSendBuffer[0],iSend,0);         except           on E:Exception do OnRSRException('TRSRManager.cb_RSR_Send','Exception',E.Message);         end; FPC/srtl/linux/x86_64/syscall.inc line 319 fails but execption is raised in 320. line 319:   syscall                 { Do the system call. } line 320:  cmpq $-4095, %rax       { Check %rax for error.  } I had exception handling inside the block but it was not caught. Anyone else having problems with sockets on Unix.  This problem does not exist on Windows.  After the first occurance of this issue, all network engine activity fails across other threads too with exceptions at this very spot. Any help would be greatly appreciated.

It would help if you could say what the exception exactly is ?

Michael.

Reply by email

Andrew Brunner
to Michael Van Canneyt
Michael Van Canneyt wrote
It would help if you could say what the exception exactly is ?

Thanks Michael,

Well all I see is a SIGPIPE exception. As stated before the actual FPC exception was not raised (or the except block was not executed) in there so I can't even log the error. Does that help?

Reply by email

Michael Van Canneyt
to Andrew Brunner
Andrew Brunner wrote 10 lines
On Thu, Dec 2, 2010 at 1:14 PM, Michael Van Canneyt wrote: It would help if you could say what the exception exactly is ? Thanks Michael, Well all I see is a SIGPIPE exception.  As stated before the actual FPC exception was not raised (or the except block was not executed) in there so I can't even log the error.  Does that help?

Yes.

This is a Unix signal (and not an exception in the pascal sense) which is not caught by the FPC rtl. You should (when sending data to your socket) add the MSG_NOSIGNAL flag to fpSend (on Unix).

Have a look in fcl-web/src/base/custfcgi.pp to see how we do this.

(and look on internet for the meaning of the MSG_NOSIGNAL flag :) )

Michael.

Reply by email