2009-02-27 07:46:44 Problem with Shared Memory / MPU
der knut (GERMANY)
Message: 70094
Hello,
we use shared memory to pass information from our main app. to the webserver for display it to the user. With shmget/shmat/.. it works fine with ARM/MMU.
If I try to port this to BF526 / uClinux / SVN trunk / bfin-linux-uclibc I get strange behavior:
1) Both, app. and webserver, work fine single started but can not run together
2) If I activate MPU, none of the app. run, get exception on first read/write from/to shared memory. Return values and adresses looks good if I call shmget / shmat, the memory adress ist a valid dyn. memory.
Data access CPLB protection violation
- Attempted read or write to Supervisor resource,
or illegal data memory access.
Kernel process context
CURRENT PROCESS:
COMM=ets PID=482
TEXT = 0x01000000-0x0131b9b8 DATA = 0x015009b8-0x015e32ac
BSS = 0x015e32ac-0x01440000 USER-STACK = 0x0145fee0
return address: [0x0118d17e]; contents of:
0x0118d150: 801a 5008 3210 9110 e801 0000 0010 0000
0x0118d160: e800 0002 bbeb b9ea e410 2424 3210 9110
0x0118d170: 0c00 1836 b9ea e410 2424 3210 9152 [9950]
0x0118d180: 4300 e121 004c 0808 1028 b9ea e410 2424
SEQUENCER STATUS: Tainted: P
SEQSTAT: 00060023 IPEND: 0030 SYSCFG: 0006
EXCAUSE : 0x23
RETE: <0x00000000> { _run_init_process + 0xfffff000 }
RETN: <0x006f2000> /* kernel dynamic memory */
RETX: <0x00000480> /* Maybe fixed code section */
RETS: <0x0118d676> [ /opt/auerswald/ets + 0x18d676 ]
PC : <0x0118d17e> [ /opt/auerswald/ets + 0x18d17e ] // first read access to shm <0x01434000>
DCPLB_FAULT_ADDR: <0x01434000> [ /SYSV000009d0 (deleted) + 0x0 ] // shm adress returned by shmat()
ICPLB_FAULT_ADDR: <0x0000ffff> { _register_console + 0x8f }
...........................
What I am doing wrong?
Thanks a lot
Knut
shm_app.txt
shm_webserver.txt
TranslateQuoteReplyEditDelete
2009-02-27 10:16:02 Re: Problem with Shared Memory / MPU
Phil Wilshire (UNITED STATES)
Message: 70101
Knut,
Can you reproduce this error with a small code sample ( not the full app ) that you can post here.
Regards
Phil Wilshire
QuoteReplyEditDelete
2009-03-02 04:48:06 Re: Problem with Shared Memory / MPU
der knut (GERMANY)
Message: 70206
Hello Phil,
thank you for fast response. I wrote a little test on weekend, but I am only now in office again to test on hardware (BF526 Rev.0.0 / BF527 Rev 0.2). My BF537 Rev 0.2 STAMP board at home is to old and can not use MPU due an anomaly.
Attached little test "intest" init shared memory (shm) and write input to shm. "outtest" print first 10 characters from shm every second. Both exit if first charachter is 'X'. This works without MPU and cause a "Data access CPLB protection violation - attempted read or write to Supervisor resource, or illegal data memory access." if MPU is switched on at kernel config.
Thanks a lot for help
Knut
shmdemo.tgz
TranslateQuoteReplyEditDelete
2009-03-02 04:54:29 Re: Problem with Shared Memory / MPU
der knut (GERMANY)
Message: 70208
Ooops,
please ignore the double line
shm_id = shmget(1234, TEST_LEN, IPC_CREAT | 0666);
its a copy/paste artefact, but does not cause the problem.
Thanks a lot
Knut
TranslateQuoteReplyEditDelete
2009-03-02 11:37:08 Re: Problem with Shared Memory / MPU
Mike Frysinger (UNITED STATES)
Message: 70227
i'm guessing this works properly with the MPU turned off ?
QuoteReplyEditDelete
2009-03-03 01:39:12 Re: Problem with Shared Memory / MPU
der knut (GERMANY)
Message: 70246
Hello,
yes, no problem without MPU. But I am looking for another problem and hope MPU will help if it is working.
Thanks
Knut
TranslateQuoteReplyEditDelete
2009-03-03 02:08:36 Re: Problem with Shared Memory / MPU
Mike Frysinger (UNITED STATES)
Message: 70250
ive opened a tracker item so the issue can be looked at in more detail:
blackfin.uclinux.org/gf/tracker/4948
QuoteReplyEditDelete
2009-03-20 18:09:55 Re: Problem with Shared Memory / MPU
Mike Frysinger (UNITED STATES)
Message: 71321
can you update latest svn trunk and see if it works now ?