Hi,
in my program I use Asl file requester both through IASL->AslRequestTags and through getfile.gadget functions. I noticed that for some reason, both ways lead to crash if I give non-existing volume name to either ASLFR_InitialDrawer or entering such in the file requester Drawer field. If entering only non-existing drawer name (without volume name like Test:) causes fr to ask whether one should create a new drawer, as it should.
I extracted my Asl code to the file above. This code, however, doesn't crash but ask for reassignment as it should. I'm quite puzzled what's causing this. Would the GR log help to understand the problem. BTW, I don't have any global library bases stored in my program but using only the interfaces, would this affect asl.library?
I'm using AmigaOne X1000, OS41FE, the kernel.debug is effective.
Extracted code (which, runned separately, doesn't crash!)
and GR log through Sashimi (here, the SaveAsDoc() is the routine calling AslRequestTags. Note that requester starts properly. Crash comes when one enters the non-existing Test: volume name into Drawer field of requester.
Marko
#include <proto/asl.h> #include <proto/dos.h> #include <proto/exec.h> #include <libraries/asl.h> #include "string.h" /* ** compiled with: ** vc aslproblem.c -o ram:aslproblem +newlib */ struct AslIFace *IAsl; struct FileRequester *FileReq; struct Library *base; STRPTR Testname = "Test:testing"; int main(int ac,char *av[]) { STRPTR docname,dirname; int dirlen; if (base = IExec->OpenLibrary("asl.library",53L)) { if (IAsl = (struct AslIFace *)IExec->GetInterface(base,"main",1,NULL)) { FileReq = IAsl->AllocAslRequestTags(ASL_FileRequest, ASLFR_StayOnTop,TRUE, ASLFR_RejectIcons,TRUE, ASLFR_PrivateIDCMP,TRUE, ASLFR_SleepWindow,TRUE, ASLFR_DoPatterns,TRUE, TAG_DONE); dirlen = IDOS->FilePart(Testname) - Testname; if (dirname = IExec->AllocVecTags(dirlen+1,TAG_DONE)) { strncpy(dirname,Testname,dirlen); *(dirname+dirlen) = '\0'; /* note: strncpy doesn't put NUL if strlen(Testname) > dirlen! */ } if (FileReq) { IAsl->AslRequestTags(FileReq, ASLFR_TitleText,"Testing!", ASLFR_InitialDrawer,dirname, ASLFR_InitialFile,IDOS->FilePart(Testname), ASLFR_InitialPattern,"(#?.xml|#?.mxl)", ASLFR_DoSaveMode,TRUE, TAG_DONE); IAsl->FreeAslRequest(FileReq); } if (dirname) IExec->FreeVec(dirname); IExec->DropInterface((struct Interface *)IAsl); } IExec->CloseLibrary(base); } return(0); }
[_impl_AddTask] Adding Task 0x5a1a0a20, intuition.task (0x2834f9c) [_impl_AddTask] Task = 0x5a1a0a20, ETask = 0xdfb47e50, Context = 0xdfb9e3e0 [_impl_AddTask] Stack bottom = 0x52d20000, Stack top = 0x52d28000, Stack pointer = 0x52d27fd0 [_impl_AddTask] Task added to ready list [HAL_DfltTrapHandler] *** Warning: Fatal exception in task 0x55d41620 (ScoreGen, etask = 0xdfb47c10) at ip 0x21ee824 [HAL_Alert] ALERT! 0x80000003 Dump of context at 0xdfff4ba0 Trap type: DSI exception Machine State (raw): 0x100000000200b030 Machine State (verbose): [Hyper] [ExtInt on] [Super] [FPU on] [IAT on] [DAT on] Instruction pointer: in module intuition.library.kmod+0x1b7e4 (0x21ee824) Crashed process: ScoreGen (0x55d41620) DSI verbose error description: Access not found in hash or BAT (page fault) Access was a load operation 0: 021ee92c 57cc1370 00000000 6fe39088 00000000 cafead83 57cc1408 cafead83 8: 02029bf4 02b40000 00000000 6ff364d0 44422088 7fd5d440 cafeabad 624353d4 16: 5960d48c 57cc1a44 00000000 00000000 61510000 6fc445d0 616eba10 615150a0 24: 0000000d 5960d48c 57cc1840 57cc1408 6ff364d0 cafead83 6fe39088 61bfd020 CR: 84422088 XER: 20000000 CTR: 021ee76c LR: 021ee818 DSISR: 40000000 DAR: cafead83 FP0 : fff8000082004000 ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf FP4 : ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf FP8 : ffcfcfcfffcfcfcf ffcfcfcfffcfcfcf 0000000000000000 4330000080000568 FP12: 4330000080000368 4088480000000000 0000000000000000 0000000000000000 FP16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FP20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FP24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FP28: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR: 82004000 HID0: 0x8000000000000000 HID1: 0x000000005ce993b1 HID4: 0x4400240000080180 HID5: 0x0000006600000080 V0 : 00000000000000000000000000000000 08090a0b0c0d0e0f1011121314151617 V2 : ffcfcfcfffcfcfcfffcfcfcfffcfcfcf ff01cf31ff01cf31ff01cf31ff01cf31 V4 : ff01cf31ff01cf31ff01cf31ff01cf31 cf31cf31cf31cf31cf31cf31cf31cf31 V6 : ff01cf31ff01cf31ff01cf31ff01cf31 fe01ce31fe01ce31fe01ce31fe01ce31 V8 : fe01ce31fe01ce31fe01ce31fe01ce31 ffcfcfcfffcfcfcfffcfcfcfffcfcfcf V10: ffcfcfcfffcfcfcfffcfcfcfffcfcfcf cf31cf31cf31cf31cf31cf31cf31cf31 V12: ff01cf31ff01cf31ff01cf31ff01cf31 ffcfcfcfffcfcfcfffcfcfcfffcfcfcf V14: 001002120414061608180a1a0c1c0e1e 01000100010001000100010001000100 V16: ff000000ff000000ff000000ff000000 ffcfcfcfffcfcfcfffcfcfcfffcfcfcf V18: fe01ce31fe01ce31fe01ce31fe01ce31 ffcfcfcfffcfcfcfffcfcfcfffcfcfcf V20: 00000000000000000000000000000000 00000000000000000000000000000000 V22: 00000000000000000000000000000000 00000000000000000000000000000000 V24: 00000000000000000000000000000000 00000000000000000000000000000000 V26: 00000000000000000000000000000000 00000000000000000000000000000000 V28: 00000000000000000000000000000000 00000000000000000000000000000000 V30: 00000000000000000000000000000000 00000000000000000000000000000000 VSCR: 00000000 VRSAVE: 00000000 Disassembly of crash site: 021ee814: 4e800421 bctrl 021ee818: 2f9d0000 cmpwi cr7,r29,0 021ee81c: 7c7e1b78 mr r30,r3 021ee820: 419e0058 beq- cr7,0x21EE878 >021ee824: a01d0000 lhz r0,0(r29) 021ee828: 2b800002 cmplwi cr7,r0,2 021ee82c: 409d004c ble- cr7,0x21EE878 021ee830: 807d001e lwz r3,30(r29) 021ee834: 2f830000 cmpwi cr7,r3,0 021ee838: 419e00a4 beq- cr7,0x21EE8DC Kernel command line: DEBUGLEVEL=5 SERIAL MUNGE Registers pointing to code: r0 : native kernel module intuition.library.kmod+0x0001b8ec r8 : native kernel module kernel.debug+0x00029bf4 r9 : native kernel module graphics.library.kmod+0x0082a120 r13: module LIBS:xadmaster.library at 0x7FD5D440 (section 5 @ 0x741C) r20: module IPrefs at 0x61510000 (section 4 @ 0xFDC) r23: module IPrefs at 0x615150A0 (section 4 @ 0x607C) ip : native kernel module intuition.library.kmod+0x0001b7e4 lr : native kernel module intuition.library.kmod+0x0001b7d8 ctr: native kernel module intuition.library.kmod+0x0001b72c Stack trace: (0x57cc1370) native kernel module intuition.library.kmod+0x0001b7e4 (0x57cc1390) native kernel module intuition.library.kmod+0x0001b7d8 (0x57cc1400) module CLASSES:requester.class at 0x7FAF450C (section 5 @ 0x44E8) (0x57cc1740) native kernel module intuition.library.kmod+0x00020da8 (0x57cc17a0) native kernel module intuition.library.kmod+0x00020f4c (0x57cc1820) native kernel module intuition.library.kmod+0x0000a044 (0x57cc1830) module IPrefs at 0x7FF513F4 (section 5 @ 0xF3D0) (0x57cc1950) native kernel module dos.library.kmod+0x00032b20 (0x57cc19d0) native kernel module dos.library.kmod+0x00025e3c (0x57cc1d10) native kernel module dos.library.kmod+0x0000dcdc (0x57cc1d30) native kernel module dos.library.kmod+0x0000e214 (0x57cc1f90) native kernel module dos.library.kmod+0x0001636c (0x57cc22a0) native kernel module dos.library.kmod+0x00015f50 (0x57cc22b0) native kernel module dos.library.kmod+0x0001afbc (0x57cc2310) module LIBS:asl.library at 0x7FAB2080 (section 5 @ 0xD05C) (0x57cc28b0) module LIBS:asl.library at 0x7FAB6D54 (section 5 @ 0x11D30) (0x57cc2920) module LIBS:asl.library at 0x7FAA6028 (section 5 @ 0x1004) (0x57cc29a0) module LIBS:asl.library at 0x7FAA5AF4 (section 5 @ 0xAD0) (0x57cc2a10) SaveAsDoc()+0x1b4 (section 7 @ 0x76400) (0x57cc2a90) HandleDocInput()+0x1110 (section 7 @ 0x6320C) (0x57cc2ba0) Doc_Dispatch()+0x4d0 (section 7 @ 0x5EB0C) (0x57cc2c80) MainGUI()+0x2bc (section 7 @ 0x4D608) (0x57cc2ce0) main()+0x5c (section 7 @ 0x4E9D8) (0x57cc2d00) native kernel module newlib.library.kmod+0x000020a4 (0x57cc2d70) native kernel module newlib.library.kmod+0x00002d0c (0x57cc2f10) native kernel module newlib.library.kmod+0x00002ee8 (0x57cc2f50) _start()+0x16c (section 7 @ 0x168) (0x57cc2f90) native kernel module dos.library.kmod+0x00024c18 (0x57cc2fc0) native kernel module kernel.debug+0x00069b3c (0x57cc2fd0) native kernel module kernel.debug+0x00069bbc Disassembly of crash site: 021ee814: 4e800421 bctrl 021ee818: 2f9d0000 cmpwi cr7,r29,0 021ee81c: 7c7e1b78 mr r30,r3 021ee820: 419e0058 beq- cr7,0x21EE878 >021ee824: a01d0000 lhz r0,0(r29) 021ee828: 2b800002 cmplwi cr7,r0,2 021ee82c: 409d004c ble- cr7,0x21EE878 021ee830: 807d001e lwz r3,30(r29) 021ee834: 2f830000 cmpwi cr7,r3,0 021ee838: 419e00a4 beq- cr7,0x21EE8DC Stack pointer (0x57cc1370) is inside bounds Redzone is OK (4) 68k register dump DATA: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ----> 00000001 - "DEVS:lpr.device" Hunk 0000 Offset 00000000 (SegList: 0x1658912d) ADDR: 6ffb8700 9126bc00 00000000 00000000 00000000 00000000 00000000 57cc1150 Page information: Page not found [_impl_AddTask] Adding Task 0x596241b0, Background CLI (0x5a6302a0) [_impl_AddTask] Task = 0x596241b0, ETask = 0xdfb47e50, Context = 0xdfb9e3e0 [_impl_AddTask] Stack bottom = 0x5e3e9038, Stack top = 0x5e3ed024, Stack pointer = 0x5e3ecff0 [_impl_AddTask] Task added to ready list