Dear Valgrind developers,

i am author of an embedded database libary; each program which links
against this library fails with the following assert if it's tested
with helgrind:

==18533== Possible data race during read of size 4 at 0x405fac0 by thread #4
==18533==    at 0x4031E23: env_lock_table (env.c:52)
==18533==    by 0x4035274: ham_env_create (hamsterdb.c:388)
==18533==    by 0x804B542: hamsterdb::create(unsigned int) (hamsterdb.cpp:28)
==18533==    by 0x80499B3: engine::create() (engine.cpp:42)
==18533==    by 0x80492DF: parser::process_line(char*) (parser.cpp:74)
==18533==    by 0x80495D5: parser::process() (parser.cpp:51)
==18533==    by 0x804A44E: __thread_func(void*) (main.cpp:155)
==18533==    by 0x4026BFE: mythread_wrapper (hg_intercepts.c:194)
==18533==    by 0x41994FA: start_thread (in
/lib/tls/i686/cmov/libpthread-2.7.so)
==18533==    by 0x43A5E5D: clone (in /lib/tls/i686/cmov/libc-2.7.so)
==18533==  This conflicts with a previous write of size 4 by thread #2
==18533==    at 0x4031E4C: env_lock_table (env.c:56)
==18533==    by 0x4035274: ham_env_create (hamsterdb.c:388)
==18533==    by 0x804B542: hamsterdb::create(unsigned int) (hamsterdb.cpp:28)
==18533==    by 0x80499B3: engine::create() (engine.cpp:42)
==18533==    by 0x80492DF: parser::process_line(char*) (parser.cpp:74)
==18533==    by 0x80495D5: parser::process() (parser.cpp:51)
==18533==    by 0x804A44E: __thread_func(void*) (main.cpp:155)
==18533==    by 0x4026BFE: mythread_wrapper (hg_intercepts.c:194)
started thread 1

Helgrind: libhb_core.c:3685 (msm_read): Assertion 'ordxx == POrd_EQ ||
ordxx == POrd_LT' failed.
==18533==    at 0x3801C50D: report_and_quit (m_libcassert.c:140)
==18533==    by 0x3801C811: vgPlain_assert_fail (m_libcassert.c:205)
==18533==    by 0x3800CB43: zsm_apply32___msm_read (libhb_core.c:3685)
==18533==    by 0x38015639: evh__mem_help_read_4 (hg_main.c:1752)
==18533==    by 0x62F47CD6: ???
==18533==    by 0x38093995: myvprintf_int64 (m_debuglog.c:595)
==18533==    by 0x35: ???
==18533==    by 0x65221C7C: ???
==18533==    by 0xA: ???

sched status:
  running_tid=4

Thread 1: status = VgTs_WaitSys
==18533==    at 0x40007F2: (within /lib/ld-2.7.so)
==18533==    by 0x40240FF: pthread_join (hg_intercepts.c:249)
==18533==    by 0x804A4D0: join_thread(unsigned long) (main.cpp:162)
==18533==    by 0x804A99D: main (main.cpp:201)

Thread 2: status = VgTs_WaitSys
==18533==    at 0x40007F2: (within /lib/ld-2.7.so)
==18533==    by 0x402F4AA: os_fileio_pwrite (posix_fileio.c:143)
==18533==    by 0x403370B: __f_write (device.c:134)
==18533==    by 0x4040285: page_write (page.c:127)
==18533==    by 0x403D702: indexfile_page_write (indexfile.c:477)
==18533==    by 0x403D4BD: indexfile_page_allocate (indexfile.c:424)
==18533==    by 0x403D7B5: indexfile_create_index (indexfile.c:505)
==18533==    by 0x403B387: db_new (db.c:75)
==18533==    by 0x4034BA8: __create_db (hamsterdb.c:192)
==18533==    by 0x4036435: ham_env_create_db (hamsterdb.c:888)
==18533==    by 0x804B5A2: hamsterdb::create(unsigned int) (hamsterdb.cpp:32)
==18533==    by 0x80499B3: engine::create() (engine.cpp:42)
==18533==    by 0x80492DF: parser::process_line(char*) (parser.cpp:74)
==18533==    by 0x80495D5: parser::process() (parser.cpp:51)
==18533==    by 0x804A44E: __thread_func(void*) (main.cpp:155)
==18533==    by 0x4026BFE: mythread_wrapper (hg_intercepts.c:194)
==18533==    by 0x41994FA: start_thread (in
/lib/tls/i686/cmov/libpthread-2.7.so)
==18533==    by 0x43A5E5D: clone (in /lib/tls/i686/cmov/libc-2.7.so)

Thread 3: status = VgTs_WaitSys
==18533==    at 0x40007F2: (within /lib/ld-2.7.so)

Thread 4: status = VgTs_Runnable
==18533==    at 0x402E150: (within
/home/chris/prj/hamsterdb2-tests/trunk/env/posix/libhamsterdb2.so.0)
==18533==    by 0x403637A: ham_env_create_db (hamsterdb.c:874)
==18533==    by 0x4035337: ham_env_create (hamsterdb.c:414)
==18533==    by 0x804B542: hamsterdb::create(unsigned int) (hamsterdb.cpp:28)
==18533==    by 0x80499B3: engine::create() (engine.cpp:42)
==18533==    by 0x80492DF: parser::process_line(char*) (parser.cpp:74)
==18533==    by 0x80495D5: parser::process() (parser.cpp:51)
==18533==    by 0x804A44E: __thread_func(void*) (main.cpp:155)
==18533==    by 0x4026BFE: mythread_wrapper (hg_intercepts.c:194)
==18533==    by 0x41994FA: start_thread (in
/lib/tls/i686/cmov/libpthread-2.7.so)
==18533==    by 0x43A5E5D: clone (in /lib/tls/i686/cmov/libc-2.7.so)


Note: see also the FAQ.txt in the source distribution.
It contains workarounds to several common problems.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what Linux distro you are using.  Thanks.


I use valgrind 3.4.1 on Ubuntu 8.x (intel x86). I think that this bug
is a duplicate of https://bugs.kde.org/show_bug.cgi?id=181394. If you
want, i can offer my test program and the library to help debugging.

drd crashes, too: drd: drd_thread.c:796 (thread_stop_recording):
Assertion 's_threadinfo[tid].is_recording' failed.

I can provide you with more information if necessary.

Best regards
Christoph

PS: thanks for valgrind, it makes me enjoy my life :)

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to