RE: 4D Server Crashes When Tracing Buggy Web Connection Code
To refer to the original cause of the crash ... Unfortunately the compiler doesn't find such problems (negative array index variable), this is a typical runtime problem. All what you can do is to write "defensive" code, e.g. checking the value of an index variable, using error handler, don't change the size of an array in a FOR loop whilst accessing of array elements using an index variable and so on. As others mentioned already ... Regards Lutz ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: 4D Server Crashes When Tracing Buggy Web Connection Code
Aloha, Thanks for the tip. Tons and tons of errors in the first run of Check Syntax in the compiler. It is nice that it highlights the line numbers/issues in an open method. The errors though are mostly or all, “The Variable xxx has not been explicitly declared in the typing methods.” As I don't need/want to compile, how do I use this to my advantage? Are you saying I should add declarations to the compiler method for all variables? What I’d really like, is to have only typing errors within a method highlighted. For example, in the method I’m working on, my first lines are: C_TEXT($0) C_TEXT($1) This give an error saying these variables are not declare in typing methods. I don’t see how these “errors" highlighted in my code will help with this. The On Err Call, is helping with crashes, but if I do a TRACE (even with the On Err Call active), it still crashes when I get to the bad code line. I’ll play with the webserver on the client to see if I can work around that. Right now it’s crashing on Distinct Values, which I suspect means there are not “distinct” values in the selection. I’m a bit shocked how sensitive the Web Server is! Sannyasin Siddhanathaswami On Apr 7, 2017, 9:20 AM -1000, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com>, wrote: Aloha Sannyasin, I probably sound like a broken record talking about the compiler so much, but I really wanted to comment on this: As this is an internal database for our non-profits, it’s run in interpreted mode, so no compiler checking done. I do a decent amount of the programing (for the past 10-years), and use what I program. The compiler is a great tool for catching coding mistakes; regardless of whether you plan to deploy compiled or interpreted: http://kb.4d.com/assetid=50223 "If after fixing your code you do not want to run your application compiled, simply click on the *"Clear Compiled Code"* button to remove the compiled code." I don’t think I can use the compiler to do checking either, as tons of the code is carried forward from v1 and v2, and lots of code written without compiler declarations. This shouldn't prevent you from using the compiler; as long as you have either Developer Pro (singleuser) or Team Developer (client-server) the compiler should work for you - it doesn't matter how old the code is, the compiler should still function. If you don’t have Developer Pro or Team Developer then I think that the "Check Syntax" option should still work, even if the compile button is greyed out. Aloha, -Tim ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: 4D Server Crashes When Tracing Buggy Web Connection Code
Aloha Sannyasin, I probably sound like a broken record talking about the compiler so much, but I really wanted to comment on this: > As this is an internal database for our non-profits, it’s run in interpreted > mode, so no compiler checking done. > I do a decent amount of the programing (for the past 10-years), and use what > I program. The compiler is a great tool for catching coding mistakes; regardless of whether you plan to deploy compiled or interpreted: http://kb.4d.com/assetid=50223 "If after fixing your code you do not want to run your application compiled, simply click on the *"Clear Compiled Code"* button to remove the compiled code." > I don’t think I can use the compiler to do checking either, as tons of the > code is carried forward > from v1 and v2, and lots of code written without compiler declarations. This shouldn't prevent you from using the compiler; as long as you have either Developer Pro (singleuser) or Team Developer (client-server) the compiler should work for you - it doesn't matter how old the code is, the compiler should still function. If you don’t have Developer Pro or Team Developer then I think that the "Check Syntax" option should still work, even if the compile button is greyed out. Aloha, -Tim ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: 4D Server Crashes When Tracing Buggy Web Connection Code
Thanks! I’ll be using both of those tips. I haven’t used On Error Call much, but will look into it. At a minimum, I want: “On Error, don’t crash my server!" Sannyasin Siddhanathaswami On Apr 7, 2017, 9:12 AM -1000, wrote: Sannyasin, Two things: I make it a habit to check for -1 anywhere I'm using Find in array... it just bites me if I don't. For methods that run on the server, or even better for processes that run on the server, wrap them in an On err call method that lets you manage the errors yourself. Like not stopping for them. Log them or abort the process. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: 4D Server Crashes When Tracing Buggy Web Connection Code
Sannyasin, Two things: I make it a habit to check for -1 anywhere I'm using Find in array... it just bites me if I don't. For methods that run on the server, or even better for processes that run on the server, wrap them in an On err call method that lets you manage the errors yourself. Like not stopping for them. Log them or abort the process. On Fri, Apr 7, 2017 at 11:51 AM, Sannyasin Siddhanathaswami via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Aloha, > > Yes. The crash did happen when accessing an array with a negative index! > If that’s the only thing that causes the crash, I can be extra careful > about that and do checks. Thanks for pointing this out. And yes, I wrote > that serious bug. :) > > As this is an internal database for our non-profits, it’s run in > interpreted mode, so no compiler checking done. I do a decent amount of the > programing (for the past 10-years), and use what I program. > > I don’t think I can use the compiler to do checking either, as tons of the > code is carried forward from v1 and v2, and lots of code written without > compiler declarations. > -- Kirk Brooks San Francisco, CA === *The only thing necessary for the triumph of evil is for good men to do nothing.* *- Edmund Burke* ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: 4D Server Crashes When Tracing Buggy Web Connection Code
Aloha, Yes. The crash did happen when accessing an array with a negative index! If that’s the only thing that causes the crash, I can be extra careful about that and do checks. Thanks for pointing this out. And yes, I wrote that serious bug. :) As this is an internal database for our non-profits, it’s run in interpreted mode, so no compiler checking done. I do a decent amount of the programing (for the past 10-years), and use what I program. I don’t think I can use the compiler to do checking either, as tons of the code is carried forward from v1 and v2, and lots of code written without compiler declarations. Sannyasin Siddhanathaswami On Apr 6, 2017, 11:15 PM -1000, wrote: To be honest, I don't understand these problems. Our main product relies heavily on the 4D webserver on the server, for years. So far there aren't any serious problems. If there are any, we wouldn't use 4D anymore. And running the webserver on a client isn't an option for us. The only problem we experienced which causes a server crash is accessing an array with a negative index. But such things are caused by serious bugs (during development). What compiler settings do you use? Regards Lutz ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: 4D Server Crashes When Tracing Buggy Web Connection Code
> What compiler settings do you use? Do you have the range checking ON (top option in the compiler settings)? If not you should. -- Neil Dennis 4D Developer since 1990 GreaText - Designing Software for the Way You Work 716 East 1850 N North Ogden, UT 84414 mailto:npden...@greatext.com http://www.greatext.com/ ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: 4D Server Crashes When Tracing Buggy Web Connection Code
To be honest, I don't understand these problems. Our main product relies heavily on the 4D webserver on the server, for years. So far there aren't any serious problems. If there are any, we wouldn't use 4D anymore. And running the webserver on a client isn't an option for us. The only problem we experienced which causes a server crash is accessing an array with a negative index. But such things are caused by serious bugs (during development). What compiler settings do you use? Regards Lutz > -Original Message- > From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Joshua Hunter > via 4D_Tech > Sent: Thursday, April 6, 2017 11:56 PM > To: 4D iNug Technical <4d_tech@lists.4d.com> > Cc: Joshua Hunter <jos...@dwdev.com> > Subject: RE: 4D Server Crashes When Tracing Buggy Web Connection Code > > The web server process is very sensitive to any bugs. We ran into the exact > problem > you are having. Our web team was suddenly very unpopular with the other > developers. Any bug and the whole app would crash. > > We no longer run any code on the web server process on 4D server. Instead we > run a > client application that acts as a web server. This works pretty well. > > The code that gets traced is the code on the machine that handled the > request. So if > you make the request to your web server client application it will trace > there. The web > server on client can run on the same physical server as your 4D server so > long as > they aren't both handling requests on the same port. > > The biggest hurdle we had was getting the correct 4D licensing. There was a > special > license to make the client run the web server. This may be made more difficult > because we are an OEM. > > Joshua Hunter > jos...@dwdev.com > (425)673-1974 > www.dwdev.com > Dataworks Development, Inc. > Providing secure and configurable data management solutions for research and > clinical > labs since 1987. > > > -Original Message- > From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Sannyasin > Siddhanathaswami via 4D_Tech > Sent: Thursday, April 6, 2017 2:14 PM > To: 4D iNug Tech > Cc: Sannyasin Siddhanathaswami > Subject: 4D Server Crashes When Tracing Buggy Web Connection Code > > Aloha, > > If I trace On Web Connection code on 4D Server v15.3 Mac, and I goof and > reference > an out of index array (I know I’m the first to ever do that), our server > crashes. It just > quits to the Finder, no error message nothing. I view the trace via screen > sharing to > the server machine. > > This is disastrous when other people are using 4D!! > > Have others run into this? What’s the best way to debug On Web Connection code > without crashing the server? > > Maybe starting the webserver on 4D client? But how does adding a “Trace" On > Web > Connection code work? Won’t it still trace on the 4D Server? > > Sannyasin Siddhanathaswami > * > * > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > * > * > * > * > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > * > * ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: 4D Server Crashes When Tracing Buggy Web Connection Code
The web server process is very sensitive to any bugs. We ran into the exact problem you are having. Our web team was suddenly very unpopular with the other developers. Any bug and the whole app would crash. We no longer run any code on the web server process on 4D server. Instead we run a client application that acts as a web server. This works pretty well. The code that gets traced is the code on the machine that handled the request. So if you make the request to your web server client application it will trace there. The web server on client can run on the same physical server as your 4D server so long as they aren't both handling requests on the same port. The biggest hurdle we had was getting the correct 4D licensing. There was a special license to make the client run the web server. This may be made more difficult because we are an OEM. Joshua Hunter jos...@dwdev.com (425)673-1974 www.dwdev.com Dataworks Development, Inc. Providing secure and configurable data management solutions for research and clinical labs since 1987. -Original Message- From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Sannyasin Siddhanathaswami via 4D_Tech Sent: Thursday, April 6, 2017 2:14 PM To: 4D iNug Tech Cc: Sannyasin Siddhanathaswami Subject: 4D Server Crashes When Tracing Buggy Web Connection Code Aloha, If I trace On Web Connection code on 4D Server v15.3 Mac, and I goof and reference an out of index array (I know I’m the first to ever do that), our server crashes. It just quits to the Finder, no error message nothing. I view the trace via screen sharing to the server machine. This is disastrous when other people are using 4D!! Have others run into this? What’s the best way to debug On Web Connection code without crashing the server? Maybe starting the webserver on 4D client? But how does adding a “Trace" On Web Connection code work? Won’t it still trace on the 4D Server? Sannyasin Siddhanathaswami ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
4D Server Crashes When Tracing Buggy Web Connection Code
Aloha, If I trace On Web Connection code on 4D Server v15.3 Mac, and I goof and reference an out of index array (I know I’m the first to ever do that), our server crashes. It just quits to the Finder, no error message nothing. I view the trace via screen sharing to the server machine. This is disastrous when other people are using 4D!! Have others run into this? What’s the best way to debug On Web Connection code without crashing the server? Maybe starting the webserver on 4D client? But how does adding a “Trace" On Web Connection code work? Won’t it still trace on the 4D Server? Sannyasin Siddhanathaswami ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **