Hi!
Pike programs (pike version 7.8.316) crash on Windows if I use sql insert with the builtin sqlite module (on Linux there is no problem). Maybe it is a bug?
Cheers: Tamás
I'm sorry, the Windows version is 7.8.352...
From: linuxlinux1@windowslive.com To: pike-devel@lists.lysator.liu.se Subject: sqlite bug on Windows? Date: Sun, 22 Aug 2010 09:01:35 +0200
Hi!
Pike programs (pike version 7.8.316) crash on Windows if I use sql insert with the builtin sqlite module (on Linux there is no problem). Maybe it is a bug?
Cheers: Tamás
2010/8/22 Csürke Tamás linuxlinux1@windowslive.com:
Pike programs (pike version 7.8.316) crash on Windows if I use sql insert with the builtin sqlite module (on Linux there is no problem). Maybe it is a bug?
Hi Csürke,
That most certainly would be a bug. Do you have a short example of how to crash it?
Hi Peter!
I tested my program more exactly and I think now, it may be rather a GTK2 error because of the following: The error occurs in the following lines (penztar.pike: 38 and 39):
34 /* apply gomb */ 35 design->cashflow->okb 36 ->signal_connect("clicked", lambda() 37 { 38 engine->account->source = design->cashflow->megjegyzesc->get_active_text(); 39 engine->account->dest = design->cashflow->ellenszamlac->get_active_text(); 40 engine->account->date = design->cashflow->datume->get_text(); 41 engine->account->money = (int) design->cashflow->osszege->get_text(); 42 engine->account->message = design->cashflow->megjegyzese->get_text(); 43 44 engine->account->konyvelj(); 45 46 design->cashflow->foablakw->destroy(); 47 });
I think the problem is with the get_active_text method (just on Windows both with 7.8.316 and 7.8.352). If I change them to "something" instead of get_active_text the program works well. Both classes are ComboBoxEntry.
I attach my program. (It's just for me (and the family), not a business application...):
If you run it, press the first button ("pénzmozgás (beérkező/kimenő)") and then fill the form with something, for example so as on the attached picture. Now, if you press the "Alkalmaz" ("Apply") button the program will crash (only on Windows).
Cheers: Tamás Csürke
Date: Sun, 22 Aug 2010 13:31:15 +0200 Subject: Re: sqlite bug on Windows? From: bortas@gmail.com To: linuxlinux1@windowslive.com CC: pike-devel@lists.lysator.liu.se
2010/8/22 Csürke Tamás linuxlinux1@windowslive.com:
Pike programs (pike version 7.8.316) crash on Windows if I use sql insert with the builtin sqlite module (on Linux there is no problem). Maybe it is a bug?
Hi Csürke,
That most certainly would be a bug. Do you have a short example of how to crash it?
-- Peter Bortas
Thanks for the example. The crash does indeed happend in the first get_active_text(). I don't have a Windows machine with debugger installed, so I can't trace it further than that right now.
Some random comments on the code that has nothing to do with the bug:
The code is very readable, except for the parts where I'm not sure if you are making up nonsense names for the variables or not. ;-)
You could probably replace all your for-loops with foreach:
for (i = 0; i < sizeof(szamlak); i++) combo->append_text(szamlak[i]);
=>
foreach (szamlak; int i; string ch) combo->append_text(ch);
It might look strange as a straight C-programmer at first, but it avoids off-by-one errors in the long run.
Also, the set_line function could be replaced by this:
string set_line (sting ch) { return ch * 80 + "\n"; }
(: wow :)
From: 10353@lyskom.lysator.liu.se Subject: RE: sqlite bug on Windows? To: pike-devel@lists.lysator.liu.se Date: Sun, 22 Aug 2010 13:50:03 +0000
foreach (szamlak; int i; string ch) combo->append_text(ch);
Of, if you want to confuse/annoy people,
combo->append_text(szamlak[*])
:-)
Thank you for the comments.
The variable names are not always logic... And I don't like the foreach. :) It's really strange. I know it's a wide used keyword... Your set_line advice is very good, I will replace with it my code.
From: 10353@lyskom.lysator.liu.se Subject: RE: sqlite bug on Windows? To: pike-devel@lists.lysator.liu.se Date: Sun, 22 Aug 2010 13:20:02 +0000
Some random comments on the code that has nothing to do with the bug:
The code is very readable, except for the parts where I'm not sure if you are making up nonsense names for the variables or not. ;-)
You could probably replace all your for-loops with foreach:
for (i = 0; i < sizeof(szamlak); i++) combo->append_text(szamlak[i]);
=>
foreach (szamlak; int i; string ch) combo->append_text(ch);
It might look strange as a straight C-programmer at first, but it avoids off-by-one errors in the long run.
Also, the set_line function could be replaced by this:
string set_line (sting ch) { return ch * 80 + "\n"; }
The old sytax for foreach is a bit easier to wrap the head around:
foreach (szamlak, string ch) combo->append_text(ch);
I like using the new one always as it makes the code consistent.
foreach (szamlak;; string ch) combo->append_text(ch);
in this case.
pike-devel@lists.lysator.liu.se