bvarga / delphizmq

0MQ Delphi binding
GNU Lesser General Public License v3.0
137 stars 63 forks source link

TZMQSocket.recv fails in Delphi 10 #18

Open optimax opened 8 years ago

optimax commented 8 years ago

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

hippowar commented 7 years ago

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 commented 7 years ago

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;