discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gnuradio on ARM: gr_vmcircbuf_sysv_shm: shmat (3)


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] gnuradio on ARM: gr_vmcircbuf_sysv_shm: shmat (3): Invalid argument
Date: Thu, 18 Apr 2013 09:10:33 -0400

On Thu, Apr 18, 2013 at 8:57 AM, Philip Balister <address@hidden> wrote:
> On 04/17/2013 07:28 PM, Monahan-Mitchell, Tim wrote:
>> gnuradio maint branch, v.3.6.4.1
>>
>> 'make test' fails, due to gr-core-test-all failing.
>>
>> At first, I was getting an error due to the "shmat (2)" line above where 
>> this error occurs, but it has settled on (3).
>> I added a couple lines of extra debug output (source code is below the error 
>> output).
>
> I am digging into repressed memories here, so people cirrect me if I am
> wrong.
>
> GNU Radio allocates a large buffer to use for block input/output
> buffers. It has about three ways to do this, one of which uses shmem
> calls. These calls fail on arm due to some internal difference between
> x86 and arm. (I forget what the detail is)
>
> Since this fails, it tries another allocator that succeeds and saves
> this info in a dot file. I think you see the message from gnuradio once,
> then you do not see it again.
>
> Philip

Yep, that's right.

Tom


>> test 6
>>         Start   6: gr-core-test-all
>>
>> 6: Test command: /bin/sh 
>> "/src/gnuradio/build/gnuradio-core/src/tests/gr-core-test-all_test.sh"
>> 6: Test timeout computed to be: 9.99988e+06
>> 6: Testing gr_vmcircbuf_createfilemapping_factory...
>> 6: gr_vmcircbuf_createfilemapping: createfilemapping is not available
>> 6: ....... gr_vmcircbuf_createfilemapping_factory: Doesn't work
>> 6: Testing gr_vmcircbuf_sysv_shm_factory...
>> 6: gr_vmcircbuf_sysv_shm: shmat (3): Invalid argument
>> 6: gr_vmcircbuf_sysv_shm: shmid1=163842, first_copy+pagesize=0x40039000
>> 6: ....... gr_vmcircbuf_sysv_shm_factory: Doesn't work
>> 6: Testing gr_vmcircbuf_mmap_shm_open_factory...
>> 6: ....... gr_vmcircbuf_mmap_shm_open_factory: OK
>> 6: Testing gr_vmcircbuf_mmap_tmpfile_factory...
>> 6: ....... gr_vmcircbuf_mmap_tmpfile_factory: OK
>> 6: ...........................NOTICE: test from c++ NOTICE
>> 6: DEBUG: test from c++ DEBUG
>> 6: INFO: test from c++ INFO
>> 6: WARN: test from c++ WARN
>> 6: ERROR: test from c++ ERROR
>> 6: FATAL: test from c++ FATAL
>> 6: .....Using Volk machine: generic
>>
>> Snippet from gr_vmcircbuf_sysv_shm.cc :
>>
>>   // There may be a race between our detach and attach.
>>   //
>>   // If the system allocates all shared memory segments at the same
>>   // virtual addresses in all processes and if the system allocates
>>   // some other segment to first_copy or first_copoy + size between
>>   // our detach and attach, the attaches below could fail [I've never
>>   // seen it fail for this reason].
>>
>>   //shmdt (first_copy);
>>
>>   if (shmdt (first_copy) == -1){
>>     perror("gr_vmcircbuf_sysv_shm: shmdt (a)"); // Debug line added
>>   }
>>
>>   // first read-only guard page
>>   if (shmat (shmid_guard, first_copy, SHM_RDONLY) == (void *) -1){
>>     perror ("gr_vmcircbuf_sysv_shm: shmat (2)");
>>     fprintf (stderr, "gr_vmcircbuf_sysv_shm: shmid_guard=%d, 
>> first_copy=0x%x\n", shmid_guard, (unsigned int) first_copy);
>>     shmctl (shmid_guard, IPC_RMID, 0);
>>     shmctl (shmid1, IPC_RMID, 0);
>>     throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
>>   }
>>
>>   // first copy
>>   if (shmat (shmid1, (char *) first_copy + pagesize, 0) == (void *) -1){
>>     perror ("gr_vmcircbuf_sysv_shm: shmat (3)");
>>     fprintf (stderr, "gr_vmcircbuf_sysv_shm: shmid1=%d, 
>> first_copy+pagesize=0x%x\n", shmid1, (unsigned int) ((char *) first_copy + 
>> pagesize));
>>     shmctl (shmid_guard, IPC_RMID, 0);
>>     shmctl (shmid1, IPC_RMID, 0);
>>     shmdt (first_copy);
>>     throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
>>   }
>>
>> On an earlier test run where the shmat (2) line failed, this was the debug 
>> output from the above code:
>>
>> 6: Testing gr_vmcircbuf_sysv_shm_factory...
>> 6: gr_vmcircbuf_sysv_shm: shmat (2): Invalid argument
>> 6: gr_vmcircbuf_sysv_shm: shmid_guard=98304, first_copy=0x400e9000
>>
>> Not sure how this will affect my system. Posting this more of an FYI.
>>
>> I can add more details about the build if needed.
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]