Bitcoin testnet3: unable to push/publish raw transaction: how to verify validity of transaction?
Found the error!

I am using OpenSSL library and was signing using the function: ECDSA_Sign

The parameter unsigned int *siglen passed to this function is supposed to be filled with signature length. I was using the signature(parameter sig) and the length from parameter siglen to serialize the data. Turns out, although the signature being generated was always 72 bytes, the siglen parameter was filled seemingly randomly with 70, 71 or 72. And hence the number of bytes of signature that was being copied into my txn was not correct. Interestingly, if I call ECDSA_size(key) after making call to ECDSA_Sign(), i would get correct 72 value back.

AAAAh! Has anyone experienced this issue before with ECDSA_Sign? I haven't found anything on google yet.

But successfully posted the raw signed transaction using blockcypher's web tool/api.