1

Topic: Exception storage pulls down

Good afternoon. Faced the following problem: 1. Comes only in release. In debuge all works. 2. Version Java one of the last. 3. How to bypass a problem clearly, there is no clearness what exactly happens Caller causes callee: callee (Enum vulgaris, double [] melkijArray) melkijArray - 2-3 elements. Caller is responsible for creation and filling and does it correctly. Callee trusts Caller and does not check parameters. Further the pseudocode callee: double d1=0; double d2=0; double d3=0;... try {d1 = melkijArray [0]; d2 = melkijArray [1]; d3 = melkijArray [2]; catch (Exception e) {} doSmth1 (d1, d2); doSmth2 (d2); if (it is necessary && d3 is set) doSmth3 (d3); Callee too accurately knows, when it is necessary for it 2, and when three doubles. Exception takes off, if it is transferred double [2], but in this case d3 and it is not used. 10-20 calls callee transit normally (both with double [2] and with double [3]). Then suddenly after "handling" Exception'a there are zasr th d1 and d2. In them garbage (not 0 and not expected value). Could assume "" but also then the garbage, and zero would expect not. It would be desirable to receive answers (assumptions) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. Thanks.

2

Re: Exception storage pulls down

Hello, boris _, you wrote: _> 10-20 calls callee transit normally (both with double [2] and with double [3]).  that 10-20 coils are required on that jvm decided to involve somehow jit compiler, _> 1 is similar. Comes only in release. In debuge all works. And its optimized code (it is possible  at level of instructions specific to processors where works release, in the image which is probably distinct from where chases debug) _> Then suddenly after "handling" Exception'a there are zasr th d1 and d2. In them garbage (not 0 and not expected value). _> Could assume "" but also then the garbage, and zero would expect not. Starts to fall on array index out of bound not the most correct for jvm a method _> Callee trusts Caller and does not check parameters. For simple workaround' I would suggest to separate with the registration of the put trust level extraction d3 from first two and specification as exceptions, and responses to it: double d1=melkijArray [0]; double d2=melkijArray [1]; double d3; try {d3 = melkijArray [2];} catch (ArrayIndexOutOfBoundsException e) {d3 = 0.0d;} _> It would be desirable to receive answers (assumptions) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. Half it turned out to be retained, as a smog

3

Re: Exception storage pulls down

Hello, boris _, you wrote: Caller works in one flow? The transmittable array how I understood, not , and forms new to each call? And how you bypass this [your] problem?

4

Re: Exception storage pulls down

Hello, boris _, you wrote: _> Good afternoon. Faced the following problem: _> It would be desirable to receive answers (assumptions) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. _> thanks. And really to see that  the falling code with the test which this all business plays back?

5

Re: Exception storage pulls down

Hello, UDI, you wrote: UDI> Hello, boris _, you wrote: UDI> Caller works in one flow? Yes. UDI> the Transmittable array how I understood, not , and forms new to each call? Sometimes , there is a new. UDI> and how you bypass this [your] problem? Somehow so d1 = melkijArray [0]; d2 = melkijArray [1]; if (melkijArray.length> 2) d3 = melkijArray [2];

6

Re: Exception storage pulls down

Hello, StanislavK, you wrote: SK> Hello, boris _, you wrote: _>> Good afternoon. Faced the following problem: _>> It would be desirable to receive answers (the assumption) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. _>> thanks. SK> and really to see that  the falling code with the test which this all business plays back? Alas is not present.

7

Re: Exception storage pulls down

Hello, C0s, you wrote: Thanks

8

Re: Exception storage pulls down

Hello, boris _, you wrote: _> Hello, StanislavK, you wrote: SK>> Hello, boris _, you wrote: _>>> Good afternoon. Faced the following problem: _>>> It would be desirable to receive answers (assumptions) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. _>>> thanks. SK>> and really to see that  the falling code with the test which this all business plays back? _> alas is not present. You described explicitly enough a test case. Did not try to write real test code which it plays back? With it it is possible already and to a bug in oracle to lift for example. Simply without source codes, always there is a chance that you in the analysis where that made an error. At least here, the greatest my suspicion causes only how much precisely you made check that parameters in a method really who does not change to state that in d1/d2 garbage. Can do is easier a copy of parameters after their obtaining and ? If it to rectify this error, a problem in the code analysis.

9

Re: Exception storage pulls down

Hello, Tourist, you wrote: T>... Always there is a chance that you in the analysis where that made an error. Who is perfect? T> at least here, the greatest my suspicion causes only how much precisely you made check that parameters in a method really who does not change to state that in d1/d2 garbage. Can do is easier a copy of parameters after their obtaining and ? Parameters are checked 4 times. Before a call, in the beginning caused, before an output and in causing - right after a call. All values are correct. A program - 1 flow.

10

Re: Exception storage pulls down

Hello, boris _, you wrote: At me a question to experts. And at exception embarkation unless objects in the unit try will not be destroyed?  I not  am simply interesting.

11

Re: Exception storage pulls down

Hello, Burbulis1978, you wrote: B> At me a question to experts. And at exception embarkation unless objects in the unit try will not be destroyed? B> I not  am simply interesting to Kakby. It is faster a question not to experts, and a question on knowledge of basic knowledge of Dzhavy. No, all instructions in the unit try which have been fulfilled before rejection of an exception and remain. It not as in databases, transaction rollback.

12

Re: Exception storage pulls down

Hello, boris _, you wrote: _> _> double d1=0; _> double d2=0; _> double d3=0; _>... _> try {_> d1 = melkijArray [0]; _> d2 = melkijArray [1]; _> d3 = melkijArray [2]; _> catch (Exception e) _> {_>} _> doSmth1 (d1, d2); _> doSmth2 (d2); _> if (it is necessary && d3 is set) _> doSmth3 (d3); _> Magics do not happen, the described case enough simple. If it is impossible to pull out it and to write small , a problem most likely either in the logician or to synchronization of flows and  this array where or.

13

Re: Exception storage pulls down

Hello, Tourist, you wrote: T> Hello, Burbulis1978, you wrote: B>> At me a question to experts. And at exception embarkation unless objects in the unit try will not be destroyed? B>> I not  am simply interesting to Kakby. T> it is faster a question not to experts, and a question on knowledge of basic knowledge of Dzhavy. T> Is not present, all instructions in the unit try which have been fulfilled before rejection of an exception and remain. It not as in databases, transaction rollback. In some other languages can so will happen that after burst of an exception objects are remote and fulfill . For this reason in similar languages it is impossible to throw out an exception in , leads to the recursive call . I.e. exception burst kills object, is caused , that again throws out an exception and went - went. Simply I  forgot partially that is garbage collector and is not present  the incorrect. Therefore probably and the question is not meaningful.

14

Re: Exception storage pulls down

15

Re: Exception storage pulls down

Hello, boris _, you wrote: _> 1. Comes only in release. In debuge all works. Well to be defined that it for assembly such release/debug? Not in a Visual Studio gathers? Release it production or on test copies too it is possible to repeat a problem? Whether repeats on different iron? _> 2. Version Java one of the last. Well to specify. If repeats in a test surrounding, it is possible to try any very old  the same version Java or even prior version Java. _> it would be desirable to receive answers (assumptions) on-being, instead of bypass variants, arguing of quality of the code and questions of rate of fire. The answer on the substance of the such. The probability of an error in your code on many above probability of an error in JVM which is covered by a large quantity of tests and is used everywhere by thousand companies. Probably at you OpenJDK or  Java build 9?

16

Re: Exception storage pulls down

Hello, Blazkowicz, you wrote: B> Yes.  to see. No. . _>> 1. Comes only in release. In debuge all works. B> well to be defined that it for assembly such release/debug? Not in a Visual Studio gathers? Under Eclipse (4.4.2): Run - falls. Debug - works. _>> 2. Version Java one of the last. B> well to specify. Not my computer. Access to it while is complicated. On my computer (java version "1.8.0_74") my tests work without problems. On  I do not know, type java version "1.8.0_65" B> it is possible at you OpenJDK or  Java build 9? No.

17

Re: Exception storage pulls down

5/24/2017 16:54, boris_ writes:> Under Eclipse (4.4.2): Run - falls. Debug - works. Works always, including without break points? If by your machine all works, and "access to a tester computer is complicated", whence it can be known? Including and about the version , really used  at program start. And still - the tester launches the program in , moreover through run/debug??? Begin with program start simply from cmd or shell ($JAVA_HOME/bin/java...) - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

18

Re: Exception storage pulls down

Hello, boris _, you wrote: _>>> 1. Comes only in release. In debuge all works. B>> well to be defined that it for assembly such release/debug? Not in a Visual Studio gathers? _> under Eclipse (4.4.2): Run - falls. Debug - works. Run, Release - what difference, truth? Generally it becomes still . The basic difference between Run/Debug should not be. The only thing that at Eclipse the own compiler. _> not my computer. Access to it while is complicated. _> on my computer (java version "1.8.0_74") my tests work without problems. _> on  I do not know, type java version "1.8.0_65" B>> it is possible at you OpenJDK or  Java build 9? _> Is not present. I correctly understood, falls only on one computer and only at start through Run in Eclipse?

19

Re: Exception storage pulls down

Hello, Burbulis1978, you wrote: B> in some other languages can so will happen that after burst of an exception objects are remote and fulfill . B> For this reason in similar languages it is impossible to throw out an exception in , leads to the recursive call . B> I.e. exception burst kills object, is caused , that again throws out an exception and went - went. No, not therefore (more precisely there generally there is no additional recursion, whence you it took?). That is why that is not provided/not the mechanism of plural exceptions flying by through one scope is implemented. Yes, and by the way, in a C ++ it is technically possible to throw out an exception from . And problems will be just at plural exceptions, but without them there is no additional recursion "went-went".

20

Re: Exception storage pulls down

21

Re: Exception storage pulls down

Hello, Blazkowicz, you wrote: B> I correctly understood, falls only on one computer and only at start through Run in Eclipse? At developers (2 computers) on small tests of problems is not present. At testers (1 computer) on more difficult test - falls. Influence a program of testers I cannot. By the way, if to thrust in catch block an output to the console - effect disappears. Any Workaround, removing Exception, - the effect disappears.

22

Re: Exception storage pulls down

Hello, hrensgory, you wrote: H> Works always, including without break points?... And still - the tester launches the program in , moreover through run/debug??? Yes H> If by your machine all H> works, and "access to a tester computer is complicated", whence it H> can be known? It is really necessary to answer a question "whence"?

23

Re: Exception storage pulls down

5/25/2017 8:52, boris_ writes:> H> Works always, including without break points?... And still - the tester> launches the program in , moreover through run/debug???> Yes>> H> If by your machine all> H> works, and "access to a tester computer is complicated", whence it> H> can be known?> it is really necessary to answer a question "whence"? Well it is interesting. As a matter of fact it turns out that the code falls only in one surrounding. That it does not fall at start in a mode debug and does not fall if though something to interpose into handling Exception (i.e. in situations when performance most likely is slightly decelerated) directs on following assumptions: 1. Something at all so with the test bench. From here a sentence to launch the program on it not in Eclipse and it is simple from command line, explicitly specifying layout java. 2. Diagnostics is incorrect - actually a cause of error at all that in an array suddenly there is left data. From here a question - whence you authentically know, what in an array after the unit catch there is left data? In my opinion it can be stated only if at you is log.trace with an output of all array directly to and right after catch the unit and testers give you these broad gulls. 3. In the initial story about caller, its mutual relations with callee and the pseudocode callee is any essential , the first candidates it is finite usage  libraries at formation of an array and (it is possible, unexpected for you arising in the test environment) a multithreading. 4. A bug in JDK. It is certainly possible, though and it is improbable. But  at you hardly accept without played back test case. And if the test a case appears, it is possible and to ask before official reviewing the same Alexey Shipilyova (https://shipilev.net / to write better in  @shipilev) on it to look - if to it a case seems interesting, can and prompts that at once. - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

24

Re: Exception storage pulls down

Hello, boris _, you wrote: _> On  I do not know, type java version "1.8.0_65" And what for to use ancient versions? Deliver last and all. Your bug can one year ago corrected, and you lose time.

25

Re: Exception storage pulls down

Hello, Evgeny. Panasyuk, you wrote: EP> Yes, saw, in Java this moment worked, in particular in try-with-resources. Not especially also worked. Simply added a field in Throwable and it is is specific for this construction implemented. The exception from finally would be quite good for adding in suppressed automatically. Certainly this violation of compatibility but to whom such compatibility is necessary is formal.