i'm using mariadb c-connector with prepare, bind and execute. it works usualy. but one case end up in "corrupted unsorted chunks" and core dumping when freeing bind buffer. i suggest the whole malloc organisation is messed up after calling mysql_stmt_execute(). my test's MysqlDynamic.c show:
the problem only is connected to x509cert variable bound by bnd[9]
freeing memory only fails if bnd[9].is_null = 0, if is_null execute end normally
freeing memory (using FreeStmt()) after bind and before execute end normally
print of bnd[9].buffer before execute show (void*) is connected to the correct string buffer
same behavior for setting bnd[9].buffer_length to STMT_INDICATOR_NTS or strlen()
other similar bindings (picture, bnd[10]) do not lead to corrupted memory and core dump.
i defined a c structure test for test data in my test program MysqlDynamic.c which is bound in MYSQL_BIND structure.
bindings for x509cert (string buffer) see bindInsTest():
bnd[9].buffer_type = MYSQL_TYPE_STRING;
bnd[9].buffer_length = STMT_INDICATOR_NTS;
bnd[9].is_null = ¶->x509certI;
bnd[9].buffer = (void*) para->x509cert;
please get the details out of source file MysqlDynamic.c. please adapt defines in the source to your environment, verify content, and run it. you will find compile info in source code. MysqlDynymic -c will create the table. MysqlDynamic -i will insert 3 records each run. And 'MysqlDynamic -d` drop the the table again.
MysqlDynamic -vc show:
session set autocommit to <0>
connection id: 175
mariadb server ver:<100408>, client ver:<100408>
connected on localhost to db test by testA
>> if program get stuck - table is locked
table t_test created
mysql connection closed
pgm ended normaly
MysqlDynamic -i show
ins2: BufPara <92> name<master> stamp<> epoch<1651313806000>
cert is cert<(nil)> buf<(nil)> null<1>
picure is pic<0x5596a0f0c220> buf<0x5596a0f0c220> null<0> length<172>
ins1: BufPara <91> name<> stamp<2020-04-30> epoch<1650707701123>
cert is cert<0x5596a0f181d0> buf<0x5596a0f181d0> null<0>
picure is pic<(nil)> buf<(nil)> null<1> length<0>
ins0: BufPara <90> name<gugus> stamp<1988-10-12T18:43:36> epoch<922337203685477580>
cert is cert<(nil)> buf<(nil)> null<1>
picure is pic<(nil)> buf<(nil)> null<1> length<0>
free(): corrupted unsorted chunks
Aborted (core dumped)
checking t_test table content show all records are inserted as expected.
you can disable loading of x509cert and/or picture by commenting out the defines line 57/58. the program than end normally. you also can comment out line 208. the buffers are then indicated as NULL.
Questions:
is there a generic coding mistake in the program causing this behavior?
can you run the program in your environment without core dumping? i'm currently using version 10.04.08.
any improvment in code will be welcome.
I tried converting my .csv file to .dat format and tried to load the file into Octave. It throws an error:
unable to find file filename
I also tried to load the file in .csv format using the syntax
x = csvread(filename)
and it throws the error:
'filename' undefined near line 1 column 13.
I also tried loading the file by opening it on the editor and I tried loading it and now it shows me
warning: load: 'filepath' found by searching load path
error: load: unable to determine file format of 'Salary_Data.dat'.
How can I load my data?
>> load Salary_Data.dat
error: load: unable to find file Salary_Data.dat
>> Salary_Data
error: 'Salary_Data' undefined near line 1 column 1
>> Salary_Data
error: 'Salary_Data' undefined near line 1 column 1
>> Salary_Data
error: 'Salary_Data' undefined near line 1 column 1
>> x = csvread(Salary_Data)
error: 'Salary_Data' undefined near line 1 column 13
>> x = csvread(Salary_Data.csv)
error: 'Salary_Data' undefined near line 1 column 13
>> load Salary_Data.dat
warning: load: 'C:/Users/vaith/Desktop\Salary_Data.dat' found by searching load path
error: load: unable to determine file format of 'Salary_Data.dat'
>> load Salary_Data.csv
warning: load: 'C:/Users/vaith/Desktop\Salary_Data.csv' found by searching load path
error: load: unable to determine file format of 'Salary_Data.csv'
Salary_Data.csv
YearsExperience,Salary
1.1,39343.00
1.3,46205.00
1.5,37731.00
2.0,43525.00
2.2,39891.00
2.9,56642.00
3.0,60150.00
3.2,54445.00
3.2,64445.00
3.7,57189.00
3.9,63218.00
4.0,55794.00
4.0,56957.00
4.1,57081.00
4.5,61111.00
4.9,67938.00
5.1,66029.00
5.3,83088.00
5.9,81363.00
6.0,93940.00
6.8,91738.00
7.1,98273.00
7.9,101302.00
8.2,113812.00
8.7,109431.00
9.0,105582.00
9.5,116969.00
9.6,112635.00
10.3,122391.00
10.5,121872.00
Ok, you've stumbled through a whole pile of issues here.
It would help if you didn't give us error messages without the commands that produced them.
The first message means you were telling Octave to open something called filename and it couldn't find anything called filename. Did you define the variable filename? Your second command and the error message suggests you didn't.
Do you know what Octave's working directory is? Is it the same as where the file is located? From the response to your load commands, I'd guess not. The file is located at C:/Users/vaith/Desktop. Octave's working directory is probably somewhere else.
(Try the pwd command and see what it tells you. Use the file browser or the cd command to navigate to the same location as the file. help pwd and help cd commands would also provide useful information.)
The load command, used as a command (load file.txt) can take an input that is or isn't defined as a string. A function format (load('file.txt') or csvread('file.txt')) must be a string input, hence the quotes around file.txt. So all of your csvread input commands thought you were giving it variable names, not filenames.
Last, the fact that load couldn't read your data isn't overly surprising. Octave is trying to guess what kind of file it is and how to load it. I assume you tried help load to see what the different command options are? You can give it different options to help Octave figure it out. If it actually is a csv file though, and is all numbers not text, then csvread might still be your best option if you use it correctly. help csvread would be good information for you.
It looks from your data like you have a header line that is probably confusing the load command. For data that simply formatted, the csvread command can bring in the data. It will replace your header text with zeros.
So, first, navigate to the location of the file:
>> cd C:/Users/vaith/Desktop
then open the file:
>> mydata = csvread('Salary_Data.csv')
mydata =
0.00000 0.00000
1.10000 39343.00000
1.30000 46205.00000
1.50000 37731.00000
2.00000 43525.00000
...
If you plan to reuse the filename, you can assign it to a variable, then open the file:
>> myfile = 'Salary_Data.csv'
myfile = Salary_Data.csv
>> mydata = csvread(myfile)
mydata =
0.00000 0.00000
1.10000 39343.00000
1.30000 46205.00000
1.50000 37731.00000
2.00000 43525.00000
...
Notice how the filename is stored and used as a string with quotation marks, but the variable name is not. Also, csvread converted non-numeric header data to 'zeros'. The help for csvread and dlmread show you how to change it to something other than zero, or to skip a certain number of rows. If you want to preserve the text, you'll have to use some other input function.
I want to make my music fade in and out between songs. So I must get the music's total duration.
How do I get an Ogg's duration?
I've researched and it seems you need Mpg123Decoder but it doesn't exist. What am I doing wrong?
UPDATE:
I tried this (it might be that I am doing something wrong with the external paths):
FileHandle list = Gdx.files.internal("./bin/sounds/music");
for (FileHandle files : list.list("ogg")) {
FileHandle f = Gdx.files.external(Game.EXTERNALPATH + "sounds/music/" + files.name());
if (!f.exists()) {
files.copyTo(f);
}
musicList.add(f);
musicListInternal.add(files);
}
So the paths are:
Nulled/sounds/music/Rainbows and Unicorns.ogg
Nulled/sounds/music/The Stage is Set.ogg
Nulled/sounds/music/Victory Theme (Faded).ogg
And
currentMusic = Gdx.audio.newMusic(musicListInternal.get(currentPlayingIndex));
mpgDecoder = new Mpg123Decoder(musicList.get(currentPlayingIndex));
totalDuration = mpgDecoder.getLength();
mpgDecoder.dispose();
currentMusic.play();
But It gives me an error:
LwjglGraphics: created OpenGL 3.2+ core profile context. This is experimental!
3 musics loaded!
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000126f1d30, pid=8116, tid=3668
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b15) (build 1.8.0_45-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [gdx-audio64.dll+0x1d30]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\PhysiOS\Dropbox\Programming\workspace\nulled\desktop\hs_err_pid8116.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
AL lib: (EE) alc_cleanup: 1 device not closed
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:717] error: Encountered free format header, but failed to guess frame size.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:717] error: Encountered free format header, but failed to guess frame size.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:717] error: Encountered free format header, but failed to guess frame size.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 65688.
Note: Trying to resync...
Note: Skipped 757 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 66446.
Note: Trying to resync...
Note: Skipped 55 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 66502.
Note: Trying to resync...
Note: Skipped 32 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 66535.
Note: Trying to resync...
Note: Skipped 90 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 66626.
Note: Trying to resync...
Note: Skipped 939 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 67566.
Note: Trying to resync...
Note: Skipped 14 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1040] error: Giving up searching valid MPEG header after (over) 64K of junk.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:650] error: tried to decode obviously invalid header
Note: Illegal Audio-MPEG-Header 0x00000000 at offset 67581.
Note: Trying to resync...
Note: Skipped 1024 bytes in input.
[/var/lib/jenkins/workspace/libgdx/extensions/gdx-audio/jni/libmpg123/parse.c:1121] error: Giving up resync after 1024 bytes - your stream is not nice... (maybe increasing resync limit could help).
Trouble with mpg123: Failed to find valid MPEG data within limit on resync. (code 28)
UPDATE: Wrong decoder, used VorbisDecoder instead.
The Mpg123Decoder class comes with the audio extension ,unfortunately this extension is deprecated.Since it seems that the jars have been removed from the libgdx project extensions page and I couldn't find anything anywhere else on google, I uploaded a zip here, Its an old version but I believe it will work just fine with the new versions of libgdx.
To use it you need first to copy the music file from the application's folder to a location on the external memory
public static Mpg123Decoder getDecoder(String musicFile){
FileHandle file=Gdx.files.internal(musicFile);
FileHandle external=Gdx.files.external("myappexternalfolder/"+file.name());
if(!external.exists())file.copyTo(external); //copy the file to the external storage only if it doesnt exists yet
return new Mpg123Decoder(external);
}
public float getMusicFileLength(String musicFile){
return getDecoder(musicFile).getLength();
}
It returns a float, for example 10.5=>ten and a half seconds
After updating to 2.1.7 I get an error in the backend saying
" Warning: Invalid argument supplied for foreach() in /domains/domaindomain.nl/DEFAULT/src/Config.php on line 641
Warning: Cannot modify header information - headers already sent by (output started at /domains/ityhardy.nl/DEFAULT/src/Config.php:641) in /domains/ityhardy.nl/DEFAULT/src/Users.php on line 287
"
Using SQLite on this site.
Frontend seems to work fine.
I must add that at the time of updating I was making small changes in contenttypes.yml, don't know in which exact order I did what.
Found it: There was a stray “uses” in the wrong field somewhere in contenttypes.yml
I am trying to index csv file in Endeca.Indexing is working fine in the case the line length is less than 65536.For large data it is throwing below exception.
FATAL 02/18/14 15:45:53.122 UTC (1392738353122) FORGE {baseline}: TextObjectInputStream: while reading "/opt/soft/endeca/apps/MyApp/data/processing/TestRecord.csv", delimiter " " not found within allowed distance of 65536 characters. ............................................. .............................................. ERROR 02/17/14 16:10:58.060 UTC (1392653458060) FORGE {baseline}: I/O Exception: Error reading data from Java: EdfException thrown in: edf/src/format/Shared/TextObjectInputStream.cpp:76. Message is: exit called
How can I increase this limit to index large data(having more than 65537 character in single line) in Endeca ?.
I imagine you've fixed this. If not, your error is when the row delimiter isn't set correctly in your Record Adapter.
If your records are legitimately that long in a CSV file, switch to XML or something else.