RSS feed [root] /languages /weblog




login:

password:

title search:




 


Sat Sep 28 10:13:00 GMT 2024

languages



(google search) (amazon search)
second
download zip of files only

Thu Mar 01 14:25:13 GMT 2012 From /weblog/languages/c

memory issue


Problem of malloc, and introduction to some improved version - http://betathoughts.blogspot.com/2010/02/history-of-malloc.html

Personal memo about C++ memory management, from a Java developer, contain some rule of thumb tips - http://karussell.wordpress.com[..]c-trying-to-understand-memory-mangement/

Tutorial of valgrind - http://www.thegeekstuff.com/2011/11/valgrind-memcheck/

Disucssion of GC in C++ - http://herbsutter.com[..]10/25/garbage-collection-synopsis-and-c/

Core dump with few variable declaration removed - http://techblog.rosedu.org/c-extern-internals.html

Tracking memory allocation - http://jfdube.wordpress.com[..]-management-part-2-allocations-tracking/

We have a process running fine for several years and recently have core dump everytime starting it up. here is the stacktrace:

(gdb) backtrace
#0 0xfe34251c in realfree () from /lib/libc.so.1
#1 0xfe342e28 in cleanfree () from /lib/libc.so.1
#2 0xfe341f5c in _malloc_unlocked () from /lib/libc.so.1
#3 0xfe341e50 in malloc () from /lib/libc.so.1
#4 0xfe38f534 in _findbuf () from /lib/libc.so.1
#5 0xfe384f38 in _doprnt () from /lib/libc.so.1
#6 0xfe3886fc in fprintf () from /lib/libc.so.1
#7 0x164f64 in _ZN7LogBook8WriteLogEPcS0_i (this=, pType=0x5c00e8 "INFO",
pMsg=0x6b0b14 "main. Database=XXXXXX. Performing Login to XXXX. user=SYSTEM.", nFile=0) at Util.cpp:164
#8 0x164e28 in _ZN7LogBook9PromptLogEPciS0_i (this=, pType=0x5c00e8 "INFO",
nType=3, pMsg=0x0, nFile=0) at Util.cpp:136
#9 0x14a364 in main (argc=3, argv=0xffbef5bc) at XXXX.cpp:385
(gdb)

Eventaully we found out the reason is the class LogBook is singleton, and it reuse few char* buffer internally, without delete and new in between, after adding delete and new for transaction, the process run correctly, as a rule of thumb, singleton is evil for most of the cases.

(google search) (amazon search)


Sat Oct 15 03:37:46 GMT 2011 From /weblog/languages/c

bug


incorrect comparison of 64bit pointers - http://www.azulsystems.com[..]/2011-08-28-just-fixed-a-20-year-old-bug

(google search) (amazon search)


Wed Oct 05 04:47:41 GMT 2011 From /weblog/languages

function


Pointer of using function languages like OPML in finance industry - http://beautifulcode.oreillynet.com/2008/03/edge_extension_1.php http://queue.acm.org/detail.cfm?id=2038036

(google search) (amazon search)


Mon Sep 26 15:59:58 GMT 2011 From /weblog/languages/c

gui


Example of using DBus - http://brunogirin.blogspot.com[..]m/2011/01/d-bus-experiments-in-vala.html

(google search) (amazon search)


Fri Aug 05 16:35:30 GMT 2011 From /weblog/languages/c

string


One big problem of strncpy, it doesn't allow you control the behaviour when overflow... http://blog.liw.fi/posts/strncpy/

Problem of atoi - http://www.lainoox.com/ascii-to-integer-atoi-in-c/

(google search) (amazon search)


Tue Apr 05 17:20:22 GMT 2011 From /weblog/languages

system


Quick look at the Rust Programming Language - http://www.bluishcoder.co.nz[..]ok-at-the-rust-programming-language.html

(google search) (amazon search)


Sat Jan 15 02:08:41 GMT 2011 From /weblog/languages/c

io


First Disk Seek on multi-core system - http://www.1024cores.net/home/scalable-architecture/wide-finder-2

(google search) (amazon search)


Thu Oct 28 18:11:41 GMT 2010 From /weblog/languages

html


We can use pure HTTP request as finite state machine and implement some logic in pure webserver - http://blog.beef.de/2008/01/16/html-game/ http://blog.codetastrophe.com[..]2009/03/tic-tac-toe-game-for-kindle.html

(google search) (amazon search)


Sun Sep 05 18:21:19 GMT 2010 From /weblog/languages

assembly


Introduction to x64 Assembly - http://software.intel.com[..]us/articles/introduction-to-x64-assembly

(google search) (amazon search)


Thu Sep 10 16:26:57 GMT 2009 From /weblog/languages

haskell


http://donsbot.wordpress.com[..]l-programming-in-haskell-a-reading-list/

(google search) (amazon search)


Sun Jun 15 16:17:24 GMT 2008 From /weblog/languages

ruby


Links about Ruby performance tuning - http://www.juixe.com[..]/2007/02/28/rails-performance-link-fest/

Send and receive SMS text messages with Ruby and a GSM/GPRS modem - http://snippets.dzone.com/posts/show/3647



(google search) (amazon search)


Wed Feb 13 17:13:35 GMT 2008 From /weblog/languages

groovy


Meta-programming, change the existing class definition, look cool - http://thediscoblog.com/2008/02/02/metaprogramming-is-so-groovy/

(google search) (amazon search)


Wed Nov 28 05:21:42 GMT 2007 From /weblog/languages

python


Tutorial - http://tssblog.blogs.techtarget.com[..]&asrc=EM_NLN_2652143&uid=703565#more-187

(google search) (amazon search)


Thu Aug 09 03:59:07 GMT 2007 From /weblog/languages

schema


Case study of using schema in web application - http://blog.plt-scheme.org[..]erience-report-scheme-in-commercial.html

I would wonder how the commercial firm found ppl to support the application if they don't support it...

(google search) (amazon search)