Previous Thread
Next Thread
Print Thread
Weird mame197 doubly linked list error #113236
04/26/18 02:42 AM
04/26/18 02:42 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
I compiled mame197 and I've been getting some strange behavior under ubuntu 17.10.

Using my lua compile script, I like to have it execute mame64 after it compiles just to run it a few seconds. But it drops out prematurely.

so I launch my script with:
Code
/usr/bin/time make -j4 2>&1 | lua5.3 compiletime.lua | tee COMPILE_LOG.txt | nl




Code
-- compiletime.lua
-- This will take the input and print the time in seconds before the line.
-- Once complete it will print info about your system and run mame for a few seconds.
--
-- a nice compile command is something like:
-- make clean; /usr/bin/time make -j4 2>&1 | lua5.3 compiletime.lua | tee COMPILE_LOG.txt | nl


rompath = "\"../../roms""

function popenstr(str) local mypipe=io.popen(str,"r") local mystr=mypipe:read("*all") mypipe:close() return mystr end

arch_table={ x86_64 = "mame64", i686 = "mame" }

for archstr,arch_mamestr in pairs(arch_table) do
  if string.find(popenstr("uname -a"),archstr) then 
      mamebinarystr = arch_mamestr 
--    print(archstr,arch_mamestr) 
  end
end

assert(mamebinarystr,"arch not detected")

donestr = "DONE - COMPILE COMPLETE"

function iif(b,t,f) if b then return t  else return f end end 

l = os.time() while true do j = io.read() k = os.time() print (k-l,iif(j==nil,donestr,j)) if j==nil then break end end 

function print_and_execute(str) print(string.rep("=",80).."\n".."EXECUTING: "..str) os.execute(str) end

print_and_execute("cat /proc/meminfo | grep \"MemTotal\"")
print_and_execute("lscpu | grep \"Model name:\"")
print_and_execute("lscpu")
print_and_execute("lspci -nn | grep -E -i \"Display|VGA\"")
print_and_execute("lspci -nn")
print_and_execute("pwd")
print_and_execute("ls -l ./"..mamebinarystr.."")
print_and_execute("md5sum ./"..mamebinarystr.."")
print_and_execute("gcc --version | head -n 1")
print_and_execute("lsb_release -a")
print_and_execute("uname -a")
print_and_execute("date")
print_and_execute("lsmod | grep \"video\\|drm\"")

mamebase = "/usr/bin/time ./"..mamebinarystr.."  -sdlvideofps -rompath "..rompath.." 2>&1"

-- trying a different string to see if different results?
mamebase = "./"..mamebinarystr.." -seconds_to_run 15 -sdlvideofps -rompath ".."\"../../roms\"".." -skip_gameinfo"


mamegame = "pacman"

print_and_execute(mamebase.." "..mamegame.." -video opengl -verbose")

print_and_execute("echo done")
print(rompath)
os.execute("pwd")
os.execute("echo $SHELL")


Sometimes it will say stuff like Aborted (core dumped)

Code
   89	EXECUTING: ./mame64 -seconds_to_run 15 -sdlvideofps -rompath "../../roms" -skip_gameinfo pacman -video opengl -verbose
    90	    _/      _/    _/_/    _/      _/  _/_/_/_/
    91	   _/_/  _/_/  _/    _/  _/_/  _/_/  _/       
    92	  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/_/_/    
    93	 _/      _/  _/    _/  _/      _/  _/         
    94	_/      _/  _/    _/  _/      _/  _/_/_/_/    
       
    95	mame 0.197	
    96	Copyright (C) Nicola Salmoria and the MAME team
       
    97	Lua 5.3	
    98	Copyright (C) Lua.org, PUC-Rio
       
*snip*

   197	[MAME]> Region ':maincpu' created
   198	unzip: opened archive file ../../roms/puckman.zip
   199	unzip: found ../../roms/puckman.zip ECD
   200	unzip: ../../roms/puckman.zip has no ZIP64 ECD locator
   201	unzip: read ../../roms/puckman.zip central directory
   202	unzip: closing archive file ../../roms/puckman.zip and sending to cache
   203	unzip: found ../../roms/puckman.zip in cache
*** Error in `./mame64   204	unzip: opened archive file ../../roms/puckman.zip
Aborted (core dumped)



Other times it will say "corrupted double-linked list"


Code
   205	EXECUTING: ./mame64 pacman -rompath "../../roms" -skip_gameinfo
   206	    _/      _/    _/_/    _/      _/  _/_/_/_/
   207	   _/_/  _/_/  _/    _/  _/_/  _/_/  _/       
   208	  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/_/_/    
   209	 _/      _/  _/    _/  _/      _/  _/         
   210	_/      _/  _/    _/  _/      _/  _/_/_/_/    
       
   211	mame 0.197	
   212	Copyright (C) Nicola Salmoria and the MAME team
       
   213	Lua 5.3	
   214	Copyright (C) Lua.org, PUC-Rio
       
*** Error in `./mame64': corrupted double-linked list: 0x000055c2ec6893d0   215	[MAME]> ================================================================================
   216	EXECUTING: echo done



but most of the time it will just drop out prematurely instead of running it for 15 seconds.


If I just run mame from the command line it seems to work fine. I'm just baffled why it doesn't like to be executed from a lua5.3 script.

Re: Weird mame197 doubly linked list error [Re: Golden Child] #113300
04/30/18 05:25 PM
04/30/18 05:25 PM
Joined: Apr 2015
Posts: 367
E
EoceneMiacid Offline
Senior Member
EoceneMiacid  Offline
Senior Member
E
Joined: Apr 2015
Posts: 367
If you use io.popen instead of os.execute, does the problem still occur?


Moderated by  R. Belmont 

Who's Online Now
4 registered members (Aurel, Reznor007, mahlemiut, Edstrom), 65 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,566
Posts111,891
Members4,805
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.046s Queries: 14 (0.025s) Memory: 5.5884 MB (Peak: 5.7436 MB) Zlib enabled. Server Time: 2018-08-19 21:41:55 UTC