VOGONS


SVN on OS X - core=dynamic causes segfault

Topic actions

First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I'm not sure if this is the right place to post this, and I hope it's of some use to someone.

I built the latest SVN on OS X using the technique described by Dominus in another thread. When I run it with a conf file that includes

[cpu]
core=dynamic

the app crashes with a segmentation fault. I've posted the crash report here:

http://dl.dropbox.com/u/271144/SVN-Dynamic-Crash.txt

If this isn't useful to anyone, I hope the admins will let me know, and I'll delete the fie.

Reply 1 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

If you don't build a 32bit version it will crash. Known issue

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

When compiling, I used the environment vars that you specified in an earlier thread:

CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386' MACOSX_DEPLOYMENT_TARGET=' […]
Show full quote

CFLAGS='-O2 -arch i386'
CPPFLAGS='-I/opt/local/include'
CXXFLAGS='-O2 -mdynamic-no-pic -arch i386'
MACOSX_DEPLOYMENT_TARGET='10.6'
CXX='/usr/bin/g++-4.2'
F90FLAGS='-O2 -m32'
LDFLAGS='-L/opt/local/lib'
OBJC='/usr/bin/gcc-4.2'
FCFLAGS='-O2 -m32'
INSTALL='/usr/bin/install -c'
OBJCFLAGS='-O2 -arch i386'
FFLAGS='-O2 -m32'
CC='/usr/bin/gcc-4.2'

Doesn't this create a 32-bit build? If not, is there anything else that needs to be done?

I get the segfault crash when launching the build with a .conf file containing only these two lines:

[cpu]
core=dynamic

Anyway, I'll shut up about it after this message!

Reply 3 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

if setting core to dynamic crashes dosbox for you then you made a mistake in compiling, possibly in setting the above flags, thus creating a 64bit version of Dosbox.
things to do:
- check the arch of your compiled dosbox by "lipo -info pathtothedosboxsource/src/dosbox"
- write here EXACTLY what you do and more importantly what you which commands you give in terminal to compile Dosbox. And I mean EXACTLY. Not something like "then I set the environment variables.." but the EXACT command.
I'm pretty sure you are not following some instruction or doing it wrong

Reply 4 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

First, you're right: lipo -info reports that the architecture is 'x86_64'.

Here are the steps I follow, written here as I performed them. For this test, by the way, I don't change anything in the makefiles, as I do when trying to compile statically.

(Following your advice, I installed svnX and used it to make a local copy of the latest source in ~/DOSBox\ SVN\ Copy)

1. Open a terminal, cd to ~/DOSBox\ SVN\ Copy/dosbox/trunk.

2. Enter the command: make clean (only if I have built from the same source previously, and I built from this source yesterday).

3. Paste in to the terminal the following commands (which are copied directly from your post in Buidling CVS on OS X 10.6.1, with line breaks added as needed):

CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386' MACOSX_DEPLOYMENT_TARGET=' […]
Show full quote

CFLAGS='-O2 -arch i386'
CPPFLAGS='-I/opt/local/include'
CXXFLAGS='-O2 -mdynamic-no-pic -arch i386'
MACOSX_DEPLOYMENT_TARGET='10.6'
CXX='/usr/bin/g++-4.2'
F90FLAGS='-O2 -m32'
LDFLAGS='-L/opt/local/lib'
OBJC='/usr/bin/gcc-4.2'
FCFLAGS='-O2 -m32'
INSTALL='/usr/bin/install -c'
OBJCFLAGS='-O2 -arch i386'
FFLAGS='-O2 -m32'
CC='/usr/bin/gcc-4.2'

I leave the same terminal open, enter "set" and check the output. (I've posted the output of set here: http://dl.dropbox.com/u/271144/envvars.txt)

4. Still leaving the same terminal open, I enter:

./autogen.sh
./configure
make

When i ran lipo -info on src/dosbox, it reported:

Non-fat file: dosbox is architecture: x86_64

So obviously I'm doing something wrong. 🙁 But I've studied your posts extremely closely, and I can't see what I'm leaving out.

(I thought a workaround MIGHT be to change the MACOSX_DEPLOYMENT_TARGET= variable to 10.4, but that also produced an x86_64-architectured build.)

Reply 5 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

yep, got it. you are missing an export and added to many linebreaks in step 3....
type "export Cflags=... CXXFlags=...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 6 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

yep, got it. you are missing an export and added to many linebreaks in step 3....
type "export Cflags=... CXXFlags=...

That did it! Thank you for catching that.

Just to be certain that what I'm doing is exactly what I should be doing, this is now the batch of commands that I paste into the terminal:

export CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386' MACOSX_DEPLOYMENT_TAR […]
Show full quote

export CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386'
MACOSX_DEPLOYMENT_TARGET='10.6'
CXX='/usr/bin/g++-4.2'
F90FLAGS='-O2 -m32'
LDFLAGS='-L/opt/local/lib'
OBJC='/usr/bin/gcc-4.2'
FCFLAGS='-O2 -m32'
INSTALL='/usr/bin/install -c'
OBJCFLAGS='-O2 -arch i386'
FFLAGS='-O2 -m32'
CC='/usr/bin/gcc-4.2'

And, to clarify it completely, this part is a single line:

export CFLAGS='-O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386'

As you see from your third post in Buidling CVS on OS X 10.6.1, I copied the string correctly, but "export" was missing, and I made the wrong guesses about the line breaks. I'm very grateful to you for helping me get this right.

Reply 7 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

On Linux and OsX you set environment variables through the command export. So, no not yet right, all of those in one line or an export in front of each line...

Reply 8 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

On Linux and OsX you set environment variables through the command export. So, no not yet right, all of those in one line or an export in front of each line...

So like this...??

export CFLAGS='-O2 -arch i386' export CPPFLAGS='-I/opt/local/include' export CXXFLAGS='-O2 -mdynamic-no-pic -arch i386' ... […]
Show full quote

export CFLAGS='-O2 -arch i386'
export CPPFLAGS='-I/opt/local/include'
export CXXFLAGS='-O2 -mdynamic-no-pic -arch i386'
...

I think this may not be right, because you said in an earlier message that I added too many line breaks. I'm not clear on which line break (or line breaks) shouldn't be there.

I really hope this is the last time I trouble you for help with this. You've been extremely patient and generous with your time.

Reply 9 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Either you put it all in one line (like the above example with two of those settings) without ANY linebreak (hence my "too many" linebreaks) or each setting with an export comman up front...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

Either you put it all in one line (like the above example with two of those settings) without ANY linebreak (hence my "too many" linebreaks) or each setting with an export comman up front...

OK - I've finally got it. Many thanks yet again!

Reply 11 of 110, by ufoufo512

User metadata
Rank Newbie
Rank
Newbie

Bumping this thread because I cannot get dynamic core to work on my Snow Leopard. I have followed the instructions given in this and in Make error when installing from svn sources thread.

Before I have been able to make svn builds. Now it crashes as soon as I use dynamic core. Lipo -info reports that dosbox is architecture: i386.

Could somebody, please, check if they are able to make builds with Snow Leopard that don't crash with dynamic core?

Reply 12 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'll check tomorrow. If I haven't answered in 24h contact me per PM to remind me 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 13 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
ufoufo512 wrote:

Could somebody, please, check if they are able to make builds with Snow Leopard that don't crash with dynamic core?

The build that I put together following the instructions in this thread also crashes with dynamic core. I hadn't tried it until you posted this question.

Reply 14 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

SVN works fine for me. Started Dosbox and then typed
core dynamic
no crash.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 15 of 110, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

to be sure enter this as well:

config -h core

check that dynamic is there.

Water flows down the stream
How to ask questions the smart way!

Reply 16 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

config -h core reports back that current value is dynamic

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 17 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Same here on the build I made from Dominus's instructions in this thread.

lipo -info reports i386 architecture
config -h core reports dynamic is present

core dynamic causes a crash with the output:

Segmentation fault
logout

Reply 18 of 110, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I can only say that I can't reproduce this at all. Dosbox SVN *just* works here with dynamic core and also when actually stress testing this with PCPbenchmark.... I rest my case.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 19 of 110, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

The difference is probably the result of the fact that you know what you're doing, while I'm blindly trying to imitate what other people are doing.

Since my application uses only real-mode software, I can easily live with this. Or change the conf to "core=normal".