Re: seg fault on dsm_create call

From: Andrej <andrej(dot)groups(at)gmail(dot)com>
To: Max Fomichev <max(dot)fomitchev(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: seg fault on dsm_create call
Date: 2016-06-29 03:01:32
Message-ID: CACMx3pN7maQi4AgMYG1UgkmCu8AP+UdLC7LXTHEBv064XqM7=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 29 June 2016 at 00:47, Max Fomichev <max(dot)fomitchev(at)gmail(dot)com> wrote:
> Hello.
> I'm trying to understand how to work with dynamic shared memory, message
> queues and workers.
> The problem is I can not initialize a dsm segment -
>
> void _PG_init() {
> ...
> dsm_segment *seg = dsm_create(32768, 0); // Segmentation fault here

> Also I was trying to move dsm_create call to a worker, but with the same
> result -
>
> static void mainProc(Datum) {
> ...
> dsm_segment *seg = dsm_create(32768, 0); // Segmentation fault here
> ...
> pqsignal(SIGTERM, mystemSigterm);
> BackgroundWorkerUnblockSignals();
> ...
>
> What could be a reason and what am I doing wrong?
>
> PS test/modules/test_shm_mq works fine...

I'm no expert in C programming (or postgres, as it were), but
test/modules/test_shm_mq seems to call the function w/ only one
parameter, not two?

> --
> Best regards,
> Max Fomichev

Cheers,
Andrej

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bob Cochran 2016-07-01 15:53:03 initdb failing on REL9_5_STABLE with exit code 132...
Previous Message Max Fomichev 2016-06-28 12:47:12 seg fault on dsm_create call