Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Sven Barth
Am 15.10.2016 17:39 schrieb "Snorkl e" : > > Sven, > Just a fyi, the mantis bug report form would not let me pick a Severity so its showing up as minor. Thank you for reporting the bug. Yes, we've disabled the severity, cause the severity we assume is not usually the

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven, Just a fyi, the mantis bug report form would not let me pick a Severity so its showing up as minor. On Sat, Oct 15, 2016 at 10:36 AM, Snorkl e wrote: > Sven, > Bug report added:

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven, Bug report added: http://bugs.freepascal.org/view.php?id=30747 Have a great weekend :-) On Sat, Oct 15, 2016 at 3:30 AM, Sven Barth wrote: > Am 15.10.2016 09:52 schrieb "Snorkl e" : > > > > Sven, > > Your idea worked. I downloaded the

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Sven Barth
Am 15.10.2016 09:52 schrieb "Snorkl e" : > > Sven, > Your idea worked. I downloaded the FPC source and made that change and then built everything to another directory. > modified the fpc.cfg to not point to the FPC dir in the Lazarus folder and made the path changes in the

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven, Your idea worked. I downloaded the FPC source and made that change and then built everything to another directory. modified the fpc.cfg to not point to the FPC dir in the Lazarus folder and made the path changes in the Lazarus IDE. Compiled the project with the fresh build and did the same

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Snorkl e
Hi Sven, Yes I can try that this weekend sometime and will respond with results,. Thanks for taking a look at that  On Oct 14, 2016 3:41 PM, "Sven Barth" wrote: > Am 14.10.2016 20:31 schrieb "Snorkl e" : > > > > Yep, I used heaptr, my code is

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Sven Barth
Am 14.10.2016 20:31 schrieb "Snorkl e" : > > Yep, I used heaptr, my code is clean. > Sometimes it would happen after 3 connects/disconnects and sometimes after 500. > With the GUID as the event name it has never happened again and I really stress tested it. > > It sounds

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Snorkl e
Yep, I used heaptr, my code is clean. Sometimes it would happen after 3 connects/disconnects and sometimes after 500. With the GUID as the event name it has never happened again and I really stress tested it. It sounds like windows bug to me, but who knows. On Oct 14, 2016 1:23 PM, "José Mejuto"

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Snorkl e
Hi Sven, Yes the events get destroyed in the threads destructor. I verified they were being freed up. It would usually happen when lots of connect disconnects happened in a short time. Once that error 161 popped it could not be recovered from, all new connections would fail on the

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread José Mejuto
El 14/10/2016 a las 20:11, Snorkl e escribió: Since I solved it by giving the name param a giud, the next thing to ask is why does teventobject fail kind of silently when the name parm is blank over time? Hello, To me it looks like a memory corruption, in your program or in the library.

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Snorkl e
Hi Tomas, TEventobject.create is the only thing called in the thread constructor, and teventobject.create is indeed calling a API function in order to create the event. There is no other way to find out if teventobject.create failed as teventobject.handle always has a value even if it fails. So

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Tomas Hajny
On Fri, October 14, 2016 17:44, Snorkl e wrote: Hi, > Hi, actually getlasterror only applies to the calling thread, > getlastOSerror is the one not to use. > Anyway I think I found the solution. . . I'm glad that you found potential reason of the problem, but your assumption regarding

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Sven Barth
Am 14.10.2016 17:45 schrieb "Snorkl e" : > > Hi, actually getlasterror only applies to the calling thread, getlastOSerror is the one not to use. GetLastOSError merely calls GetLastError on Windows... > Anyway I think I found the solution. > Just for kicks I put in a name

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Snorkl e
Hi, actually getlasterror only applies to the calling thread, getlastOSerror is the one not to use. Anyway I think I found the solution. Just for kicks I put in a name with a / I.e /test_name and getlasterror came back with the same error. So the API is being called somewhere with

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-14 Thread Jonas Maebe
On 14/10/16 02:43, Snorkl e wrote: Anyway, I am using a third party SFTP server lib and it creates a thread inherited from tthread and in the create event of the tthread descendant it does this: (It uses this thread to read and write data on the socket) FDataAvailable := TEvent.Create(nil,

[fpc-pascal] teventobject.create fails with error 161

2016-10-13 Thread Snorkl e
Hi, Just wondering if anyone has any ideas. I am using FPC 3.0 by the way. Anyway, I am using a third party SFTP server lib and it creates a thread inherited from tthread and in the create event of the tthread descendant it does this: (It uses this thread to read and write data on the socket)