Thread: Failed to write file in C shared library

  1. #1
    Registered User
    Join Date
    Jul 2020

    Failed to write file in C shared library

    I'm trying modify encryption function
    used in securing data payload in VoIP communication. Now, I'm trying modify the encryption function on libsrtp which is used by the Asterisk server. Now, I am testing the implementation of the decryption method on the Asterisk server. I try to do it by writing into the data packet file received by the server. But when I build this libsrtp into a shared library ( and testing with communication, this causes the asterisk to force to stop. Does anyone know why this could happen? The code I wrote into the file I added has been tried in the usual ubuntu terminal using gcc and has been successful. The following code is added.

    FILE *fp:
    fprintf(fp,"write to file");

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Did you compile the lib for the right architecture of your server?
    $ file /lib/x86_64-linux-gnu/
    /lib/x86_64-linux-gnu/ ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, 
    $ file /lib/i386-linux-gnu/
    /lib/i386-linux-gnu/ ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked,
    > fp=fopen("/home/ubuntu/Documents/test_decrypt.txt","a+");
    You also need to pick a directory that actually exists on the server.
    In addition, make sure that directory is writeable by the UID(s) of the processes which make use of the library.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 09-17-2019, 07:09 PM
  2. Replies: 0
    Last Post: 09-17-2019, 07:09 PM
  3. cannot find pdb file/injection of runtime library failed
    By methodos in forum Game Programming
    Replies: 1
    Last Post: 06-07-2012, 05:04 PM
  4. Replies: 1
    Last Post: 08-16-2009, 05:49 AM
  5. shared library for QNX
    By ReeV in forum C Programming
    Replies: 3
    Last Post: 05-06-2009, 10:58 AM

Tags for this Thread