Bugs item #2805513, was opened at 2009-06-12 17:22 Message generated for change (Comment added) made by tsheyar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2805513&group_id=56967
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: PF/runtime Group: Pathfinder "stable" Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ying Zhang (yingying) Assigned to: Nobody/Anonymous (nobody) Summary: fn:trace() produces output _and_ error Initial Comment: With May 2009 release, Algebra backend, calling fn:trace() results in a monet_sprintf error: $ echo 'fn:trace(<a>blah</a>, "test ")' | pf | Mserver # MonetDB Server v4.30.0 # based on GDK v1.30.0 # Copyright (c) 1993-July 2008, CWI. All rights reserved. # Copyright (c) August 2008-2009, MonetDB B.V.. All rights reserved. # Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. MonetDB># PF/Tijah module v0.13.0 loaded. http://dbappl.cs.utwente.nl/pftijah # MonetDB/XQuery module v0.28.3 loaded (default back-end is 'algebra') # XRPC administrative console at http://127.0.0.1:50001/admin MonetDB><?xml version="1.0" encoding="utf-8"?> <XQueryResult><a>blah</a></XQueryResult> MonetDB>!ERROR: monet_sprintf(): illegal type in param 1. !ERROR: print_format: operation failed. MonetDB> ---------------------------------------------------------------------- >Comment By: Jan Rittinger (tsheyar) Date: 2009-06-16 11:20 Message: I added casts to int in the MIL code as I didn't know what the 'real' problem was. Stefan, I think your fix is the better one :) Could you please apply it -- Thanks. ---------------------------------------------------------------------- Comment By: Stefan Manegold (stmane) Date: 2009-06-16 11:03 Message: What does Jan's patch do? ---------------------------------------------------------------------- Comment By: Stefan Manegold (stmane) Date: 2009-06-16 11:02 Message: On 64-bit systems with 64-bit OIDs, we get MonetDB>var o:=...@0; MonetDB>var i:=1; MonetDB>var l:=2LL; MonetDB>print(o); [ 0...@0 ] MonetDB>print(i); [ 1 ] MonetDB>print(l); [ 2 ] MonetDB>printf("%i\n",o); !ERROR: monet_sprintf(): illegal type in param 1. !ERROR: print_format: operation failed. MonetDB>printf("%lli\n",o); 0 MonetDB>printf("%i\n",i); 1 MonetDB>printf("%lli\n",i); 1 MonetDB>printf("%i\n",l); !ERROR: monet_sprintf(): illegal type in param 1. !ERROR: print_format: operation failed. MonetDB>printf("%lli\n",l); 2 MonetDB>printf("%lli\n",lng(o)); 0 MonetDB>printf("%s\n",str(o)); 0...@0 >From the code of monet_sprintf() in MonetDB4/src/monet/monet.mx, it appears to be save to use "%lli" format for OID, also with 32-bit OIDs, since the code internally takes care of proper casting. I'll apply the fix. Stefan ---------------------------------------------------------------------- Comment By: Ying Zhang (yingying) Date: 2009-06-16 10:57 Message: I have just tested a patch received from Jan (R.). It works with the patch. This bug could be closed soon. Don't we have a test for each built-in function we support/implement? Then, maybe we should consider adding them. ---------------------------------------------------------------------- Comment By: Stefan Manegold (stmane) Date: 2009-06-16 10:51 Message: works fine on 32-bit systems and on 64-bit systems with 32-bit OIDs --- apparently an OID is printed using the "%i" format ... (nice example the adding a test would have easily revealed this pattern with nightly testing ;-)) ---------------------------------------------------------------------- Comment By: Stefan Manegold (stmane) Date: 2009-06-16 10:47 Message: A quick analysis following Sjoerd's recipe reveals that the %i format is used with a lng argument --- an obvious mismatch, correctly triggering the error --- still open, whether the the lng argument is to be expected, here, next to or in addition to an int argument ... ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2009-06-16 02:34 Message: It is a bug and the bug is in pf_support.mx on one of the lines that say printf("<scope id=\"%i\">\n",...). The problem is the mismatch between the format (%i) and the type of the argument. Since I'm on vacation, somebody else can fix it. Hint: try setting a breakpoint on monet_sprintf and then run the script. ---------------------------------------------------------------------- Comment By: Ying Zhang (yingying) Date: 2009-06-16 00:17 Message: It indeed works on Mac OSX. But on my FC10 machine, I even get this error with a fresh installed version of the May 2009 release (i.e., installed with monetdb-install.sh --enable-xquery). Could someone else (using a FC10 machine) check if he/she could reproduce this error? Thanks! Jennie ---------------------------------------------------------------------- Comment By: Jan Rittinger (tsheyar) Date: 2009-06-14 18:04 Message: Hi Jennie, this works for me both with the Current as well as the stable branch: $ echo 'fn:trace(<a>blah</a>, "test ")' | pf | # MonetDB Server v4.30.1 # based on GDK v1.30.1 # Copyright (c) 1993-July 2008, CWI. All rights reserved. # Copyright (c) August 2008-2009, MonetDB B.V.. All rights reserved. # Compiled for i386-apple-darwin9.7.0/64bit with 32bit OIDs; dynamically linked. # Visit http://monetdb.cwi.nl/ for further information. # PF/Tijah module v0.13.0 loaded. http://dbappl.cs.utwente.nl/pftijah # MonetDB/XQuery module v0.28.3 loaded (default back-end is 'algebra') # XRPC administrative console at http://127.0.0.1:50001/admin <?xml version="1.0" encoding="utf-8"?> <XQueryResult><a>blah</a></XQueryResult> <scope id="0"> <iteration no="1"> <trace msg="test " id="1"> <item pos="1" type="node" id="2" fragment="0"><a>blah</a></item> </trace> </iteration> </scope> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2805513&group_id=56967 ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Monetdb-bugs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/monetdb-bugs
