Recent

Author Topic: SIGSEGV  (Read 3996 times)

Foot

  • Newbie
  • Posts: 3
SIGSEGV
« on: October 26, 2018, 02:33:35 pm »
I am having problems with DBase tables.  When I compile and run

PA.Open; where PA is a DBase table I get "Project 1 raised exception class 'External:SIGSEGV'"

I cannot see where I have gone wrong.  I know the table is ok as I can access it using OpenOffice.Calc

Any observations will be gratefully received.

Foot

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: SIGSEGV
« Reply #1 on: October 26, 2018, 02:38:12 pm »
Can you please post some code?  Without that, we'd be just guessing.
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

Foot

  • Newbie
  • Posts: 3
Re: SIGSEGV
« Reply #2 on: October 26, 2018, 03:08:30 pm »
I did not post code because the error appeared at the initial stage.  Here is all the code.  I have // some of the code in an effort to isolate the cause.

unit uSAIME;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, db, dbf, FileUtil, Forms, Controls, Graphics, Dialogs,
  StdCtrls, DbCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    PA1: TDataSource;
    PA: TDbf;
    YM1: TDataSource;
    YM: TDbf;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private

  public

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  YM.Open;
 // PA.Open;
//  YM.Edit;
//  PA.Edit;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Close;
end;

end.   

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: SIGSEGV
« Reply #3 on: October 26, 2018, 03:52:57 pm »
Posting the code allowed us to see that the components are created at designtime, which helps.  So the objects should definitely be created, which takes my first guess out of the running.

I've not played with TDBF, so from here I'm not going to be that useful.   The following documentation may help
http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial
https://sourceforge.net/projects/tdbf/files/TDbf%20documentation/TDbf%20documentation%201.1/tdbf.pdf/download

UPDATE:  Oh, reading that first link was informative.  Looks like this component is not maintained
Quote
.
New issue (07 July 2018): SIGSEGV error because expression in index.

This issue was taken from the post at the forum: http://forum.lazarus.freepascal.org/index.php/topic,41786.msg290653

"I get a SIGSEGV error when I try to compile this very small program with a TDbf... It took me days before I found what caused the SIGSEGV error. ... Today I found that the problem was in the indexing of the DBF file. It was indexed on UPPER(LASTNAME+FIRSTNAME). After changing the expression to UPPER(LASTNAME)+UPPER(FIRSTNAME), the SIGSEGV error disappeared. I searched the web long and hard, but I didn't find any documentation on this strange behavior. Maybe this is a good candidate for adding to the long list of possible causes for SIGSEGV errors with Lazaru

Was there a reason you chose TDBF?   Maybe other database engines could be used instead?
« Last Edit: October 26, 2018, 04:00:59 pm 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

Foot

  • Newbie
  • Posts: 3
Re: SIGSEGV
« Reply #4 on: October 30, 2018, 01:51:25 pm »
Thank you so much for your help.  The DBs are not indexed, so it is really basic.  I am using DBase because I know it and I suppose I'm lazy.  I think the problem may lie with the databases themselves because they have gone through many steps from the original, exported as csv then imported into Calc and converted into Dbase.  It is a project, a classic problem, of someone using two unconnected databases one financial the other web based,  He wants a code which will compare the two and identify where they disagree.  I think its nearly impossible because the fields are not really compatible.    Is there no way of getting Lazarus to identify the problem other than just giving a SIGSEGV error?

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: SIGSEGV
« Reply #5 on: October 30, 2018, 03:00:27 pm »
UPDATE:  Oh, reading that first link was informative.  Looks like this component is not maintained
Don't blindly believe the wiki. This is again a bogus entry that is superseded by reality: it is maintained....again...
It is even part of the standard distribution and not an alternative...

What I'd like t know is which dbf format OpenOffice uses and if it is actually dBase compatible. The fields do not matter, except for blobs that is easily fixable.
« Last Edit: October 30, 2018, 03:05:02 pm by Thaddy »
Specialize a type, not a var.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: SIGSEGV
« Reply #6 on: October 31, 2018, 03:43:20 pm »
This is again a bogus entry that is superseded by reality
Four years ago I was part of a push to ensure the wiki was up to date and actively maintained.  Am I to infer from your response that this effort has fallen by the wayside?  Feel free to fix the offending page directly, or let me know which sections to edit and I'll do so.

« Last Edit: October 31, 2018, 03:47:37 pm 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

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: SIGSEGV
« Reply #7 on: October 31, 2018, 03:59:04 pm »
This is again a bogus entry that is superseded by reality
Four years ago I was part of a push to ensure the wiki was up to date and actively maintained.  Am I to infer from your response that this effort has fallen by the wayside?  Feel free to fix the offending page directly, or let me know which sections to edit and I'll do so.

No. New entries are usually of high quality, but there is a cow dung load of rabbit balls all over the wiki. In this case the wiki is wrong.
What has fallen is the sell-buy date of *a lot of* entries. Four years is an epoque.

It goes a bit too far to delete all those entries but I am willing to add some red-lining that an entry is only for documentation for historic purposes when I encounter one such as this.
But in this case the entry should be deleted and rewritten to reflect the dBase support comes as standard and is therefor maintained.
« Last Edit: October 31, 2018, 04:07:57 pm by Thaddy »
Specialize a type, not a var.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: SIGSEGV
« Reply #8 on: October 31, 2018, 04:05:57 pm »
Slinging mud like that is not helpful.  I revert to either fix the page yourself, or let me know which bits are out and I will fix.  Anything directed to me won't be fixed quickly though as I'll need to confirm before making changes. (and I've already added the july change to the DBF page which is relevant to this topic to my TODO)
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

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: SIGSEGV
« Reply #9 on: October 31, 2018, 04:09:49 pm »
Slinging mud like that is not helpful.
I am not slinging mud. I am stating facts. Our post crossed but I have added some remarks. Plz read. I will write a new entry based on the 3.0.0 release notes.

http://wiki.freepascal.org/FPC_New_Features_3.0#Units_and_packages <bit grumpy now  >:D >

Why? http://wiki.freepascal.org/User_Changes_2.6.4#TDBF_unit_deprecation_removed
« Last Edit: October 31, 2018, 04:16:50 pm by Thaddy »
Specialize a type, not a var.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: SIGSEGV
« Reply #10 on: October 31, 2018, 04:18:31 pm »
You mistake fact for metaphor.   

I have updated the wiki - a quick look reveals no-one was able to confirm the bug - the reporter didn't share any code or data.
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

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: SIGSEGV
« Reply #11 on: October 31, 2018, 04:29:19 pm »
Oh, you changed the meaning of the word? is that in expectation of Brexit? Frustrating the continent by having a new language?  O:-) >:(

Anyway. He provided code (look below). But not how you and me would submit it, like working or crashing... Anyway.. 8-) O:-)
I'll have a look at the wiki... :D
[edit]
Yup. The source here: http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial is not updated and your entry is not accessible because it redirects to .io, which I block.
« Last Edit: October 31, 2018, 04:37:12 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018