Segmentation Fault on nearly EVERYTHING in Mint

Archives Forums/Linux Discussion/Segmentation Fault on nearly EVERYTHING in Mint

Tricky(Posted 2013) [#1]
Let's put it like this... MaxIDE works, and that's about it.

When I try to rebuild the documentation this is the result:
Rebuilding documentation...
Segmentation fault
Building: BlitzMax Help
Error writing to stream
Process complete


Maybe something wrong with the module builder so let's re-compile that....
Result:
Compiling:docnode.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
3 passes, 7507 bytes.
Compiling:parse.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
3 passes, 5485 bytes.
Compiling:bbdoc.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
4 passes, 17262 bytes.
Compiling:docstyle.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
4 passes, 22872 bytes.
Compiling:fredborgstyle.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
3 passes, 15992 bytes.
Compiling:makedocs.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
4 passes, 26969 bytes.
Linking:makedocs
Segmentation fault


Then this program
Print "Hello World"


Results into
Compiling:HelloWorld.bmx
flat assembler  version 1.68  (32768 kilobytes memory)
3 passes, 2886 bytes.
Linking:HelloWorld
Segmentation fault



This happens in all settings... Debug or release, threaded or unthreaded, GUI or console, it all results into this. Oddly enough it USED to work and especially the fact that MakeDocs can't be compiled (I didn't modify the source code AT ALL), makes things odd....

Any ideas what I can do to stop this?




==== Supplement ====
I tried to run bmk with 'sudo' for "Hello World" to see what would happen....
[sudo] password for rachel: 
Linking:HelloWorld
/usr/bin/ld: /home/rachel/Apps/BlitzMax/mod/pub.mod/openal.mod/openal.debug.linux.x86.a(openal.c.debug.linux.x86.o): undefined reference to symbol 'dlopen@@...'
/usr/bin/ld: note: 'dlopen@@...' is defined in DSO /lib/i386-linux-gnu/libdl.so.2 so try adding it to the linker command line
/lib/i386-linux-gnu/libdl.so.2: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
Build Error: Failed to link


Riiiiiiiight


*(Posted 2013) [#2]
Add
Import "-ldl"

to the top of your program does it help?


dawlane(Posted 2013) [#3]
@Tricky: From what your posting sound like EdzUp[GD] is right. Rebuilding the modules wouldn't show this problem until you tried to run something. I always try and build one or two of the samples in debug mode first. If it works the all is well. But you should be aware that previous applications may need to rebuilt as well as a result of this.

@EdzUp[GD]
The best place to add Import "-ldl" is in BlitzMax/brl/appstub.mod/appstub.bmx, BlitzMax/brl/threads.mod/threads.bmx.
It got to the point I was sick of patching BlitzMax manually so I wrote a script to do the job for me here http://www.blitzbasic.com/Community/post.php?topic=100580&post=1191226.
It's near the bottom of the first post and should be run on a freshly unaltered BlitzMax extraction.


Tricky(Posted 2013) [#4]
Import "-ldl" was present, actually in a project I tried with the same problems, but for my "Hello World" it could indeed be the problem.

I could solve the problem by using the Mint script somewhere on this forum (the up to date one) and running everything with "sudo"...

Now I had the problem in a project that I was already halfway up on Mac. Well, on Mac it runs as perfectly as a half-complete project could run, and in Windows the same deal, but on Linux WaitKey() rather works as "Wait Forever", and KeyHit needed several keys to be held down in succession in order to make them registered. MouseHit() too by the way (I didn't have joypad, so I could try JoyHit).Does anyone have similar experiences?

I don't have Linux at my disposal until thursday (when I can borrow a screen for my MintBox), or I could try to set up some code to track the problem.


dawlane(Posted 2013) [#5]
and running everything with "sudo"...
Why would you need to run everything as sudo. Using sudo should only be used to do administrative tasks. e.g. installation of packages, user/group management. It is not meant to be used for running programs as such running program would have elevated privileges and could do all sorts of damage if it should crash or change something unexpectedly.


Tricky(Posted 2013) [#6]
Without sudo NOTHING compiles except the modules, even the documentation doesn't build without sudo, and with sudo it works...
Hey I didn't invent Linux, if I did it would be a lot user-friendlier....


dawlane(Posted 2013) [#7]
@Tricky: Are you still running BlitzMax of a usb memory stick? As that's the only thing I can think of where you would have to use sudo to run any thing.
If you still are have a look at this http://www.blitzbasic.com/Community/posts.php?topic=100593.
If your running it from your home directory. Use
chown -R user_name BlitzMax
on the directory it's self. The other two commands that are useful are chmod,chgrp. You most likely have to run chown,chgrp commands as sudo to take control, but once you have ownership chmod is a easy.
To read about these commands ( or any of them ); in a terminal type
man chown
When the manual page opens, use the arrow keys to move about and q to quit. There's also a gui version called xman and all you need to do with this it type just xman; press the Manual Page button and use the Sections tab to browse by command type or use the options tab and use search.

Hey I didn't invent Linux, if I did it would be a lot user-friendlier....
Neither did I. The Linux bit ( the kernel ) was originally create by Linus Torvalds as at the time Unix ( which is what Linux is a clone of ) was expensive and he needed a free alternative. And as Unix was used in universities and government departments. It was mostly computer scientist who wrote it and used it.
I've been using Linux since RedHat 5.2 ( about 13-14 years ago ) was out and even I have a hard time keeping up with whats going on. And let me say in those days it was a lot hard to get thing working.


skidracer(Posted 2013) [#8]

/home/rachel/Apps/BlitzMax




I have no idea what the Apps folder is but it sounds like you should install BlitzMax directly in the home folder where you shouldn't need sudo.

Also, you did not specify exactly what you did to unpack the original .tar.gz archive.


Tricky(Posted 2013) [#9]
To go into the deep of a few things:

Are you still running BlitzMax of a usb memory stick? As that's the only thing I can think of where you would have to use sudo to run any thing.

I am running both the MacOS and Windows versions of BMax on a USB portable harddrive (FAT32 formatted) and both accept that just fine. The linux version is on my home drive. (as from my portable harddrive it doesn't work at all as I cannot put the 'executable' bit on files on a device like that)


Also, you did not specify exactly what you did to unpack the original .tar.gz archive.

Unpacked it with the GUI based archive utility that comes with Linux.

I have no idea what the Apps folder is

I created the 'Apps' folder myself, to keep my home folder clean and not completely swamped with all kinds of subfolders.


And let me say in those days it was a lot hard to get thing working.

Yeah, a lot has been improved on user-friendlyness, but Linux still has a far way to go. That much is clear.

Oh yeah, I'll try out the 'chown' business, to see if that will free me from using Sudo all the time.


*(Posted 2013) [#10]
Try running it in a window, on my Linux laptop if I run it full screen it causes problems but it works fine in a window