BUS_ADRALN 에러 관련하여 질문있습니다.

musfield의 이미지

pjsip 라고 오픈소스 sip 스택을 solaris 10에 64bit 컴파일해서 깔려고 합니다.근데 빌드는 잘되는데, 런타임 때 다음과 같은 에러가 뜨면서 코어덤프가 나네요.32bit 으로 컴파일 했을 때는 문제가 없습니다.

truss 로 살펴보면..

Incurred fault #5, FLTACCESS %pc = 0x10002EF50
siginfo: SIGBUS BUS_ADRALN addr=0x10014CD94
Received signal #10, SIGBUS [default]
siginfo: SIGBUS BUS_ADRALN addr=0x10014CD94

문제가 되는 코드를 간략하게 보여드리면

struct pj_hash_table_t
{
    pj_hash_entry     **table;
    unsigned        count, rows;
    pj_hash_iterator_t  iterator;
};
 
 
PJ_DEF(pj_hash_table_t*) pj_hash_create(pj_pool_t *pool, unsigned size)
{
    pj_hash_table_t *h;
    unsigned table_size;
...........................................
 
    <span>h = PJ_POOL_ALLOC_T(pool, pj_hash_table_t);</span>
    h->count = 0;
 
    PJ_LOG( 6, ("hashtbl", "hash table %p created from pool %s", h,        pj_pool_getobjname(pool)));
 
    /* size must be 2^n - 1.
       round-up the size to this rule, except when size is 2^n, then size
       will be round-down to 2^n-1.
     */
    table_size = 8;
    do {
    table_size <<= 1;
    } while (table_size < size);
    table_size -= 1;
 
    h->rows = table_size;
    <span>h->table = (pj_hash_entry**)pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));</span>
    return h;
}

위에서 두번째로, 굵은 글씨로 표기된 부분이 문제가 되는 부분입니다. h->table 변수에, pj_pool_calloc 으로 얻어진 메모리 주소값을 allign 하는 과정에서 코어가 발생합니다.
참고로 위의 truss 에서 addr=0x10014CD94 이 h->table 변수의 주소값입니다.
PJ_POOL_ALLOC_T , pj_pool_calloc 모두 내부 pool 에 할당된 size 만큼의 메모리 공간의 주소를 리턴해주는 내부 함수입니다.

pj_hash_entry **temp = (pj_hash_entry**)pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));

이런 식으로 했을 때는 문제가 되지 않는데요.

BUS_ADRALN SIGBUS 에러가 어떤 경우에 발생하는 에러인가요?
pj_hash_create를 호출할 때마다 코어덤프가 발생하는 것이 아니고, pj_hash_create를 한 세번 정도 호출한 뒤에 발생합니다.
32bit 으로 빌드했을 때 전혀 문제가 되지 않는데 왜 이런 문제가 발생하는지 도무지 감이 안 오네요.귀찮으시겠지만 좀 살펴봐주시고 의견 좀 부탁드립니다 ㅠㅠ


댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.