Recent

Author Topic: LazSqlX  (Read 144207 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #150 on: October 21, 2014, 08:12:40 am »
Could you try testing setting the linker to the external linker by setting -Xe in project options/other and see if debugging/running is ok?
Before there was an internal linker, an external linker was used. On other platforms, it is still used (see thread in fpc-devel from me on that subject).
So it had been working fine at some time at least.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #151 on: October 21, 2014, 08:20:27 am »
Fair enough.  I don't see why it isn't working then. 

I've found how jwawinuser is linked into the app though.  Through MouseAndKeyInput, which uses JwaWinUser which in turn uses jwawinuser. (Idiot last part of sentence, please ignore :-) )
« Last Edit: October 21, 2014, 08:28:51 am by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #152 on: October 21, 2014, 08:28:15 am »
OK, I've got External Linker working.

Remove LazMouseAndKeyInput from Project Dependencies
Hit Compile.  Work your way through the errors.  99% of them are simply Uses that look like they can be removed.
When you get to LazSQLXCtrls.pas, comment out the following code.
Code: [Select]
  //case key of
  //VK_OEM_PERIOD:
  //  begin
  //    s:='';
  //
  //    KeyInput.Apply([ssCtrl]);
  //    try
  //      KeyInput.Press(VK_SPACE);
  //    finally
  //      KeyInput.Unapply([ssCtrl]);
  //    end;
  //
  //    if Assigned(FOnLastWordChanged) then
  //    FOnLastWordChanged(s);
  //
  //  end;
  //  VK_OEM_COMMA: KeyInput.Press(VK_SPACE);
  //end;

After that, the app at least builds and runs and debug etc works.

What damage I did getting it this far... :-)   

My instincts is that the Query Designer used to use JEDI MouseAndKeyInput, so perhaps only that is the affected bit...

Hopefully you get this working with the internal linker, and you don't need to do the above hack.
« Last Edit: October 21, 2014, 08:29:55 am by Mike.Cornflake »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #153 on: October 21, 2014, 08:33:20 am »
Yep. Meanwhile, from my end, got latest lazsqlx & compiled with FPC 2.6.4, laz trunk (regular internal linker). Seeing the same animated gif header exception as you.
Running the application stand alone does not give the opengl crash anymore...

Re keycode: seems its trying to replace . with Ctrl-Space - for variable completion I suppose - e.g. in Table.FieldName? Just guessing. May be better solved by setting a flag and testing for that flag in the code completion part (if any)?

For now, I'm going to focus on getting my file import code up to shape so I can provide a patch to flamer0n... and let's see what his opinion is regarding this mouse and keyboard stuff. I'd be happy to work on that next.

Thanks for all the help!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #154 on: October 21, 2014, 09:11:02 am »
What IS this? Have I attracted some bad juju or something?

Debugging my data importer form changes, I get a SIGSEGV stepping through this code:
Code: [Select]
function TDbConnectionInfo.ToZeosConnection
...
   if FDbType = dtOracle then
... fdbtype exists and is dtFirebirdd.
... next run the sigsegv is a couple of lines below that in an equally innocuous piece of code.

Argh!

Why on earth can that code create a SIGSEGV?

I think I'm giving up on this for a while and try and clean up my entire Laz/FPC installs, sacrifice a chicken facing South, and drink some coffee...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: LazSqlX
« Reply #155 on: October 21, 2014, 09:36:09 am »
What IS this? Have I attracted some bad juju or something?

Debugging my data importer form changes, I get a SIGSEGV stepping through this code:
Code: [Select]
function TDbConnectionInfo.ToZeosConnection
...
   if FDbType = dtOracle then
... fdbtype exists and is dtFirebirdd.
... next run the sigsegv is a couple of lines below that in an equally innocuous piece of code.

Argh!

Why on earth can that code create a SIGSEGV?

I think I'm giving up on this for a while and try and clean up my entire Laz/FPC installs, sacrifice a chicken facing South, and drink some coffee...

I'm betting that the external linker (or debug information) is the one to blame try to ignore what ever the IDE shows you and open the call stack window (ctrl+alt+S) and go from there try to find the first line of code inside SQLX application in the stack and see what you can surmise from that.

PS.
You never make any sacrifices facing south, you get the best results facing east or west depending on your religion (Christians prefer east), that might be your problem try again after you have sacrficed something better than a chicken facing east (Christians prefer lambs).

Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #156 on: October 21, 2014, 09:39:24 am »
I'm betting that the external linker (or debug information) is the one to blame
No, I'm not using the external linker. See post above my last one.

try to ignore what ever the IDE shows you and open the call stack window (ctrl+alt+S) and go from there try to find the first line of code inside SQLX application in the stack and see what you can surmise from that.
That shows basically nothing (some line with the infamous question marks).

You never make any sacrifices facing south, you get the best results facing east or west depending on your religion (Christians prefer east), that might be your problem try again after you have sacrficed something better than a chicken facing east (Christians prefer lambs).
Good advice! I'll see what I can do ;)
Edit: how many pigeons equal one lamb?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #157 on: October 21, 2014, 10:13:28 am »
You never make any sacrifices facing south, you get the best results facing east or west depending on your religion (Christians prefer east), that might be your problem try again after you have sacrficed something better than a chicken facing east (Christians prefer lambs).

At uni nothing worked until we'd sacrificed a chicken sandwich.  As I've grown older, I see now this was stupid childish wish fulfillment. 

Widdershins is the real truth!  You need to turn widdershins 4 times, or it's all to naught...  (Or call one of the Elder Programmers over to see why some code doesn't work.  It ALWAYS works when they're around...)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #158 on: October 21, 2014, 10:29:34 am »
Widdershins is the real truth!  You need to turn widdershins 4 times, or it's all to naught...  (Or call one of the Elder Programmers over to see why some code doesn't work.  It ALWAYS works when they're around...)
Mmm. I get seasick, so let's try the other way.
Have set debugger project options to -g -godwarfsets2; could also be -gw2 for dwarf (default is -g, stabs)
Using zeos testing

Attached form .pas & lfm to replace existing; fileimport.pas goes into UtilClasses.

Tried on laz trunk+FPC trunk; now get better working stack trace - perhaps the problem is in Zeos as that is the last line hit.. Pfff.. Would appreciate a look from one of you Elder Programmers, thanks ;)

Edit: Mike caught an error of mine: add
Code: [Select]
  if not(assigned(FDestQuery)) then
    FDestQuery := TZQuery.Create(nil);
  assert(assigned(FDestQuery));
before
Code: [Select]
  FDestQuery.Connection := FConn;
... blush ....

Still crashes though.
« Last Edit: October 21, 2014, 11:49:08 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #159 on: October 21, 2014, 10:36:10 am »
Would appreciate a look from one of you Elder Programmers, thanks ;)

Sorry - we investigated virtualising an Elder Programmer several ways over several years.  Nothing worked consistently.  The Elder Programmer first has to mumble about does he really need to come over, then he actually has to grumble his way over and stare pointedly at you.  And of course, at this point the code works - no matter how badly it was AV'ing prior to the call.

Oddly enough.  You don't always need an Elder Programmer.  Turns out, Gavin will do nicely.  We only had the one Gavin though, so were unsure if the phenomena was specific to him, or Gavin's in general...

Would appreciate a look from one of you Elder Programmers, thanks ;)

What?  Oh that again.  Right, mumbling and grumbling's out of the way now, let's have a look...   I'll get back to you...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #160 on: October 21, 2014, 10:39:21 am »
Hah. Your post worked - just invoking Gavin or The Elder Programmer gave the inspiration:
... Edit: nah, that was Zeos ignorance speaking I think...

Come on over, you grumbling bearded one!
« Last Edit: October 21, 2014, 10:41:00 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: LazSqlX
« Reply #161 on: October 21, 2014, 10:56:37 am »
try to ignore what ever the IDE shows you and open the call stack window (ctrl+alt+S) and go from there try to find the first line of code inside SQLX application in the stack and see what you can surmise from that.
That shows basically nothing (some line with the infamous question marks).

That is the trademark of no debug information which in turn it means that you either did not enable the "create debug information" or that the clean up failed and you are still using non debug units.
when I say the "clean up failed" I do include the chance of double .ppu/.o etc files on different directories and picking up the wrong one when linking.

You never make any sacrifices facing south, you get the best results facing east or west depending on your religion (Christians prefer east), that might be your problem try again after you have sacrficed something better than a chicken facing east (Christians prefer lambs).
Good advice! I'll see what I can do ;)
Edit: how many pigeons equal one lamb?

well if you go by the weight a lamb weights around 80Kg a pigeon weights 200grams or something along those lines add an other 20Kg on the mid weight of the lamb for the innocent difference (lamb being the most innocent aka clean animal) and you have an answer but keep in mind that the innocent difference is just an estimation at this point, I do not know if they will be accepted instead of the lamb and depending on the size of the problem one lamb might not be enough.  :P
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazSqlX
« Reply #162 on: October 21, 2014, 11:47:36 am »
try to ignore what ever the IDE shows you and open the call stack window (ctrl+alt+S) and go from there try to find the first line of code inside SQLX application in the stack and see what you can surmise from that.
That shows basically nothing (some line with the infamous question marks).

That is the trademark of no debug information which in turn it means that you either did not enable the "create debug information" or that the clean up failed and you are still using non debug units.
Or the sigsegv messed up the debug info in memory...

Edit: or an FPC bug that messes up the debug info in case of mixed stabs and dwarf exists (e.g. in a package in Lazarus or LCL). There used to be one, don't know if it's closed already....

Edit2: However, did a clean & build all, set a breakpoint before the crash. Looked at call stack: fine. Continued to crash, looked at call stack
Code: [Select]
#0 ?? at :0
#1 endthreadex at :0
#2 ?? at :0
#3 ?? at :0
#4 ?? at :0
threading related!?!
Edit3: )(*@#$)(*()@*%*@% using FPC 2.6.4+new Firebird embedded dll to connect to remote db=> gives problems because Firebird devs changed code which used to work. Workaround is in trunk but not 2.6.x. Perhaps that's relevant...=> replacing with old Fbembed.dll version 2.5.0 works!!!!!

Thanks guys... on to the next problem
« Last Edit: October 21, 2014, 11:56:02 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: LazSqlX
« Reply #163 on: October 21, 2014, 12:09:27 pm »
Edit3: )(*@#$)(*()@*%*@% using FPC 2.6.4+new Firebird embedded dll to connect to remote db=> gives problems because Firebird devs changed code which used to work. Workaround is in trunk but not 2.6.x. Perhaps that's relevant...=> replacing with old Fbembed.dll version 2.5.0 works!!!!!

@flameron has already provided all the required lib files in LazSQLx\Windows_Libs.  I see fbclient25.dll is in that collection :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: LazSqlX
« Reply #164 on: October 21, 2014, 12:28:27 pm »
Why on earth can that code create a SIGSEGV?

Any first field reference in a method can crash if the instance is not allocated or corrupt. If you typecast any pointer to a class and then run methods on it, chances are the crash behaviour will look like this. This is no different from Delphi btw.

And keep in mind that assigned() is only a test for zero, not general validity.
 

 

TinyPortal © 2005-2018