Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3610 | major | always | 07-27-09 10:33 | 08-27-09 11:39 | |
|
|||||
Reporter: | tlandmann | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 4.0.0 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.2 | ||
|
|||||
Summary: | 0003610: static function variables not "really" static | ||||
Description: |
The sample programm below prints the following (expected) in standard PHP 5.2.6: 0 1 2 In Quercus (non-compiled mode) it prints: 0 0 1 --------------------------- <?php class class_1 { public static function method_1() { function_1(); } public function method_2() { function_1(); } } function function_1() { static $value=0; echo $value++."\n"; } function_1(); class_1::method_1(); $object=new class_1; $object->method_2(); ?> --------------------------- I already kind of identified the problem: "com.caucho.quercus.statement.StaticStatement:65" reads: QuercusClass cls = env.getCallingClass(); This can't be fully correct because it returns "class_1" if the invocation of function_1() was made from the class - although the class really doesn't have anything to do with the static variable in the function. --------------------------- QUERCUS DEVELOPERS PLEASE NOTE: I almost spent 3 days on this bug, which completely breaks my adapted Drupal system because all the time parts of the CSS get lost (drupal_add_css() uses a static variable...). This bug is so special that my only chance to find out what the problem was (and to invent a workaround) was to debug Resin on the Java level. However, finding out how to do this was not easy. Netbeans just never stopped at my breakpoints, and I didn't have any idea, why. "http://wiki.caucho.com/IDE" [^] doesn't seem to be up-to-date any more. It took me ages finding out that I had to use config settings like this: <jvm-arg>-Xdebug</jvm-arg> <jvm-arg>-Xrunjdwp:transport=dt_socket,address=8998,server=y,suspend=n</jvm-arg> instead of command line args to get it working. A major step that I also took was recompiling Quercus with debug info, which also wasn't easy. I don't know if it was finally necessary but I still think so. First I had to get all the elements needed, then I had to cope with the problem that the source code doesn't contain all classes needed to run Quercus. To cut it short: I could never have posted this bug without all this work because I didn't at all have it reproducible before I pinned the bug down in the debugger. I think if people go all this way to improve Resin, they help you a lot. So please also help us with these two things: 1: Offer a download with complete debug info in the .class files . 2: Write an up-to-date tutorial on how to debug Resin/Quercus. Thanks. Keep up the good work. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|