[Mono-bugs] [Bug 73527][Maj] New - code execution problems- nonexisting code execution
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 9 Mar 2005 18:13:20 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by plahcim@o2.pl.
http://bugzilla.ximian.com/show_bug.cgi?id=73527
--- shadow/73527 2005-03-09 18:13:20.000000000 -0500
+++ shadow/73527.tmp.29644 2005-03-09 18:13:20.000000000 -0500
@@ -0,0 +1,102 @@
+Bug#: 73527
+Product: Mono: Runtime
+Version: unspecified
+OS:
+OS Details: amd64
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: JIT
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: plahcim@o2.pl
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: code execution problems- nonexisting code execution
+
+mono from svn
+Linux on amd64 - 64 bit kernel and userland
+mcs source: $(top_srcdir)/../mcs
+ GC: included
+ Globalization: normal; default
+ TLS: __thread
+ SIGALTSTACK: yes
+ Engine: Building and using the JIT
+ 2.0 Alpha: yes
+ JNI support: IKVM Native
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem: I wrote a piece od code using generics (mono
+compiled prom svn), and after succesfull compilation during program
+execution exception appears:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x00011] (at
+/root/komp/mono/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs:895)
+System.Globalization.NumberFormatInfo:GetInstance (IFormatProvider provider)
+in [0x00001] (at /root/komp/mono/mcs/class/corlib/System/UInt16.cs:255)
+System.UInt16:ToString (System.String format, IFormatProvider provider)
+in [0x00092] (at
+/home/users/michalp/prog/lab/oblint/pryzaj/ann/src/intcomp/neural/Perceptron.cs:84)
+intcomp.neural.Perceptron:feed ()
+
+but, in line 84 there is only a primitive assignment (double<-double)
+
+Steps to reproduce the problem:
+No idea where the problem lies, other generics-using parts of code are
+working propely. Field that is causing a problem is testa during assignment
+in constructor and is ok, but any use of it after fails.
+Type examining gives a type mismatch. Code:
+namespace intcomp.numeric{
+ public abstract class Function<TW,TA> {
+ public abstract TW compute(TA arg);
+ }
+}
+namespace intcomp.numeric{
+ public class Sigmoid : Function<double,double> {
+ protected double beta;
+ public override double compute(double arg){
+ return 1.0/(1.0+System.Math.Exp(-beta*arg));
+ }
+ public Sigmoid(double beta){this.beta=beta;}
+ }
+}
+
+---------
+using intcomp.numeric;
+namespace intcomp.neural {
+ public class ActivationFunction <WY,WE>{
+ public Function<WY,WE> f;
+ public Function<WY,WE> df;
+
+ public ActivationFunction(Function<WY,WE> f,Function<WY,WE> df){
+ this.f=f;this.df=df;
+ }
+ }
+}
+
+and than in for example feed (that is screaming now):
+double tmp=this.af.f.compute(activation);
+output=tmp; <-- line 84
+
+you can email my for full source code for testing,
+but the code is not finished;
+
+Code works fine in windows :(
+
+Actual Results:
+Type testing on af fields shows type mismatch.
+Not Function <t,t2> but int or uint depending on the nature of the next
+statment
+Made some changes to (class->interface->class)
+
+Expected Results:
+proper function invocation :)
+
+How often does this happen?
+Every time with this code;
+
+Additional Information: