Skip to content

[C++] Intermittent Segmentation fault Mutex MacOS #2943

@gatkinso

Description

@gatkinso

Version 3.2.0
C++
MacOS Sierra

Intermittent Segmentation fault when statically linking to libprotobufd. Same code is fine on Linux and Windows.

Debugger output:

hostname:testfolder gat$ lldb ./foo
(lldb) target create "foo"
Current executable set to 'foo' (x86_64).
(lldb) run
Process 18781 launched: '/Users/gat/work/testfolder/foo' (x86_64)
Process 18781 stopped

  • thread Added const qualifier to iterator to enable compiling with VS2008 #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000102560d33 libbar.dylib`google::protobuf::internal::Mutex::Lock(this=0x0000000000000000) at common.cc:375
    372 }
    373
    374 void Mutex::Lock() {
    -> 375 int result = pthread_mutex_lock(&mInternal->mutex);
    376 if (result != 0) {
    377 GOOGLE_LOG(FATAL) << "pthread_mutex_lock: " << strerror(result);
    378 }
    (lldb)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions