首页 > 解决方案 > How to suppress the error message: "Error in `./hubbard.exc': corrupted size vs. prev_size"?

问题描述

I have a very old program (from the late 80s) written in C++ and I somehow managed to get it running on Ubuntu 16.04 64Bit. Even if it produces an error at the end, the results are okay. Since it seems to be impossible to compile that program nowadays (it makes use of a very old version of the proprietary library NAG) I cant fix the problem in the source code and have to live with the error. I need to run this program in a loop and the error message completely clutters my screen and prevents me from seeing relevant messages. I tried to suppress the message by using calls like ./hubbard.exc 2>/dev/null and variants of it like &>/dev/null, but the error message is still printed to screen. So I conclude, that this error message is neither printed to stdout nor to stderr.

I would be grateful for any help to suppress this error message or for an advise on how to suppres all output of the shell!

In case that it would not be possible to suppress this error message in the shell it would also help me to find a way to run the program from a Python3 script (using subprocess or os.system) without that the error is printed to screen.

The error message Im talking about looks as follows:

*** Error in `./hubbard.exc': corrupted size vs. prev_size: 0x0a350a98 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x67377)[0xf7d5e377]
/lib/i386-linux-gnu/libc.so.6(+0x6d2f7)[0xf7d642f7]
/lib/i386-linux-gnu/libc.so.6(+0x6e48a)[0xf7d6548a]
./libstdc++-libc6.2-2.so.3(__builtin_vec_delete+0x24)[0xf7f5ea44]
./hubbard.exc[0x80b4ad4]
./hubbard.exc[0x808e141]
./hubbard.exc[0x805352d]
./hubbard.exc[0x805257f]
./hubbard.exc[0x80527c5]
./hubbard.exc(fwrite+0xc7)[0x8049623]
./hubbard.exc[0x80b7779]
/lib/ld-linux.so.2(+0xfa87)[0xf7f89a87]
/lib/i386-linux-gnu/libc.so.6(+0x2e993)[0xf7d25993]
======= Memory map: ========
08048000-080bd000 r-xp 00000000 08:16 15208152                           /mnt/data/Downloads/Ausfuehrbar/hubbard.exc
080bd000-080cb000 rwxp 00074000 08:16 15208152                           /mnt/data/Downloads/Ausfuehrbar/hubbard.exc
080cb000-080cf000 rwxp 00000000 00:00 0 
098ee000-0a51e000 rwxp 00000000 00:00 0                                  [heap]
f7b00000-f7b21000 rwxp 00000000 00:00 0 
f7b21000-f7c00000 ---p 00000000 00:00 0 
f7cf6000-f7cf7000 rwxp 00000000 00:00 0 
f7cf7000-f7ea7000 r-xp 00000000 08:02 917535                             /lib/i386-linux-gnu/libc-2.23.so
f7ea7000-f7ea9000 r-xp 001af000 08:02 917535                             /lib/i386-linux-gnu/libc-2.23.so
f7ea9000-f7eaa000 rwxp 001b1000 08:02 917535                             /lib/i386-linux-gnu/libc-2.23.so
f7eaa000-f7ead000 rwxp 00000000 00:00 0 
f7ead000-f7f00000 r-xp 00000000 08:02 917512                             /lib/i386-linux-gnu/libm-2.23.so
f7f00000-f7f01000 r-xp 00052000 08:02 917512                             /lib/i386-linux-gnu/libm-2.23.so
f7f01000-f7f02000 rwxp 00053000 08:02 917512                             /lib/i386-linux-gnu/libm-2.23.so
f7f0d000-f7f29000 r-xp 00000000 08:02 917507                             /lib/i386-linux-gnu/libgcc_s.so.1
f7f29000-f7f2a000 rwxp 0001b000 08:02 917507                             /lib/i386-linux-gnu/libgcc_s.so.1
f7f2a000-f7f2b000 rwxp 00000000 00:00 0 
f7f2b000-f7f61000 r-xp 00000000 08:16 15208227                           /mnt/data/Downloads/Ausfuehrbar/libstdc++-libc6.2-2.so.3
f7f61000-f7f72000 rwxp 00036000 08:16 15208227                           /mnt/data/Downloads/Ausfuehrbar/libstdc++-libc6.2-2.so.3
f7f72000-f7f75000 rwxp 00000000 00:00 0 
f7f75000-f7f78000 r--p 00000000 00:00 0                                  [vvar]
f7f78000-f7f7a000 r-xp 00000000 00:00 0                                  [vdso]
f7f7a000-f7f9d000 r-xp 00000000 08:02 917518                             /lib/i386-linux-gnu/ld-2.23.so
f7f9d000-f7f9e000 r-xp 00022000 08:02 917518                             /lib/i386-linux-gnu/ld-2.23.so
f7f9e000-f7f9f000 rwxp 00023000 08:02 917518                             /lib/i386-linux-gnu/ld-2.23.so
ff8f5000-ff916000 rwxp 00000000 00:00 0                                  [stack]

标签: pythonbashubuntuerror-suppression

解决方案


You may use export LIBC_FATAL_STDERR_=1 to let this backtrace go to stderr, then use 2>/dev/null to drop that error message, which like

$ LIBC_FATAL_STDERR_=1 ./hubbard.exc 2>/dev/null 

, see glibc backtrace - can't redirect output to file for more detail.


推荐阅读