• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

2.8: Mode switch v8 <-> v9 possible in process?

Is it possible with Solaris 2.8 to switch between V8 (32bit) and V9 (64 bit) mode within the same process?

I'm aware of some different features (stack bias, etc.), but the V9 ABI doesn't tell anything about how a V8<->V9 switch is done. It must be done in the kernel somewhere, since it's possible to run both V8/ELF32 and V9/ELF64 binaries.

Background: We're having lots of V8 applications here and slowly some of them are running out of mappable shared memory (2GB). It would be nice to have the shared memory routines running in 64 bits (with -xcode=abs32).

Porting all to 64 bits is not an option, since this would require a huge regression testing effort.

(Yes, I know this is a tough one ... )
  • 3
  • 3
  • 2
2 Solutions
Seems to me that you should just start up the system in 64bit (V9) mode and convert just the apps that are having problems to 64bit. The 32bit apps should continue to run.
I agreed with jlevie's comments. Just add a bit more information. Solaris 8/9 (Sparc) are
64 bit OS, it can run in 64 bit mode only if the hardware (CPU) can support, the old Sparc
CPU can only run in 32-bit mode, most of the Ultra Spac CPU (with latest OBP) can support
64 bit, Ultra Sparc-II or new support 64 bit.

If you want to build 64 bit binary, you need to it in the box can run in 64 bit mode.

stefan73Author Commented:
jlevie, yuzh,

Thanks for your comments. Yes, the box is a 64 bit Solaris 2.8. And yes, it might be possible to build the apps in 64bits. The problem is just that those apps are using a common, quite monolithic framework of functions (it's a big billing system in a telco environment), whereas the shmem part is pretty much stand-alone.

Porting the existing libraries of functions to 64bit is not an option, as the effort would be quite similar to porting the entire system, in other words: huge. Can't do that.

There are a couple of options to have more than 2GB of shared memory, all of which don't quite convince me:

- a separate V9 process mapping the shmem, using RPC or IPC to communicate with the rest. The overhead is quite big.

- On-demand mapping of various blocks in a V8 process. Quite slow, and big index structures won't work.

Ideas, anyone?
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

I guess I don't understand "whereas the shmem part is pretty much stand-alone." Is that or is that not an integral part of the "monolithic framework of functions"?

If the part using shmem is stand-alone it would seem that it could be modified to build & run in 64bit mode. However, it that is linked into the mail application that wouldn't be possible and you'd have to an approach like you've outlined.
I would suggest you to try to port the programs which need to use large file (>2GB) and
large amount of memory to 64-bit, and leave the other unchange.
see "Solaris 64-bit Developer's Guide"

You can also try to use "limit" to change the datasize and memorysize, and then start
the 32 bit binay to see if it can help:

Please read: 32-bit binary "4GB Processes in Solaris":

man limit
to learn more details
stefan73Author Commented:
Just returning from a vacation...

> I guess I don't understand "whereas the shmem part is pretty much
> stand-alone." Is that or is that not an integral part of the "monolithic
> framework of functions"?

That wasn't explained clearly enough. The shmem part is modular, the rest is monolithic - just like lots of existing bigger systems. Yes, it's not pretty.


the limit part was quite interesting.
> The shmem part is modular, the rest is monolithic

In that case it might be feasible to modify the application so as to allow the shmem part to be built for 64bit.
stefan73Author Commented:
OK, although I didn't get the answers I wanted, I'll close regularly.

(BTW: Friend of mine working at Sun said it's impossible - except with the help of a driver)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now