Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005688 [Squeak] VM crash always 12-30-06 20:51 03-08-09 13:36
Reporter lewis View Status public  
Assigned To tim
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0005688: VM crash due to SmartSyntaxPluginCodeGenerator>>generateCPtrAsOop:indent:
Description On a 64-bit host (e.g. 64 bit Linux), the VM will crash when attempting to connect to SqueakMap. This is caused by SmartSyntaxPluginCodeGenerator>>generateCPtrAsOop:indent: (in VMMaker 3.8b6), which fails to account for sqMemoryBase when deducing an oop from a pointer. Fix attached.
Additional Information
Attached Files  Fix64BitSmartSyntaxPluginCodeGenerator-dtl.1.cs.gz [^] (519 bytes) 12-30-06 20:51
 Fix64BitSmartSyntaxPluginCodeGenerator-0005688-tpr-dtl.cs [^] (954 bytes) 09-19-07 01:39

- Relationships

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

has duplicate 0006739closed tim Problems with images under 64-bit 
has duplicate 0006344closed lewis Crash while updating SqueakMap 
has duplicate 0006631closed lewis crash while connecting to SqueakMap 
child of 0006671closed tim Build VMMaker for 3.9 

- Notes
(0008782 - 748 - 760 - 760 - 760 - 760 - 760)
lewis
12-31-06 20:40

Additional notes: sqMemoryBase is defined only when building the 64 bit host/32 bit image combination. The patch I provided makes an explicit reference to sqMemoryBase, and this works fine on Linux (both 32 bit and 64 bit host) even if the SocketPlugin is built as an external plugin. However, I am not confident that it will work properly on other platforms, and I tested only on Linux.

Presumably it would be better to make sqMemoryBase visible through the interpreterProxy struct, rather than relying on an explicit reference (but this requires bumping the VM_PROXY_MINOR version), or alternatively make it a variable in ObjectMemory. But perhaps it would be better to just get rid of #cPtrAsOop entirely, and update all the effected plugins?
 
(0011136 - 926 - 1489 - 1489 - 1489 - 1489 - 1489)
tim
09-17-07 20:51

Dave's code is:-
generateCPtrAsOop: aNode on: aStream indent: anInteger
    "sqMemoryBase is declared as (char *) in platforms/Cross/vm/sqMemoryAccess.h"

    aStream nextPutAll: '((usqInt)(long)((char *)'.
    self emitCExpression: aNode receiver on: aStream.
    aStream nextPutAll: ' - sqMemoryBase ) - ';
         nextPutAll: ObjectMemory baseHeaderSize printString;
         nextPut: $)

Which as mentioned explicitly refers to sqMemoryBase. I'm going to suggest indirecting that just a little to use the pre-existing oopForPointer()

generateCPtrAsOop: aNode on: aStream indent: anInteger
    "derive the proper Oop for a C ptr - use oopForPointer to deal with any base offset"

    aStream nextPutAll: '((usqInt)(long)((char *)'.
       aStream nextPutAll: 'oopForPointer( '.
    self emitCExpression: aNode receiver on: aStream.
    aStream nextPutAll: ' ) - ';
         nextPutAll: ObjectMemory baseHeaderSize printString;
         nextPut: $)
 
(0011137 - 41 - 41 - 41 - 41 - 41 - 41)
lewis
09-18-07 00:22

Using oopForPointer() sounds right to me.
 
(0011138 - 151 - 151 - 151 - 151 - 151 - 151)
tim
09-18-07 01:58

I don't suppose you'd like to hack your code base to try it out while I get on with the miserably delayed putting-together-stuff-wot-others-wrote part?
 
(0011143 - 167 - 167 - 167 - 167 - 167 - 167)
lewis
09-18-07 11:03

I'll check it out on 32 and 64 bit host configurations, but I will be out of town and may not get to it until next week (will respond by Sept 26 at the latest though).
 
(0011146 - 414 - 414 - 414 - 414 - 414 - 414)
lewis
09-19-07 00:45

The oopForPointer() change works fine on H32/I32 and H64/I32, modulo a missing close paren, but I did not test H32/I64 or H64/I64. However this leaves a bunch of slimey typecasts in the method that probably are not necessary. Will try to fix this next week when I get home, mean time I suggest just apply my first change set if you want to update VMM right away, or wait until next week and I'll check it properly.
 
(0011147 - 288 - 336 - 336 - 336 - 336 - 336)
lewis
09-19-07 01:47
edited on: 09-19-07 01:48

Update attached: Fix64BitSmartSyntaxPluginCodeGenerator-0005688-tpr-dtl.cs

This has the oopForPointer() fix plus deuglifier ointment to remove extraneous type casts.

Tested on H32/I32, H32/I64, H64/I32, H64/I64. Confirmed that the VM crash problem is gone for H64/I32.

Ship it.

 
(0011596 - 18 - 18 - 18 - 18 - 18 - 18)
tim
12-27-07 23:58

In VMMaker-tpr.65
 
(0013023 - 50 - 50 - 50 - 50 - 50 - 50)
lewis
03-08-09 13:36

Included in VMMaker-tpr.65 on SqueakSource VMMaker
 

- Issue History
Date Modified Username Field Change
12-30-06 20:51 lewis New Issue
12-30-06 20:51 lewis File Added: Fix64BitSmartSyntaxPluginCodeGenerator-dtl.1.cs.gz
12-30-06 20:51 lewis Issue Monitored: lewis
12-31-06 20:40 lewis Note Added: 0008782
08-16-07 20:33 barger Issue Monitored: barger
09-12-07 00:36 tim Status new => assigned
09-12-07 00:36 tim Assigned To  => tim
09-14-07 00:01 tim Relationship added child of 0006671
09-17-07 20:51 tim Note Added: 0011136
09-18-07 00:22 lewis Note Added: 0011137
09-18-07 01:58 tim Note Added: 0011138
09-18-07 11:03 lewis Note Added: 0011143
09-19-07 00:45 lewis Note Added: 0011146
09-19-07 01:39 lewis File Added: Fix64BitSmartSyntaxPluginCodeGenerator-0005688-tpr-dtl.cs
09-19-07 01:47 lewis Note Added: 0011147
09-19-07 01:48 lewis Note Edited: 0011147
10-30-07 19:36 wiz Relationship added related to 0006739
12-27-07 23:58 tim Note Added: 0011596
12-27-07 23:59 tim Status assigned => resolved
12-27-07 23:59 tim Fixed in Version  => 3.9
12-27-07 23:59 tim Resolution open => fixed
12-28-07 18:08 tim Relationship replaced has duplicate 0006739
03-08-09 13:36 lewis Status resolved => closed
03-08-09 13:36 lewis Note Added: 0013023
03-08-09 13:39 lewis Relationship added has duplicate 0006344
03-08-09 13:39 lewis Relationship added has duplicate 0006631


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
102 total queries executed.
57 unique queries executed.
Powered by Mantis Bugtracker