1

I have a desktop with a Core i5 3rd gen and 4 GB of RAM. I am using the machine to test building some free software projects I contribute to. The machine serves no other purpose.

I allocated 4 GB swap space. It looks like I'm still running out of memory.

$ make -j 4
...

/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I.    -O2 -template=no%extdef -DCRYPTOPP_DISABLE_SHANI  -D__SSE2__=1 -D__SSSE3__=1 -D__SSE4_1__=1 -D__SSE4_2__=1 -D__AES__=1 -DCRYPTOPP_DATA_DIR='"/usr/local/share/cryptopp/"' -g -c -o cryptest-validat3.o `test -f 'validat3.cpp' || echo './'`validat3.cpp
DBG_GEN FATAL ERROR: dbg_tables.c:171 - fwrite() failed to write required bytes [DBG_GEN 5.7.6]

CC: ube failed for validat3.cpp

The error also moves around:

$ make -j 4
...

/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I.    -O2 -template=no%extdef -DCRYPTOPP_DISABLE_SHANI  -D__SSE2__=1 -D__SSSE3__=1 -D__SSE4_1__=1 -D__SSE4_2__=1 -D__AES__=1 -DCRYPTOPP_DATA_DIR='"/usr/local/share/cryptopp/"' -g -c -o cryptest-validat0.o `test -f 'validat0.cpp' || echo './'`validat0.cpp
source='validat1.cpp' object='cryptest-validat1.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ./depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I.    -O2 -template=no%extdef -DCRYPTOPP_DISABLE_SHANI  -D__SSE2__=1 -D__SSSE3__=1 -D__SSE4_1__=1 -D__SSE4_2__=1 -D__AES__=1 -DCRYPTOPP_DATA_DIR='"/usr/local/share/cryptopp/"' -g -c -o cryptest-validat1.o `test -f 'validat1.cpp' || echo './'`validat1.cpp
...

libsunir aborting on error
Assertion failed: IR_FALSE, file ../src/IrLib.c, line 204, function ir_err_report
...

CC: Fatal error in /opt/developerstudio12.6/lib/compilers/bin/ube
CC: Status 134
make[1]: *** [Makefile:1477: cryptest-validat1.o] Error 134

I'm not running any other programs. Only the compiler through the makefile.

When I examine dmesg I see WARNING: /tmp: File system full, swap space limit exceeded. According to the Oracle doc WARNING: /tmp: File system full, swap space limit exceeded:

Cause

The system swap area (virtual memory) has filled up. You need to reduce swap space consumption by killing some processes or possibly by rebooting the system.

Action

For information about increasing swap space, refer to "Not enough space".

I'm baffled 4 GB or RAM and 4 GB of swap is not enough to run a compiler. I don't know how much more memory I need to allocate to run the compiler.

How much virtual memory should I allocate so the compiler can run without crashing?


$ zfs list
NAME                              USED  AVAIL  REFER  MOUNTPOINT
rpool                            21.3G   207G  4.85M  /rpool
rpool/ROOT                       13.6G   207G    31K  legacy
rpool/ROOT/solaris               13.6G   207G  12.9G  /
rpool/ROOT/solaris/var            526M   207G   367M  /var
rpool/VARSHARE                    164K   207G  69.5K  /var/share
rpool/VARSHARE/pkg                 63K   207G    32K  /var/share/pkg
rpool/VARSHARE/pkg/repositories    31K   207G    31K  /var/share/pkg/repositories
rpool/VARSHARE/zones               31K   207G    31K  /system/zones
rpool/dump                       1.96G   207G  1.90G  -
rpool/export                     1.62G   207G  33.5K  /export
rpool/export/home                1.62G   207G    33K  /export/home
rpool/export/home/apolyakov        38K   207G    38K  /export/home/apolyakov
rpool/export/home/jwalton        1.62G   207G  1.62G  /export/home/jwalton
rpool/swap                       4.13G   207G  4.00G  -

And it reports healthy even in the throws of the memory or storage failures:

$ zpool status -x
all pools are healthy

And some accounting:

$ zpool status -v
  pool: rpool
 state: ONLINE
  scan: none requested
config:

        NAME      STATE     READ WRITE CKSUM
        rpool     ONLINE       0     0     0
          c1t0d0  ONLINE       0     0     0

errors: No known data errors

This machine's name is solaris3. It is the third machine to experience these troubles. The first was a used used DL380 G5 server on Sun's HCL. The second was an Intel Utlra-24 from Sun. The third is the low-end Core i5.

I don't do anything special when laying an OS on the hardware. I downloaded the Solaris x86 ISO from Sun (twice now). I run the installer and I take the defaults. When prompted I select the "use entire disk" option.

After the OS install I enable the Solaris Studio publisher. I then install Autoconf, Automake, Libtool, Git, Subversion, GDB, Sun Studio 12.2 through 12.6, and some other dev tools. There are hundreds of gigabytes of free space available on all three machines after the extra software is installed.

All the machines are headless. I remove the monitor once the OS is installed. Though the machines are in my basement I work remotely over SSH.

I am not a Solaris admin and I don't arbitrarily change settings. I change settings in response to problems like this. After changing a setting like swap size I reboot the machine with reboot -p.

  • 1
    Compiling shouldn't take any swap at all. Have you tried having make run one job at once? – dsstorefile1 Jul 25 '18 at 3:00
  • 3
    What makes you think it's swap? The error does not say anything about failure to allocate memory. fwrite writes to disk meaning you are either running out of disk space on /tmp or in the current directory, or you have a bad disk causing the write to fail. – Kusalananda Jul 25 '18 at 6:44
  • @Kusalananda - I added additional information. If inclined, please send me your SSH authorized_keys file at noloader, gmail account. I will make you an admin on the box and you can inspect and adjust settings. – user56041 Jul 25 '18 at 13:09
  • 1
    Did you know that if the compiler is using a lot of RAM/Swap, then 4 would use 4× the RAM/Swap. Therefore if Lack of RAM/Swap is the problem (I see no evidence that it is), then running only one compiler at a time, may help (Depending on how much RAM/Swap is needed). – ctrl-alt-delor Jul 25 '18 at 15:19
  • 2
    Intel UtlraSparc??? That's like a Ford Camry. – Andrew Henle Jul 26 '18 at 10:23
2

The system requirements for Developer Studio 12.6 for Solaris 10 specify a minimum of 8GB of swap. For solaris 11.3, the same doc says to see the OS documentation. The OS documentation says "Consult your application vendors for swap space requirements for their applications."

It's bit circular, given that the software vendor (Oracle) says to check the OS documentation (also Oracle), which says check the software vendor docs. Ad infinitum.

In the end, I would up my swap to 8GB as per the Solaris 10 requirements, since there's nothing more definitive from Solaris 11 than "what did your vendor say?".

  • Thanks @Tim. I bumped swap to 8 GB but the same error occurred. Let me bump to 16 GB of swap space. I get the feeling the Sun Studio team did not read Minimizing Memory Usage for Creating Application Subprocesses. The article bashes AIX and Linux vm strategy. But the ironic thing is, things just work on AIX, BSDs, Linux and even Windows. – user56041 Jul 25 '18 at 16:31
  • does the DBG_GEN error indicate you have debug builds turned on? if so, that may account for larger virtual memory requirements. I never had a pain-free build with Sun Studio, so I always used GCC, so I can't help with the studio compiler. – Tim Kennedy Jul 25 '18 at 16:54
  • But the ironic thing is, things just work on AIX, BSDs, Linux and even Windows. Only for very low standards of "just work" - wait until the OOM killer whacks your database process on your production DB server... – Andrew Henle Jul 26 '18 at 10:45
  • Thanks @Tim. At 8 GB I can run a single make job. I suppose that's the answer. It would be nice to be able to run multiple make jobs without crashing. I've got a "test script from hell" that takes 6 to 8 hours to run on modern hardware. One make job means it will take 60 to 80 hours to run. Ugh... – user56041 Jul 26 '18 at 13:50
2

In Solaris the filesystem /tmp is provided by tmpfs. tmpfs keeps the filesystem in virtual memory. Consider it very remotely similar to a ramdisk. Everything you write in /tmp allocates memory from the VM subsystem and as Solaris is an eager allocator swap is reserved for this even when stuff is in memory as you want to be able to swap this stuff out in case memory is sparse (very simplified).

AFAIR one reason was to enable compilers to do fast compiles by sending temporary files on local memory instead to remote disk. Per default the Sun Studio Compiler writes temporary files into /tmp . You should try setting TMPDIR to /var/tmp , which resides on disk, however at reduced performance. Maybe you are just writing to much in /tmp . As an alternative you can just increase swap.

  • That is interesting. My .bashrc sets TMPDIR to /tmp if it is available and writeable. I need it for some test scripts. I also had to refactor some source files to get the job count up. Also see Split validat*.cpp files on the mailing list. – user56041 Jul 29 '18 at 15:23
  • Setting TMPDIR=/var/tmp worked well for me without any other tweaking. And since my physical disk is a SSD (I'm running Solaris 11.3 x86 inside Hyper-V with 3.5 GB guest RAM on a Surface Pro 4) the slowdown in devstudio + the build job was negligible. – Tanz87 Aug 20 '18 at 20:56
1

Your problem may be elsewhere.

Searching for the "DBG_GEN FATAL ERROR" part of your error message online reveals that this seems likely highly specific to your task. Perhaps examine the code in question and see where it's attempting to write to? It could be a temporary filesystem or another device with a limited capacity.

For instance, running out of space on /tmp (which is often mounted as a tmpfs on Linux) is a common culprit for "out of space" errors in certain kinds of tasks.

  • Thanks. Yeah, I've seen DBG_GEN FATAL ERROR before. The thing is, this is the third Solaris machine I set up on real hardware. All of them have suffered these stupid problems out of the box. I am amazed Oracle allowed the OS to ship this broken. I suppose there's no pride in a craft anymore since Sun got bought out. – user56041 Jul 25 '18 at 4:48
  • 2
    @jww Oracle did not ship a broken OS, you are doing something wrong. – Kusalananda Jul 25 '18 at 8:28
  • @Kusalananda - I added additional information. I would be kind of surprised to learn the problem is caused by me. I don't pretend to be a Solaris admin and I don't change Sun's recommended settings except for times like these. – user56041 Jul 25 '18 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy