delphizmq icon indicating copy to clipboard operation
delphizmq copied to clipboard

TZMQSocket.recv fails in Delphi 10

Open optimax opened this issue 8 years ago • 2 comments

Compiling with Delphi 10 Update 1, Win32 target. Trying to run hwserver/hwclient (the first "Hello World" example from ZeroMQ Guide. The client fails with an access violation on line 33:

requester.recv( sMsg );

Investigating a little bit further, it seems string heap corruption is happening, resulting in an access violation whenever TZMQFrame runs its CleanupInstance (first line of System.TMonitor.Destroy is where it's failing: FLockEvent seems to be corrupted at this point).

hwclient.dpr.txt hwserver.dpr.txt

optimax avatar Apr 02 '16 00:04 optimax

Compiling with Delphi 10.1 Update1, Win32, Trying test.exe. with libzmq.dll (4.2.0 and 3.2.5)

That fails in 4.2.0. binary file. with 3.2.5 not raise exception. somthing change zmq_msg_t clean instance.

hippowar avatar Dec 16 '16 01:12 hippowar

I found different between 3.2.5 and 4.2.0. zmq_msg_t structure changed. structure unsigned char[32] --> unsigned char[64]

must changed from zmq_msg_t = record array[0..32-1] of Byte to zmq_msg_t = record array[0..64-1] of Byte;

hippowar avatar Dec 16 '16 01:12 hippowar