Author Topic: "/builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/fpcsrc/rtl/inc/system.inc  (Read 961 times)

lazer

  • Sr. Member
  • ****
  • Posts: 269
Hi,

I'm having trouble with the debugger when following a segfault exception.

The IDE tries to open some rtl files to show the point of execution

Code: Pascal  [Select][+][-]
  1. The file "/builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/fpcsrc/rtl/inc/system.inc" was not found.
  2. Do you want to locate it yourself?

This is like some AI hallucination with seven fingers.

If I locate the file, it steps to it and then I step the code and next time it needs to open a file we are back to "/builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/fpcsrc/rtl/inc/.*"  BS.

Obviously there is no /builddir on this system and the every segment of that path is total BS.

The files it is looking for are in /use/share.

Does anyone know what is going on here or how it fabricates that insane path?

TIA.


Thausand

  • Hero Member
  • *****
  • Posts: 600
Does anyone know what is going on here or how it fabricates that insane path?
This look have path use for create for special build fpc when use release engineer (https://wiki.lazarus.freepascal.org/Release_engineering). Is special repository https://gitlab.com/freepascal.org/fpc/build:
Quote
Project information

The build environment for FPC releases: the scripts and auxiliary binaries used to create releases.
This have have special release for engineer (and have special use instruction).

Then make conclude you have fpcbuild or when past have use fpcbuild (and now have leftover). That give problem.

I have read you complain before this issue and have problem but (please say when wrong) afaik all time you have no answer what and how installed/configure lazarus/fpc (and also not know platform but have gamble is Linux ?). Have you multiple installation FPC or Lazarus and have use good configuration ?

Not know this information is problem with help solve. But may you have write and I not see this information ?
A docile goblin always follow HERMES.md

lazer

  • Sr. Member
  • ****
  • Posts: 269
You are probably right that this is some cruft remaining on the system.
A year or so back I was compiling both fpc and Laz from source. (IIRC the distro was too old or there was some bug I wanted to fix. )

I no longer have need for that and prefer to use stock distro installations where possible.

Earlier I discovered an old ~/.fpcfg  and deleted it but this problem remains.

How can I find where this garbage is coming from ?

Yes, I'm running Fedora 42.  No mulitple installation of fpc but there may be some garbage left somewhere which I am missing.

« Last Edit: September 04, 2025, 01:17:01 pm by lazer »

suve

  • New member
  • *
  • Posts: 7
Are you on Fedora Linux? This looks like a path used when building packages in mock/koji.

lazer

  • Sr. Member
  • ****
  • Posts: 269
Are you on Fedora Linux? This looks like a path used when building packages in mock/koji.

Thanks,  good catch. Indeed Fed42.

I seem to recall something in my repo list was referencing a mock build, cant' recall what it was. Hang on :
Code: Pascal  [Select][+][-]
  1. #dnf repolist
  2. repo id                                                       repo name                                                                  
  3. copr:copr.fedorainfracloud.org:bpostle:IfcOpenShell           Copr repo for IfcOpenShell owned by bpostle                                
  4. fedora                                                        Fedora 42 - x86_64                                                          
  5. fedora-cisco-openh264                                         Fedora 42 openh264 (From Cisco) - x86_64                                    
  6. rpmfusion-free                                                RPM Fusion for Fedora 42 - Free                                            
  7. rpmfusion-free-updates                                        RPM Fusion for Fedora 42 - Free - Updates                                  
  8. rpmfusion-nonfree                                             RPM Fusion for Fedora 42 - Nonfree                                          
  9. rpmfusion-nonfree-updates                                     RPM Fusion for Fedora 42 - Nonfree - Updates                    
« Last Edit: September 04, 2025, 10:21:06 pm by lazer »

suve

  • New member
  • *
  • Posts: 7
Thanks,  good catch. Indeed Fed42.
Then it's behaving as expected. Since you're using a system-provided compiler, the debuginfo refers to files installed on the builder when the package was originally built, not to what's currently installed on your machine.

Running dnf debuginfo-install fpc should help (at least when using gdb).

lazer

  • Sr. Member
  • ****
  • Posts: 269
Thanks,  I still don't seem to have a "builddir" anywhere.


Code: Pascal  [Select][+][-]
  1. [1/2] fpc-debugsource-0:3.2.2-18.fc42.x86_64                                                      100% | 975.5 KiB/s |   3.8 MiB |  00m04s
  2. [2/2] fpc-debuginfo-0:3.2.2-18.fc42.x86_64                                                        100% |   2.0 MiB/s |  25.7 MiB |  00m13s
  3. ------------------------------------------------------------------------------------------------------------------------------------------
  4. [2/2] Total                                                                                       100% |   2.3 MiB/s |  29.6 MiB |  00m13s
  5. Running transaction
  6. [1/4] Verify package files                                                                        100% |  11.0   B/s |   2.0   B |  00m00s
  7. [2/4] Prepare transaction                                                                         100% |   5.0   B/s |   2.0   B |  00m00s
  8. [3/4] Installing fpc-debugsource-0:3.2.2-18.fc42.x86_64                                           100% | 138.3 MiB/s |  26.6 MiB |  00m00s
  9. [4/4] Installing fpc-debuginfo-0:3.2.2-18.fc42.x86_64                                             100% | 137.5 MiB/s | 167.5 MiB |  00m01s
  10. Complete!
  11.  
  12.  
  13. bash-5.2#find / -name builddir
  14. bash-5.2#
  15.  
  16.  

So  is this the result of Fedora using compiler farms to build packages? 
Do I need to go back to building fpc locally ?
« Last Edit: September 04, 2025, 10:46:57 pm by lazer »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12644
  • Debugger - SynEdit - and more
    • wiki
Then it's behaving as expected. Since you're using a system-provided compiler, the debuginfo refers to files installed on the builder when the package was originally built, not to what's currently installed on your machine.

Indeed. If you download files (that were compiled with FPC) wich have debug info in them, then the debug info contains the full path of the sources were they were on the system of the person (or tool) that did this build.

So the packages were build on some system that had this folder. The compiler added the full path, the IDE sees that, and gets confused....



Trying gdb may or may not help, because it may (or may not) expose a different "part" of the debug info.

I.e. the debug info stores the full path, but usually in 2 parts (something internal).  And depending on how/if those splitted parts are returned in full or not, results may vary.... Though, not sure it will help.



You could also try in
Tools > Options > Debugger > General: "Additional search path" to add the path of your sources.

Mind you for  "/builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/fpcsrc/rtl/inc/system.inc"
you may have to either give the path to
  /your/fpcsrc
  /your/fpcsrc/rtl

But most likely NOT the inc.

IIRC, there is actually an issue in the current IDE, that it has problems finding "*.inc" files, if they are in sub-dirs (or something like this, I have not yet had time to figure out the details / afaik something in codetools or packager / or directory cache ... in anyway outside my usual comfort zone).

This may also be why the incorrect debug info of prebuild LCL don't always cause the same issue, even though they too may have wrong pathes. But then the IDE should see the partial path, and find that, relative to its installation.... Only it doesn't do that with the fpc sources (or some of them).... I have seen it happen too, but as I said, not yet had the time to fully dig through it.

lazer

  • Sr. Member
  • ****
  • Posts: 269
OK, that makes a lot more sense now.

could I hack this by making the oddball path in this system and then sym-linking it to /usr/share?
Code: Pascal  [Select][+][-]
  1.  
  2. bash-5.2#mkdir -p /builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/
  3. bash-5.2#cd !$
  4. bash-5.2#pwd
  5. /builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2
  6.  
  7. bash-5.2#ln -s  /usr/share/fpcsrc fpcsrc
  8. bash-5.2#ls /builddir/build/BUILD/fpc-3.2.2-build/fpcbuild-3.2.2/fpcsrc/rtl/inc
  9. aliases.inc   currh.inc    exeinfo.pp    fpintres.pp  heaptrc.pp    macpas.pp     readme        stringsi.inc  threadvr.inc  uuchar.pp
  10. astrings.inc  dosh.inc     extpas.pp     gencurr.inc  innr.inc      makefile.inc  real2str.inc  strings.pp    tinyheap.inc  varerror.inc
  11. blockrtl.pp   dos.inc      extres.inc    generic.inc  int64.inc     mathh.inc     resh.inc      sysres.inc    tnyheaph.inc  varianth.inc
  12. cgeneric.inc  dynarrh.inc  fexpand.inc   genmath.inc  intres.inc    objc1.inc     rttidecl.inc  system.fpd    typefile.inc  variant.inc
  13. cgenmath.inc  dynarr.inc   file.inc      genset.inc   iso7185.pp    objcbase.pp   rttih.inc     systemh.inc   typshrdh.inc  wstringh.inc
  14. cgenstr.inc   dynlibh.inc  filerec.inc   genstr.inc   isotmp.inc    objcnf.inc    rtti.inc      system.inc    typshrd.inc   wstrings.inc
  15. charset.pp    dynlib.inc   flt_conv.inc  genstrs.inc  lineinfo.pp   objc.pp       sfpu128.pp    text.inc      ufloat128.pp
  16. cmem.pp       dynlibs.pas  flt_core.inc  getopts.pp   llvmintr.inc  objpash.inc   sfpux80.pp    textrec.inc   ufloatx80.pp
  17. compproc.inc  excepth.inc  flt_pack.inc  heaph.inc    lnfodwrf.pp   objpas.inc    softfpu.pp    threadh.inc   ustringh.inc
  18. ctypes.pp     except.inc   fpextres.pp   heap.inc     lstrings.pp   pagemem.pp    sstrings.inc  thread.inc    ustrings.inc
  19.  
« Last Edit: September 04, 2025, 10:59:55 pm by lazer »

 

TinyPortal © 2005-2018