assert() causes segfault on x86-64

Bug #674073 reported by Loïc Minier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi

in bug #647527, I report an assertion failure when glibc looks up the pagesize.

I get a SIGSEGV when eglibc tries printing the assertion failure; other people get a proper SIGABRT instead.

I suspect this is x86-64 versus x86.

I tried writing a small program using assert() but I didn't get any assertion failure.

It might be that very early assertions in glibc don't work due to some missing initialization?

Cheers,

Revision history for this message
Richard Kapolnai (richardkapolnai) wrote :

I don't think it depends on your arch, I tried it in a chrooted amd64 architecture, and it gave the same assertion failed.

Isn't arena_get related to threads? Why does your compilation use threads and mine not?
Just curiosity, some time ago in SLC5 there was a problem in static libc.a when printing to stderr, does this code works for you?

// build with g++ -static prog.cpp
#include <pthread.h>
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
 cerr << "HELLO\n"; // Here a segfault was raised in some version of libc
 cerr << "NEVER REACHED" << endl; // So this was never printed
 cout << "ThreadID: " << hex << pthread_self() << endl;
}

Revision history for this message
Loïc Minier (lool) wrote :

I think arena is related to the malloc implementation?

prog.cpp outputs:
HELLO
NEVER REACHED
ThreadID: 1270860

and returns fine.

(built with g++ -static -pthread prog.cpp)

Revision history for this message
Richard Kapolnai (richardkapolnai) wrote :

Thanks.
Yes, quoting from glibc source comment (arena.c) :
"Malloc implementation for multiple threads without lock contention. [...] arena_get() [...] locks the corresponding mutex."

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.