Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
51 user(s) are online (36 user(s) are browsing Forums)

Members: 0
Guests: 51

more...

Headlines

 
  Register To Post
« 1 (2)

Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
@MigthyMax

if it is a hexdump of a struct I think something has happened when
you are copying/transfering the struct... I do hope you know that
everything coming over network does not need to be swapped, you
are safe in that respect on the amiga... the same goes for
sending data on the network, you should not do anything with it
before sending the data.

Go to top
Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
@trgswe

Good to know that i don't need to swap the data. That was a little question in back mind, which got answered now.
Will see that i rewrite the network read/write stuff.

Go to top
Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
@jabirulo

Whenever you make your next test run. If you can give the debug output and maybe even the a wireshark capturing would be nice.

Go to top
Re: Strange AllocVec Problem
Quite a regular
Quite a regular


See User information
@MigthyMax

ok, noted. will use wireshark next time I test.

I captured the last debug ouptut. here it is:
smb2_output

Go to top
Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
I'm starting to really giving up on this. I've rewritten a lot of my code to clean it up and so on.
Now it just crashes without any hint what the cause could be. Now it even doesn't relate anymore to an nearby AllocVec call.
If I run my current program with debuglevel=20 the crash output looks like this:

[SMB2DEBUG ‘start’ Wait for network and signals 0x80008000 
[HAL_DfltTrapHandler] *** WarningFatal exception in task 0x6D664900 (Workbenchetask 0xEFF37CD0at ip 0x0183AD54
[HAL_AlertALERT0x80000003
[HAL_SuspendTaskWithUpdateSuspending 0x6D664900 with state=2DAR=0x0FDC6932at IP=0x0183AD54LR=0x0183AE8C 
[HAL_SuspendTaskWithUpdateAdding to suspend list 
[
HAL_SuspendTaskWithUpdateSetting Workbench to crashed 
[HAL_SuspendTaskWithUpdateContext 0xEFF21000 
kernel 54.30 
(1.1.2021AmigaOne X5000 debug 
Machine model
(AmigaOne X5000/20
Dump of context at 0xEFF21000 
Trap type
DSI exception 
DSISR
: 00800000  
DAR0FDC6932 
No matching page found 
Machine State 
(raw): 0x0002F030 
Machine State 
(verbose): [Critical Ints on] [ExtInt on] [User] [IAT on] [DAT on]  
Instruction pointerin module kernel.debug+0x0003AD54 (0x0183AD54
Crashed processWorkbench (0x6D664900
DSI verbose error descriptionAccess to address 0x0FDC6932 not allowed by page protection in user state (protection violation
Access was a store operation 
Exception Syndrome Register
0x00800000  
 0
: 01868B90 6CF35BC0 00000002 66F1DFDC 66F1DFDC 00000000 00000050 6CF35D28  
 8
: 018417B0 66F1DFDC 0FDC692E 80000001 35933593 0000000D 6FF0756C 02009E34 
16
02010000 02158BD8 02012AFC 02012AE8 01879228 02160000 020107E4 0201084
24
00000000 EFFFADC4 020000A0 02160000 01868B90 02160000 66F1D430 66F1DFDC 
CR
55933993   XERC000006F  CTR: 0183AE1C  LR: 0183AE8C  

Disassembly of crash site

[
_impl_GetInterfaceGetting interface mmu of library exec.library 
[_impl_GetInterfaceFound interface at 0x6FF9F000checking version 
[_impl_GetInterfaceReturning interface 0x6FF9F000 
[_impl_LockMemNot all memory was locked  
0183AD44A92A8B98   lha               r9,-29800(r10
[
_impl_LockMemNot all memory was locked  
0183AD48815E0000   lwz               r10,0(r30
[
_impl_LockMemNot all memory was locked  
0183AD4C2F890000   cmpwi             cr7,r9,
[_impl_LockMemNot all memory was locked  
0183AD50813E0004   lwz               r9,4(r30
[
_impl_LockMemNot all memory was locked 
>0183AD54912A0004   stw               r9,4(r10
[
_impl_LockMemNot all memory was locked  
0183AD5840DE0018   bne-              cr7,0x183AD70 
[_impl_LockMemNot all memory was locked  
0183AD5C83E1000C   lwz               r31,12(r1
[
_impl_LockMemNot all memory was locked  
0183AD607FC3F378   mr                r3,r30 
[_impl_LockMemNot all memory was locked  
0183AD6483C10008   lwz               r30,8(r1
[
_impl_LockMemNot all memory was locked  
0183AD6838210010   addi              r1,r1,16 
msr
0x0002B032 
TLB1 
(64 entries): 
 * [ 
50]: size=7 tid 0 TS 1 epn=0xFE000000 rpn=0x0000000F_FE000000 WIMG=0x5 XXWWRR=0xF protected 
 * [ 
51]: size=6 tid 0 TS 1 epn=0x01000000 rpn=0x00000000_01000000 WIMG=0x0 XXWWRR=0x5 protected 
 * [ 
52]: size=6 tid 0 TS 1 epn=0x01400000 rpn=0x00000000_01400000 WIMG=0x0 XXWWRR=0x5 protected 
 * [ 
53]: size=6 tid 0 TS 1 epn=0x01800000 rpn=0x00000000_01800000 WIMG=0x0 XXWWRR=0x33 protected 
 * [ 
54]: size=6 tid 0 TS 1 epn=0x01C00000 rpn=0x00000000_01C00000 WIMG=0x0 XXWWRR=0x33 protected 
 * [ 
55]: size=5 tid 0 TS 1 epn=0x02000000 rpn=0x00000000_02000000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
56]: size=5 tid 0 TS 1 epn=0x02100000 rpn=0x00000000_02100000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
57]: size=5 tid 0 TS 1 epn=0x02200000 rpn=0x00000000_02200000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
58]: size=4 tid 0 TS 1 epn=0x02300000 rpn=0x00000000_02300000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
59]: size=4 tid 0 TS 1 epn=0x02340000 rpn=0x00000000_02340000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
60]: size=3 tid 0 TS 1 epn=0x02380000 rpn=0x00000000_02380000 WIMG=0x0 XXWWRR=0xF protected 
 * [ 
61]: size=7 tid 0 TS 0 epn=0xFE000000 rpn=0x0000000F_FE000000 WIMG=0x5 XXWWRR=0xF protected 
 * [ 
62]: size=A tid 0 TS 0 epn=0x00000000 rpn=0x00000000_00000000 WIMG=0x0 XXWWRR=0x3F protected 
 * [ 
63]: size=A tid 0 TS 0 epn=0x40000000 rpn=0x00000000_40000000 WIMG=0x0 XXWWRR=0x3F protected HAL_MaxTLB 49HAL_NextTLB 
MMUCFG 
0x064809C4 
mas0 
0x103F0000 
mas1 
0xC0000A00 
mas2 
0x40000000 
mas3 
0x4000003F 
mas4 
0x00000100 
mas5 
0x00000000 
mas6 
0x00000001 
mas7 
0x00000000 
mas8 
0x00000000  

Kernel command line
serial munge debuglevel=10  

Registers pointing to code

[
_impl_OpenLibraryTrying to open dos.libraryversion 53 
[_impl_OpenLibraryFound library at 0x6FEA3228 
[_impl_OpenLibraryCalling Open vector of dos.library 
[_impl_OpenLibraryReturned from open vector 
[_impl_OpenLibraryLibrary node at 0x6FEA3228 
[_impl_OpenLibraryTrying to open elf.libraryversion 53 
[_impl_OpenLibraryFound library at 0x6FF02154 
[_impl_OpenLibraryCalling Open vector of elf.library 
[_impl_OpenLibraryReturned from open vector 
[_impl_OpenLibraryLibrary node at 0x6FF02154 
[_impl_GetInterfaceGetting interface main of library dos.library 
[_impl_GetInterfaceFound interface at 0x6F86E000checking version 
[_impl_GetInterfaceReturning interface 0x6F86E000 
[_impl_GetInterfaceGetting interface main of library elf.library 
[_impl_GetInterfaceFound interface at 0x6FFAB780checking version 
[_impl_GetInterfaceReturning interface 0x6FFAB780 
[SMB2DEBUG ‘start’ Wake up from WaitSelect with 0x00000001 ready descriptors and signals 0x00000000 
[SMB2DEBUG ‘start’ Reading from socket request 
[SMB2DEBUG ‘network’ NETWORK_processByteson socket 0 
[SMB2DEBUG ‘smbv2’ SMB2_Decoderheader address 0x66388B10 
[SMB2DEBUG ‘smbv2’ SMB2_DecoderCHECK ITFrame length is81 
[SMB2INFO ‘smbv2’ SMB2_DecoderDecoding SessionSetup Reponse Message ‘SMB2_COMMAND_SESSION_SETUP’ (1
[
SMB2DEBUG ‘smbv2’ decodeSessionSetupResponseheader address 0x66388B10 
[SMB2ERROR ‘smbv2’ decodeSessionSetupResponseGoing to allaocte 85 bytes


It looks like the crash is in parallel to the executing of my program and that workbench crashed, and thus my program continues to tun? But interaction is not possible because of the crashed workbench.

Obviously it must be something in my program, which causes the crash. But currently I'm out of ideas.

Anyone any idea how to further track down the cause?

Here is the current executable and the source.

Go to top
Re: Strange AllocVec Problem
Quite a regular
Quite a regular


See User information
@MigthyMax

Hi, not sure but as it seems the crash happens just here:

int readyDescriptors = ISocket->WaitSelect( socket +1,&readFds,&writeFds,&exceptFds,NULL,&signals );

have you checked that args you pass are valid/ok?

Just a silly cooment

Go to top
Re: Strange AllocVec Problem
Home away from home
Home away from home


See User information
@MigthyMax

Network programmering is really hard. on amigaos due to the way sockets work, sockets is not shared between threads/processes. Clib2 /newlib is also hiding the Amiga api, and gets in the way.

As for memory corruption, you need slow your program down, you can allocate som large memory blocks, you can just inspect for changes, crc checks. Or try to complete the same code on windows or Linux, bugs often show up other systems with better memory protection.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
@all

now i have the crash reproducible. And it crashes during a call to AllocVecTags.

Here the binary version, which crashes and the sources

The line which case the crash is in the file smb2_tree_connect.c in line 105:

...
struct SMB_Tree_Connect_Response *message IExec->AllocVecTags(
    
size,
    
AVT_Type,        MEMF_SHARED,
    
AVT_ClearWithValue,    0,
    
TAG_DONE );
if( 
message != NULL ) {
...


if i modified the source to this, which works as long you try to connect to an invalid share name:

...
struct SMB_Tree_Connect_Response *message = (struct SMB_Tree_Connect_Response *)header// IExec->AllocVecTags(
//    size,
//    AVT_Type,        MEMF_SHARED,
//    AVT_ClearWithValue,    0,
//    TAG_DONE );
if( message != NULL ) {
...


If you use a valid share name it can crash because of other circumstances.

Anyway i don't understand why/what on earth the call crashes. I even changed the memory type to MEMF_SHARED from MEMF-PRIVATE, maybe the bsdsocket library requires that?

Go to top
Re: Strange AllocVec Problem
Just popping in
Just popping in


See User information
@all

During writing my own post, i thought i switch AllocVecTag to calloc. And that seems to work. Why?

Go to top
Re: Strange AllocVec Problem
Home away from home
Home away from home


See User information
@MigthyMax

I think size variable might be 0, try replace with sizeof(struct SMB_Tree_Connect_Response), maybe calloc allocs extra bytes.

Also consider using “new” and “delete”, instead of calloc/malloc/free, and , AllocVec/FreeVec,
source code often becomes more readable using classes, and it more likely your code will have less bugs.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Strange AllocVec Problem
Quite a regular
Quite a regular


See User information
@MigthyMax

as LiveForIt posted, change to:

struct SMB_Tree_Connect_Response *message = (struct SMB_Tree_Connect_Response *)IExec->AllocVecTags(
//    size,
sizeof(struct SMB_Tree_Connect_Response),
    AVT_Type,        MEMF_SHARED,
    AVT_ClearWithValue,    0,
    TAG_DONE );

and see what happens.

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project