Giter VIP home page Giter VIP logo

Comments (3)

smtakeda avatar smtakeda commented on August 12, 2024

Removing this option resolved:

--run-libc-freeres=no

from libsnowflakeclient.

smtakeda avatar smtakeda commented on August 12, 2024

The option was added to mitigate this: snowflakedb/pdo_snowflake#15
for PHP PDO tests. For C API, let's remove it.

from libsnowflakeclient.

smtakeda avatar smtakeda commented on August 12, 2024

For future reference, here is a simple test case that causes the valgrind error:

#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>

static void *chunk_downloader_thread(void *downloader) {
    printf("STARTING thread \n");
    printf("EXITING thread...\n");
    sleep(1);
    return NULL;
}
int main() {
    pthread_t t;
    printf("create: %d\n", pthread_create(&t, NULL, &chunk_downloader_thread, (void*)NULL));
    printf("join: %d\n", pthread_join(t, NULL));
    exit(0);
}
gcc -pthread test_simple_thread.c
valgrind --tool=memcheck --leak-check=full --run-libc-freeres=no ./a.out
==24498== Memcheck, a memory error detector
==24498== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==24498== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==24498== Command: ./a.out
==24498== 
create: 0
STARTING thread 
EXITING thread...
join: 0
==24498== 
==24498== HEAP SUMMARY:
==24498==     in use at exit: 560 bytes in 1 blocks
==24498==   total heap usage: 1 allocs, 0 frees, 560 bytes allocated
==24498== 
==24498== 560 bytes in 1 blocks are possibly lost in loss record 1 of 1
==24498==    at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==24498==    by 0x39D3811D02: _dl_allocate_tls (in /lib64/ld-2.12.so)
==24498==    by 0x39D44072CC: pthread_create@@GLIBC_2.2.5 (in /lib64/libpthread-2.12.so)
==24498==    by 0x4006E7: main (in /home/stakeda/test_cpp/a.out)
==24498== 
==24498== LEAK SUMMARY:
==24498==    definitely lost: 0 bytes in 0 blocks
==24498==    indirectly lost: 0 bytes in 0 blocks
==24498==      possibly lost: 560 bytes in 1 blocks
==24498==    still reachable: 0 bytes in 0 blocks
==24498==         suppressed: 0 bytes in 0 blocks
==24498== 
==24498== For counts of detected and suppressed errors, rerun with: -v
==24498== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 8 from 6)

Again this is false alarm. We should not use --run-libc-freeres=no unless really needed.

from libsnowflakeclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.