I'm using Qt. Is this something I can fix myself? I can't seem to recreate it in a small example. I googled vfprintf-internal.c and it came up with glibc, so I installed that, but it made no difference. I ran all of the commands in PureBasic's INSTALL file to make sure I hadn't missed anything, but everything's installed as far as I can see.Thread 1 "Main" received signal SIGSEGV, Segmentation fault.
0x00007ffff5a75048 in __vfprintf_internal (s=s@entry=0x7fffff7ff270, format=format@entry=0x2473600 "%d:%lld:%lld", ap=ap@entry=0x7fffff7ff3f0, mode_flags=mode_flags@entry=0) at ./stdio-common/vfprintf-internal.c:1180
1180 ./stdio-common/vfprintf-internal.c: No such file or directory.
Crash on Linux
Crash on Linux
Code that works fine on macOS and Windows crashes on Linux without even showing a PB debugger error. I used GDB to try and debug it and it gives me this error:
Re: Crash on Linux
Does ldd, against your executable, show a missing library?
Re: Crash on Linux
Thanks for replying. No, it's not showing any as not found.
Re: Crash on Linux
Segmentation faults happens only if you are working with pointers or using / not using Free..().
Unfortunately without something to reproduice the fault is very difficult to find something.
Have you tried to run it in the ide with Purifier ON and
This should show you the point of failure.
Unfortunately without something to reproduice the fault is very difficult to find something.
Have you tried to run it in the ide with Purifier ON and
Code: Select all
PurifierGranularity(1, 1, 1, 1)

This should show you the point of failure.
Re: Crash on Linux
Unfortunately, the Purifier didn't catch it, but I did figure it out. I had, for some reason, been updating scrollbars in a procedure that draws on a canvas. It seems Qt doesn't like that. Thanks for your suggestions. 

Re: Crash on Linux
I have same issue in Ubuntu Linux 22.04. Anything I try to compile under Linux ends with
Even simple basic hello-world example ends with that. I don't get the point what is broken.
I am using older version 5.31 on my workstation with Ubuntu Linux 22.04 LTS. No idea why it's happening.
LDD and other stuff, useable by other programming languages, doesn't help.
In addition this linker error is absolutelly not understandable for me.
To avoid this linker error, I found that following code will mitigate it, but it makes no sense to me. Code will be compiled, but result will stay the same.
( I mean "Segmentation fault (core dumped)" )
Any advice will help. I like PureBasic, but this is strange.
Code: Select all
Segmentation fault (core dumped)
I am using older version 5.31 on my workstation with Ubuntu Linux 22.04 LTS. No idea why it's happening.
LDD and other stuff, useable by other programming languages, doesn't help.
Code: Select all
PureBasic 5.31 (Linux - x64) - (c) 2014 Fantaisie Software
A filename must be specified.
pbcompiler -h for help.
Code: Select all
******************************************
PureBasic 5.31 (Linux - x64)
******************************************
Loading external modules...
Starting compilation...
Starting compilation...
7 lines processed.
Creating the executable.
Error: Linker
/usr/bin/ld: purebasic.o: warning: relocation in read-only section `.text'
/usr/bin/ld: purebasic.o: relocation R_X86_64_PC32 against symbol `exit@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
( I mean "Segmentation fault (core dumped)" )
Code: Select all
Import "-no-pie"
EndImport
Re: Crash on Linux
Please use the lastest version to see if it still happens
Re: Crash on Linux
With PureBasic v.6.04 it's all running smoothly. However, reason for v.5.31 is that I need to compile source file written in v.5.31 which is giving many errors by trying to compile it with v.6.04 compiler.
I got idea to try it inside virtualized environment with older Ubuntu Linux release corresponding the time when v.5.31 was released, maybe that will help.
Or some another idea ?
I got idea to try it inside virtualized environment with older Ubuntu Linux release corresponding the time when v.5.31 was released, maybe that will help.
Or some another idea ?
Re: Crash on Linux
Which errors the. Perhaps there are not so many
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Crash on Linux
I need to fix:
1, fix the old version of SHA1Fingerprint - this is done
2, remove the ascii requirement on compile and fix the unicode string
3, compile as true linux console application without the debugger
4, fix code bellow which causes problem with "InternetOpen_() is not a function, array, list, map or macro"
I am doing everything in shell command line, I don't have graphical user interface, just text shell console.
So I am compiling everything via pbcompiler command with input parameters like
To solve point 1 was easy. Point 2 and 3 are unknown how to achieve it in Linux in command line just using pbcompiler and his command line parameters. I think I need to add/remove something inside that old source code from v.5.31 to achieve true Linux console application and no ascii requirement. Point 4 is releated to find replacement for Windows function and implement same functionality under Linux.
I will really appreciate advice from more experienced users.
1, fix the old version of SHA1Fingerprint - this is done
2, remove the ascii requirement on compile and fix the unicode string
3, compile as true linux console application without the debugger
4, fix code bellow which causes problem with "InternetOpen_() is not a function, array, list, map or macro"
Code: Select all
If proxy = "" : access_type = #INTERNET_OPEN_TYPE_DIRECT : Else : access_type = #INTERNET_OPEN_TYPE_PROXY : EndIf
If user_agent = "" : user_agent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" : EndIf
open_handle = InternetOpen_(user_agent, access_type, "", "", 0)
InternetSetOption_(open_handle, 2, timeout, 4)
I am doing everything in shell command line, I don't have graphical user interface, just text shell console.
So I am compiling everything via pbcompiler command with input parameters like
Code: Select all
pbcompiler -e hello-world hello-world.pb
I will really appreciate advice from more experienced users.
Re: Crash on Linux
You can't use old PB version on new linux distro because the binaries are not built for it.
Re: Crash on Linux
Yes I agree, I have to run it on Linux from the time when it was released.
Thanks God we have virtualization.
I will try it on older Linux, but the point 4 is still questionable, how to get the same functionality.
Thanks God we have virtualization.
I will try it on older Linux, but the point 4 is still questionable, how to get the same functionality.
Re: Crash on Linux
Simply use the PB inbuild functions instead of this API stuff.
HTTPRequest ...
HTTPRequest ...