Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Problem Launching stable IDE on OpenBSD 4.8-stable
icon5.gif  Problem Launching stable IDE on OpenBSD 4.8-stable [message #32071] Wed, 20 April 2011 05:39 Go to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
I've just spent the afternoon getting the IDE building on an installation of OpenBSD4.8 (freshly updated to -stable). But when I launch the IDE, all I get is a message dialog saying "Invalid Memory Access".

I had to tweak the uppsrc/Makefile to account for many of my headers and libraries being under /usr/local/include, /usr/local/lib. Only some of the libs & headers on my system are under /usr/include & /usr/lib that the makefile assumes everything is under. These folder choices were made by the default behavior of the OpenBSD package system.

Has anyone else had similar problems?

Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32072 is a reply to message #32071] Wed, 20 April 2011 08:35 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Col. Builder,
Welcome to the forum Smile

Col. Builder wrote on Wed, 20 April 2011 05:39

I had to tweak the uppsrc/Makefile to account for many of my headers and libraries being under /usr/local/include, /usr/local/lib.

I guess I can add those folders to the Makefile defaults to be more OpenBSD friendly...

As for the invalid memory access, it is hard to tell... Could you try to run it in debugger and post a backtrace when the error happens? (You might need to recompile theide with -g in CFLAGS and tweak the ar invocation in AR variable to get executable with debugging symbols...).

Also you could try to compile some simpler apps from examples/tutorial/reference directory, to see how deep the problem lays. E.g. wc (this one uses Core only) and Days (just basic GUI), both are in examples directory.

Meanwhile, I'll try to install OpenBSD in virtual machine to see if I can reproduce the problem...

Best regards,
Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32075 is a reply to message #32072] Wed, 20 April 2011 10:14 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
You may have a look here:
http://www.ultimatepp.org/forum/index.php?t=msg&goto=767 2&&srch=openbsd#msg_7672

I got to run TheIDE a long time ago under OpenBSD, but finally, I managed to get it running. I will try to recompile latest version ASAP.

If you intend to write multi-threaded programs, you should check if the shipped compiler (C++ libs) is now supporting thread local storage since U++ library heavily makes use of it.

Matthias
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32085 is a reply to message #32072] Wed, 20 April 2011 23:01 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
dolik.rce wrote on Tue, 19 April 2011 23:35

Hi Col. Builder,
Welcome to the forum Smile

Col. Builder wrote on Wed, 20 April 2011 05:39

I had to tweak the uppsrc/Makefile to account for many of my headers and libraries being under /usr/local/include, /usr/local/lib.

I guess I can add those folders to the Makefile defaults to be more OpenBSD friendly...

As for the invalid memory access, it is hard to tell... Could you try to run it in debugger and post a backtrace when the error happens? (You might need to recompile theide with -g in CFLAGS and tweak the ar invocation in AR variable to get executable with debugging symbols...).

Also you could try to compile some simpler apps from examples/tutorial/reference directory, to see how deep the problem lays. E.g. wc (this one uses Core only) and Days (just basic GUI), both are in examples directory.

Meanwhile, I'll try to install OpenBSD in virtual machine to see if I can reproduce the problem...

Best regards,
Honza

Thanks for the welcome!

Here are the relevant lines of the makefile that I tweaked:
UPPOUT = _out/

CINC = \
	-I./ \
	-I/usr/local/include/freetype2 \
	-I/usr/local/include/gtk-2.0 \
	-I/usr/local/include/glib-2.0 \
	-I/usr/local/lib/glib-2.0/include \
	-I/usr/local/lib/gtk-2.0/include \
	-I/usr/local/include/cairo \
	-I/usr/local/include/pango-1.0 \
	-I/usr/local/include/atk-1.0 \
	-I/usr/local/include/gdk-pixbuf-2.0 \
	-I/usr/local/include/gtk-2.0/gdk-pixbuf \
	-I/usr/local/include/libpng \
	\
	-I/usr/include/freetype2 \
	-I/usr/include/gtk-2.0 \
	-I/usr/include/glib-2.0 \
	-I/usr/lib/glib-2.0/include \
	-I/usr/lib/gtk-2.0/include \
	-I/usr/include/cairo \
	-I/usr/include/pango-1.0 \
	-I/usr/include/atk-1.0 \
	-I/usr/include/gdk-pixbuf-2.0 \
	-I/usr/include/gtk-2.0/gdk-pixbuf \
	-I/usr/include/libpng \
	\
	-I/usr/X11R6/include \
	-I/usr/X11R6/include/freetype2 \
	-I/usr/X11R6/include/gtk-2.0 \
	-I/usr/X11R6/include/glib-2.0 \
	-I/usr/X11R6/lib/glib-2.0/include \
	-I/usr/X11R6/lib/gtk-2.0/include \
	-I/usr/X11R6/include/cairo \
	-I/usr/X11R6/include/pango-1.0 \
	-I/usr/X11R6/include/atk-1.0 \
	\
	-I/usr/local/include \
	-I/usr/include

#Macro =  -DflagGUI -DflagGCC -DflagSHARED -DflagLINUX   -DflagPOSIX
Macro  =  -DflagGUI -DflagGCC -DflagSHARED -DflagOPENBSD -DflagPOSIX
CC = c++
LINKER = $(CC)
CFLAGS = -O3 -ffunction-sections -fdata-sections 
CXXFLAGS = -O3 -ffunction-sections -fdata-sections 
LDFLAGS = -Wl,--gc-sections $(LINKOPTIONS)
#LIBPATH = -L"/usr/X11R6/lib" -L"/usr/lib"
LIBPATH = -L"/usr/X11R6/lib" -L"/usr/lib" -L"/usr/local/lib"
I don't know if the changes to Macro are needed, but they seemed appropriate since I'm not running linux.

I'm not overly familiar with gdb/command-line-debugging, my experience comes from a long history ('89 to present) of IDE usage, mostly on Macs (Borland/Turbo C++, CodeWarrior, and a little bit of XCode). I might need a little bit to get up to speed on gdb. Hopefully I can get U++'s IDE up and running quickly on my system and I won't need to spend huge amounts of time on mastering the command-line before I can start doing some useful stuff. Smile

Anyway, I'll try to get a backtrace of the error. If I need to change the AR options, then I'll have to read up on that. So it might be a day or two before I can get back with one.

I'll also try building those other example projects you mentioned to see what gives.

(edited code section above to include changes to LIBPATH)

[Updated on: Wed, 20 April 2011 23:07]

Report message to a moderator

Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32086 is a reply to message #32085] Thu, 21 April 2011 07:36 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Oh, I see, you are using the "release makefile" for theide (there is also one called "universal makefile", which compiles any package). The changes you did seem to be correct. I think you are just missing one more flag, BSD. The Macro variable should be something like
Macro  =  -DflagGUI -DflagGCC -DflagSHARED -DflagBSD -DflagOPENBSD -DflagPOSIX

Hopefully this will result into correctly compiled theide, so you will not need to use the debugger Wink

Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32094 is a reply to message #32086] Thu, 21 April 2011 23:19 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
dolik.rce wrote on Wed, 20 April 2011 22:36

Oh, I see, you are using the "release makefile" for theide (there is also one called "universal makefile", which compiles any package). The changes you did seem to be correct. I think you are just missing one more flag, BSD. The Macro variable should be something like
Macro  =  -DflagGUI -DflagGCC -DflagSHARED -DflagBSD -DflagOPENBSD -DflagPOSIX

Hopefully this will result into correctly compiled theide, so you will not need to use the debugger Wink

Honza

OK, I'm doing a clean rebuild using the extra flag, we'll see of it fixes things (fingers crossed).

Where can I find the "universal makefile"? Would I need to grab sources out of version control instead of a tarball to get ahold of it? I just downloaded a source tarball of the stable U++ and that's what I'm currently working with.

And it's not debuggers per-se that I'm trying to avoid, it's just command-line stuff that gives me the heebie-jeebies. Smile
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32095 is a reply to message #32071] Thu, 21 April 2011 23:58 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
That extra flag didn't help any.

I still get the same message box: "Invalid Memory Access!"

I tried launching it from the commend line instead of by double-clicking, and this is what came back in the terminal window:
Invalid memory access!
<unknown>: Fatal IO error 35 (Resource temporarily unavailable) on X server :0.0.

Does this help any?

Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32096 is a reply to message #32094] Fri, 22 April 2011 00:17 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hm, so it didn't help... Judging by the error message, it is something X related, but the message itself doesn't help much Sad

Col. Builder wrote on Thu, 21 April 2011 23:19

Where can I find the "universal makefile"? Would I need to grab sources out of version control instead of a tarball to get ahold of it? I just downloaded a source tarball of the stable U++ and that's what I'm currently working with.

The makefile is hidden in the SVN Smile But don't worry, it can be easily retrieved from the google mirror: http://code.google.com/p/upp-mirror/source/browse/trunk/uppb ox/lpbuild/Makefile. As it's author, I must admit it is rather buggy lately... Also, I never tested it on OpenBSD (only on FreeBSD and Linux). If you decide to use it, note that it requires to be used with gmake. You can place it just about anywhere and then call (from within the same directory) like this:
gmake PKG=ide FLAGS="GCC GUI SHARED OPENBSD" NESTS="/path/to/upp/uppsrc"
You can also run just gmake or gmake help to see more about the options... Anyway, I guess that there is about 99% chance it will work the same or worse than the release makefile...

Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32101 is a reply to message #32096] Fri, 22 April 2011 23:25 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
dolik.rce wrote on Thu, 21 April 2011 15:17

The makefile is hidden in the SVN Smile But don't worry, it can be easily retrieved from the google mirror: http://code.google.com/p/upp-mirror/source/browse/trunk/uppb ox/lpbuild/Makefile. As it's author, I must admit it is rather buggy lately... Also, I never tested it on OpenBSD (only on FreeBSD and Linux). If you decide to use it, note that it requires to be used with gmake. You can place it just about anywhere and then call (from within the same directory) like this:
gmake PKG=ide FLAGS="GCC GUI SHARED OPENBSD" NESTS="/path/to/upp/uppsrc"
You can also run just gmake or gmake help to see more about the options... Anyway, I guess that there is about 99% chance it will work the same or worse than the release makefile...

Honza

I'd say your prediction was spot on:
$ gmake PKG=ide FLAGS="GCC GUI SHARED OPENBSD" NESTS="/home/joel/upp/uppsrc"   
Using 1 parallel job ...
Parsing package files needed for ide ...
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
sed: RE error: invalid argument to regex routine
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
sed: RE error: invalid argument to regex routine
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
sed: RE error: invalid argument to regex routine
Segmentation fault (core dumped) 
Segmentation fault (core dumped) 
  Building package ide [TheIDE main package] (333 files in 29 packages, flags: GCC GUI MAIN OPENBSD POSIX SHARED)
    Creating directory _out/CtrlCore/GCC_GUI_OPENBSD_POSIX_SHARED/ ...

^C    Compiling CtrlCore/CtrlCore.icpp (flags GCC GUI OPENBSD POSIX SHARED) [/333] ...
gmake[1]: *** [_out/CtrlCore/GCC_GUI_OPENBSD_POSIX_SHARED/CtrlCore.io] Error 130
gmake: [ide] Error 130 (ignored)


It seemed to lock up on creating that directory, so I ctrl-c'd it (as you can see) since sed had already core-dumped all over the directory anyway.

I'm going to go ahead with hand-making some per project/archive makefiles and see if that Days example file exhibits the same problems.
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32102 is a reply to message #32101] Sat, 23 April 2011 09:27 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

I guess OpenBSD sed behaves a little different than ferrBSD one...

I downloaded OpenBSD 4.8 to install it in VirtualBox, but for some reason it won't boot no matter what I do :-/ I'll try few more times over the weekend... but since than, I don't have nothing much to advice you Sad

Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32106 is a reply to message #32071] Mon, 25 April 2011 00:21 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Good news, I finally managed to install OpenBSD in Qemu and after few unsuccesful tries I also compiled theide and reproduced the problem. Tomorrow I'll try to dig in deeper to see if I can figure out why does it crash...

Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32107 is a reply to message #32106] Mon, 25 April 2011 03:29 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
That is good news!

At least writing those per project/archive makefiles hasn't been a waste of time: I've been getting more familiar with the project layout/organization as a by-product. Smile
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32111 is a reply to message #32107] Mon, 25 April 2011 14:14 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Col. Builder wrote on Mon, 25 April 2011 03:29

At least writing those per project/archive makefiles hasn't been a waste of time: I've been getting more familiar with the project layout/organization as a by-product. Smile

Do I understand correctly that you are using U++ without theide, just writing the makefiles by hand? If yes, you have my deep respect, I don't think anyone ever attempted to do that Smile

Now the bad news... I suspect the GCC to be actually the cause of the problems. On OpenBSD the gcc 4.2.1 is used by default, which is known to cause trouble with U++. So far I wasn't able to succesfully install any other compiler (tried gcc 3.3.6, but it reports missing cc1plus). LLVM/Clang is next option, but first I have to figure out how to build the version 2.8 from ports (because IIRC 2.9 doesn't work very well with U++)...

If you have a better understanding of OpenBSD internals than me (and I'm sure you do, I'm learning everything on the way Smile ) you can try to use some other compiler yourself.

Honza

[Updated on: Mon, 25 April 2011 14:15]

Report message to a moderator

Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32113 is a reply to message #32071] Mon, 25 April 2011 16:09 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Good news again! Smile I have a running theide Wink

I'm just not sure yet what did the trick - I disabled a lot of things. So now I will start to enable them again one by one, checking what works and what not. This will take a while, the compilation in virtual machine takes quite some time. So for now, I will attach the makefile as is and update it later (probably tomorrow) in more optimal shape.

Honza
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32114 is a reply to message #32071] Mon, 25 April 2011 16:17 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Here is the Makefile (had to post it using Lynx from within the openbsd Smile )

EDIT: Removed the attachment

[Updated on: Mon, 25 April 2011 19:26]

Report message to a moderator

Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32117 is a reply to message #32071] Mon, 25 April 2011 19:36 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

So, here is the final Makefile Smile

Actually all that was needed to be done was to use -O2 instead of -O3 optimizations...

Be aware, that theide compiled on OpenBSD suffers from the same bug as MacOS X version which causes the menus to be painted under the windows. To fix that change line 206 in uppsrc/CtrlCore/CtrlKbd.cpp from
topwindow->SetWndForeground(); // cxl 2007-4-27
to
if(activate) topctrl->SetWndForeground(); // cxl 2007-4-27


I also noticed (and had to correct) some compile errors in ndisasm plugin, but since you already compiled theide without noticing that, you probably don't need to fix that...

Hopefully, now you can finally enjoy a working theide Wink

Honza
  • Attachment: Makefile
    (Size: 808.22KB, Downloaded 255 times)
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32192 is a reply to message #32117] Sat, 30 April 2011 02:25 Go to previous messageGo to next message
Col. Builder is currently offline  Col. Builder
Messages: 7
Registered: April 2011
Promising Member
That did it!

I had to check out the latest sources from svn and copy it into uppsrc (it expected some modules not present in the source tarball). After I did that it went smooth as silk!

Thanks for all your assistance! I'm on my way to having a dev environment that isn't saddled with all that virally licensed junk. Smile

Now I just need to get used to the ide's organization (I'm a hardcore CodeWarrior guy, so TheIDE feels fairly alien at the moment), and also get llvm/clang working as the compiler (I know... probably very non-trivial)! Smile

Thanks Again!
Re: Problem Launching stable IDE on OpenBSD 4.8-stable [message #32194 is a reply to message #32192] Sat, 30 April 2011 05:00 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Col. Builder wrote on Sat, 30 April 2011 02:25

Now I just need to get used to the ide's organization (I'm a hardcore CodeWarrior guy, so TheIDE feels fairly alien at the moment), and also get llvm/clang working as the compiler (I know... probably very non-trivial)! Smile

It's not easy to get used to different IDE, but when you do, you will probably be quite happy with theide Wink

Setting up clang is piece of cake, at least version 2.8 (the newer 2.9 does not currently work with U++ Sad ). You just make a copy of the GCC build method and change compiler name to "clang++" and it should work Wink In worst case some include paths might be necessary to add, but that is still easy.

Honza

PS: More precisely: clang 2.9 doesn't work with libc4.6 headers, maybe it would work with libc4.5, but I haven't tried... Also the situation on OpenBSD might be different from my experience on Linux...

[Updated on: Sat, 30 April 2011 05:06]

Report message to a moderator

Previous Topic: Create Makefile behaviour
Next Topic: about Garbled on upp theIDE
Goto Forum:
  


Current Time: Fri Mar 29 02:55:32 CET 2024

Total time taken to generate the page: 0.01392 seconds