Recent

Author Topic: [Problem solved] Wish: stop the race after Delphi  (Read 16281 times)

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
[Problem solved] Wish: stop the race after Delphi
« on: December 27, 2020, 12:30:47 pm »
I would like that freepascal + lazarus to go to pit stop for a while and solve all the problems the compiler and lcl components have.

I get occasional program crashes under Linux, no matter which pascal version, with both gtk2 and qt5, and just using the standard lazarus components, no custom components, no dynamic memory allocations, etc. So random crashes are a common thing. At compilation time I get warnings only about UnicodeString to AnsiString conversions.

I chose lazarus for the amazing user interface and freepascal for the ability to work with strings in a more natural manner compared with C. I'll look for another tool...

Edit: memory leaks proved to be my fault!
« Last Edit: February 27, 2021, 02:40:02 pm by funlw65 »
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

PascalDragon

  • Hero Member
  • *****
  • Posts: 5469
  • Compiler Developer
Re: Wish: stop the race after Delphi
« Reply #1 on: December 27, 2020, 12:56:28 pm »
At compilation time I get warnings only about UnicodeString to AnsiString conversions.

If you get warnings about UnicodeString <-> AnsiString conversions, then you should check your code, cause these warnings are there for a reason.

Also we're not racing after Delphi, we're racing after bug reports we have and these might include requests for features that derive from Delphi.

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Wish: stop the race after Delphi
« Reply #2 on: December 27, 2020, 01:03:58 pm »
Well these come from using units like DOM, XMLRead and code like this one:

Code: Pascal  [Select][+][-]
  1. v_cb_sampling_idx_uart5 := strtoint(PassNode.FirstChild.NodeValue);

Not my code...
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

MarkMLl

  • Hero Member
  • *****
  • Posts: 6683
Re: Wish: stop the race after Delphi
« Reply #3 on: December 27, 2020, 01:14:40 pm »
I would like that freepascal + lazarus to go to pit stop for a while and solve all the problems the compiler and lcl components have.

I get occasional program crashes under Linux, no matter which pascal version, with both gtk2 and qt5, and just using the standard lazarus components, no custom components, no dynamic memory allocations, etc. So random crashes are a common thing. At compilation time I get warnings only about UnicodeString to AnsiString conversions.

I echo your sentiment but my experience is that crashes are generally the result of something in my code rather than in the LCL etc.

I've got a lot of tricky legacy stuff which is heavily multithreaded, and not only is that sort of thing notoriously difficult to get right but it's very easy to write assuming certain things about e.g. a particular version of Delphi which no longer hold at some point in the future.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: Wish: stop the race after Delphi
« Reply #4 on: December 27, 2020, 01:17:40 pm »
I get occasional program crashes under Linux, no matter which pascal version, with both gtk2 and qt5 ...

I don't use Qt5 interface. But I've been using Lazarus on Ubuntu for more than 10 years. I do not write corporate class software, I just write simple games and tools. They just work correctly, no crash. Well actually, they crashed several times. But after some inspections, those were my own faults.

Lazarus and Free Pascal are not as bad as you thought. If you have issue with it, post it here. Tell us what are the steps to make it crash and don't forget to provide the compile-able source code. We will help you fix it. If you are not willing to publicize your project, you can write a demo that show the problem.

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Wish: stop the race after Delphi
« Reply #5 on: December 27, 2020, 01:23:58 pm »
I get occasional program crashes under Linux, no matter which pascal version, with both gtk2 and qt5 ...

I don't use Qt5 interface. But I've been using Lazarus on Ubuntu for more than 10 years. I do not write corporate class software, I just write simple games and tools. They just work correctly, no crash. Well actually, they crashed several times. But after some inspections, those were my own faults.

Lazarus and Free Pascal are not as bad as you thought. If you have issue with it, post it here. Tell us what are the steps to make it crash and don't forget to provide the compile-able source code. We will help you fix it. If you are not willing to publicize your project, you can write a demo that show the problem.

Ok, I understand and I am ready to accept that the error might be my fault. Even if the code is incredibly simple, just pressing buttons, completing fields, generating text files based on the configuration the user makes. The crashes are random, no mater where I am in the program. Sometimes, just moving the mouse over a button.

I will commit the last version of the code on gitlab (is an open source project) and I will post the link.
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Wish: stop the race after Delphi
« Reply #6 on: December 27, 2020, 01:44:14 pm »
Code committed here:  https://gitlab.com/funlw65/vscode_nucleo_l152re
but the repository contains also all the tools and tutorials required for an user  so is huge.

So I archived only the application and uploaded on my google drive
https://drive.google.com/file/d/1jm1bdS9pwVWy6TOg1gnsMJqnuEI7yEPD/view?usp=sharing

The application is a visual tool for configuring the clock frequency, the pins and the peripherals of an STM32L152 microcontroller and then generates the C source code for the gcc arm compiler and the project files required for the Visual Studio Code and the Cortex Debugger.
« Last Edit: January 02, 2021, 05:22:28 pm by funlw65 »
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: Wish: stop the race after Delphi
« Reply #7 on: December 27, 2020, 02:00:29 pm »
I saw you set it to use Qt and Athlon, which does not match my system so I changed it to Intel Linux GTK2. Compiling succeeded, now running it.

I am going to take a bath, relax and watch TV. Will be back 1 hour later. Lets see will it crash or not.

Below is the screenshot running on Ubuntu Mate 20.04 Lazarus 2.0.10 GTK2.
« Last Edit: December 27, 2020, 02:02:05 pm by Handoko »

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Wish: stop the race after Delphi
« Reply #8 on: December 27, 2020, 02:06:06 pm »
It worked for me in gtk2 without crashes after moving to lazarus 2.x ... But the reason moving to qt5 is that gtk2 is obsoleted in some versions of linux and don't know if it will be compiled in next distro versions (whatever linux that might be). I am on Debian 10.x but I worked also in Void, Fedora, Mint.
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Wish: stop the race after Delphi
« Reply #9 on: December 27, 2020, 02:11:49 pm »
If you get "random crashes", try running under  (compile with -gv)
Code: Text  [Select][+][-]
  1. valgrind --tool=memcheck

The report will contain some noise (depending on gtk version), but it may yield something useful.

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: Wish: stop the race after Delphi
« Reply #10 on: December 27, 2020, 02:12:45 pm »
According to this wiki, Qt is okay but some features are partial implemented:
https://wiki.lazarus.freepascal.org/Roadmap

Because I don't use Qt, so I will let others to comment.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Wish: stop the race after Delphi
« Reply #11 on: December 27, 2020, 02:19:11 pm »
I can say that any app can crash also with kotlin that's in my opinion a more modern language oriented to be simple to type and avoid errors.

I get crashes as well with any language so is the faulty code and not the language.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Wish: stop the race after Delphi
« Reply #12 on: December 27, 2020, 02:23:14 pm »
With faulty code I say your code and as well the libraries. So any included library can be the reason too as well third party stuff.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Wish: stop the race after Delphi
« Reply #13 on: December 27, 2020, 02:48:27 pm »
So I archived only the application and uploaded on my google drive
https://drive.google.com/file/d/1ahhRN3RnQY4Aj-n70olH4E0-3xpxQhJc/view?usp=sharing
How to download the .zip file into my computer. It only offers a "ZIP Extractor" working in Google Drive. Can't you just upload it here?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: Wish: stop the race after Delphi
« Reply #14 on: December 27, 2020, 03:17:36 pm »
This is the zip version. I removed the binary because the size is 8 MB.

 

TinyPortal © 2005-2018