Archived Forum Post

Index of archived forum posts

Question:

Chilkat C++ library crashes on Linux.

Dec 13 '12 at 08:53

I using chilkat library in my C++ program, it compile correctly but while running the program it crash in Linux even it works fine with windows.

I am trying to trace it on valgrind and after execution of some command it shows below error log:

==6428== Thread 2:

==6428== Invalid read of size 1

==6428== at 0x313362: _IO_file_underflow@@GLIBC_2.1 (in /lib/libc-2.12.so)

==6428== by 0x31504A: _IO_default_uflow (in /lib/libc-2.12.so)

==6428== by 0x316659: __uflow (in /lib/libc-2.12.so)

==6428== by 0x30904B: _IO_getline_info (in /lib/libc-2.12.so)

==6428== by 0x308F90: _IO_getline (in /lib/libc-2.12.so)

==6428== by 0x311FB0: fgets_unlocked (in /lib/libc-2.12.so)

==6428== by 0x402D736: _nss_files_getpwuid_r (in /lib/libnss_files-2.12.so)

==6428== by 0x844C1CC: getpwuid_r (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x844CE02: __getlogin_r_loginuid (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x844CB09: getlogin (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x82A6E6B: Psdk::getUsername(StringBuffer&) (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x822F60F: ClsBase::logProgrammingLanguage2(LogBase&) (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== Address 0x0 is not stack'd, malloc'd or (recently) free'd

==6428==

==6428==

==6428== Process terminating with default action of signal 11 (SIGSEGV)

==6428== Access not within mapped region at address 0x0

==6428== at 0x313362: _IO_file_underflow@@GLIBC_2.1 (in /lib/libc-2.12.so)

==6428== by 0x31504A: _IO_default_uflow (in /lib/libc-2.12.so)

==6428== by 0x316659: __uflow (in /lib/libc-2.12.so)

==6428== by 0x30904B: _IO_getline_info (in /lib/libc-2.12.so)

==6428== by 0x308F90: _IO_getline (in /lib/libc-2.12.so)

==6428== by 0x311FB0: fgets_unlocked (in /lib/libc-2.12.so)

==6428== by 0x402D736: _nss_files_getpwuid_r (in /lib/libnss_files-2.12.so)

==6428== by 0x844C1CC: getpwuid_r (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x844CE02: __getlogin_r_loginuid (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x844CB09: getlogin (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x82A6E6B: Psdk::getUsername(StringBuffer&) (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== by 0x822F60F: ClsBase::logProgrammingLanguage2(LogBase&) (in /u/shanr/workplace/perfstat_build_chilkat/perfstat8)

==6428== If you believe this happened as a result of a stack

==6428== overflow in your program's main thread (unlikely but

==6428== possible), you can try to increase the size of the

==6428== main thread stack using the --main-stacksize= flag.

==6428== The main thread stack size used in this run was 10485760.

==6428==

==6428== HEAP SUMMARY:

==6428== in use at exit: 0 bytes in 0 blocks

==6428== total heap usage: 0 allocs, 0 frees, 0 bytes allocated

==6428==

==6428== All heap blocks were freed -- no leaks are possible

==6428==

==6428== For counts of detected and suppressed errors, rerun with: -v

==6428== Use --track-origins=yes to see where uninitialised values come from

==6428== ERROR SUMMARY: 786543 errors from 444 contexts (suppressed: 14 from 4)

I dont understand. I tried to get some information about ClsBase::logProgrammingLanguage2(LogBase&) but fail. help me.


Answer

Maybe the problem has to do with your extremely old version of libc (v2.12). Chilkat provides an older build that uses libc 2.3.4. See the Linux C++ lib downloads at http://www.chilkatsoft.com/chilkatLinux.asp

Also, Chilkat version 9.4.0 was released today, so you might try downloading this new version to see if it makes a difference.