Re: [fpc-devel] Lazarus Apache module crashes during concurrent requests
Hi Jonas, This seems to work on Windows (and solves the problem), but on Linux WaitForThreadTerminate waits forever. WaitForThreadTerminate(BeginThread(@__dummythread), 300); apache just waits and doesn't start until I stop the apache loading with ctrl+c, as if it is in an infinite loop and waiting. Any thoughts? AB Jonas Maebe wrote: On 24 Sep 2008, at 10:58, ABorka wrote: I'm not sure that something is changed to make it incompatible. The apache modules compiled on windows are only crashing if multiple requests are coming at the same time, and they are crushing at function/procedure returns (Yes, on Linux it is even worse, since no module gets even loaded by apache. That might be some C API translation problem). Maybe you have to initialise the threading system so all the necessary locks in the system unit get activated. Something like {$ifdef unix} uses cthreads; {$endif} ... function dummythread(p: pointer): ptrint; begin end; initialisation WaitForThreadTerminate(BeginThread(@dummythread)); end. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] library export in Linux
On 05 Oct 2008, at 13:23, Jonas Maebe wrote: On 05 Oct 2008, at 12:59, Felipe Monteiro de Carvalho wrote: On 10/5/08, ABorka <[EMAIL PROTECTED]> wrote: The problem is only there (checked now on apache 2.2.3 also with the latest svn fpc /11864/ and lazarus /16875/ trunk) if {$ifdef WINDOWS}//!! not needed exports test_module name 'test_module1'; {$endif}//!! not needed Well, then FPC changed, and the old way to export variables on unixes doesn't work anymore. Looks like a regression Previously, all public declarations were automatically exported from libraries under Unix. This was a bug. Now only what appears in the exports section is exported. Variables can however not be renamed in the exports section under Unix (previously they were not allowed in the exports section at all). I've added this to http://wiki.freepascal.org/User_Changes_2.2.2#Exporting_of_library_variables_and_functions Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] library export in Linux
On 10/5/08, ABorka <[EMAIL PROTECTED]> wrote: > The problem is only there (checked now on apache 2.2.3 also with the latest > svn fpc /11864/ and lazarus /16875/ trunk) if > > {$ifdef WINDOWS}//!! not needed > exports test_module name 'test_module1'; > {$endif}//!! not needed Well, then FPC changed, and the old way to export variables on unixes doesn't work anymore. Looks like a regression, but it's not a too big problem. We can just change that in the examples and have less ifdefs. > is there. If the ifdef is removed and the exports instruction is there, > then apache loads the module without any errors on Linux. Does it also work (instead of only loading) without the ifdef and without you debuging code? > If the assignfile is called, it already screws the DefaultHandler execution > even if the lines after it are commented out in the procedure. > Any suggestion why? I've tried to use streams, same result. wow, this is really strange. I cannot think of a reason why this would happen ... if noone else here has an idea I would ask in a apache mailling list. There may be some reason connected to the internal apache structure. -- Felipe Monteiro de Carvalho ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] library export in Linux
On 05 Oct 2008, at 12:59, Felipe Monteiro de Carvalho wrote: On 10/5/08, ABorka <[EMAIL PROTECTED]> wrote: The problem is only there (checked now on apache 2.2.3 also with the latest svn fpc /11864/ and lazarus /16875/ trunk) if {$ifdef WINDOWS}//!! not needed exports test_module name 'test_module1'; {$endif}//!! not needed Well, then FPC changed, and the old way to export variables on unixes doesn't work anymore. Looks like a regression Previously, all public declarations were automatically exported from libraries under Unix. This was a bug. Now only what appears in the exports section is exported. Variables can however not be renamed in the exports section under Unix (previously they were not allowed in the exports section at all). Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] library export in Linux
> Does it also work (instead of only loading) without the ifdef and > without you debuging code? The mod_hello most basic example works (apache 2.2.3 and 2.2.8). But for now, not any vanilla apache module created with file->new->apache module in Lazarus on Linux works (apache 2.2.8, didn't test on 2.2.3) even with the exports changes. Even with only 1 default action in the web module saying "hello world" when called. Felipe Monteiro de Carvalho wrote: On 10/5/08, ABorka <[EMAIL PROTECTED]> wrote: If the assignfile is called, it already screws the DefaultHandler execution even if the lines after it are commented out in the procedure. Any suggestion why? I've tried to use streams, same result. wow, this is really strange. I cannot think of a reason why this would happen ... if noone else here has an idea I would ask in a apache mailling list. There may be some reason connected to the internal apache structure. Yes, it is strange. And modules created through Lazarus on Linux have the same problem of returning an empty page no matter what. And there is no debugging log file writing in there. Not sure about stream useage though. We need to fix it in the hello_mod example first - since the little library is so simple - , I think it'll fix the apache modules created with Lazarus too. There is also the problem of WaitForThreadTerminate(BeginThread(@__dummythread), 300); never returning for me on Linux apache module library. This fixed the multiple simultaneous calls on windows, but on Linux it does not return. Might not even be needed, but for now cannot test it before the above is fixed. Just commented it out for now on Linux. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] FPC 2.2.3 i386-darwin snapshot
Hello, How would I procede to create the snapshot myself? I really need it. I cannot create toolbars in Cocoa without static. -- Felipe Monteiro de Carvalho ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel